# -*- coding: utf-8 -*-
from setuptools import setup

packages = \
['munet', 'munet.mutest', 'munet.testing']

package_data = \
{'': ['*']}

install_requires = \
['jsonschema>=4.17.1,<5.0.0', 'pexpect>=4.8.0,<5.0.0', 'pyyaml>=6.0,<7.0']

entry_points = \
{'console_scripts': ['mucmd = munet.mucmd:main',
                     'munet = munet.__main__:main',
                     'mushare = munet.mutestshare:main',
                     'mutest = munet.mutest.__main__:main',
                     'mutini = munet.mutini:main']}

setup_kwargs = {
    'name': 'munet',
    'version': '0.12.9',
    'description': 'A package to facilitate network simulations',
    'long_description': '#+STARTUP: indent\n* μNET (munet)\n#+html: <a href="https://github.com/LabNConsulting/munet/actions"><img src="https://github.com/LabNConsulting/munet/actions/workflows/ci.yml/badge.svg?branch=main"></a>\n#+html: <a href="https://codecov.io/gh/LabNConsulting/munet" ><img src="https://codecov.io/gh/LabNConsulting/munet/branch/main/graph/badge.svg?token=FD2O4YGDTT"></a>\n#+html: <a href="https://munet.readthedocs.io/en/latest/"><img src="https://readthedocs.org/projects/munet/badge?version=latest"></a>\n#+html: <p></p>\n\nA package for creating network topologies and running programs and containers\nwithin them using linux namepsaces, podman containers and qemu virtual machines.\n\nMunet can be run in a standalone mode with a configuration file for launching\nlinux shell and container based topologies, as well as be used as a library from\nwithin another application to provide the same functionality.\n\n** Standalone Config\n\nThe standalone config can be provided in a number of formats, limited by the\navailable encode/decode libraries withing the python environment. As JSON is\nbuilt in to python that format is always supported. Additionally YAML and TOML\nare supported if the corresponding packages are available (i.e., ~PyYAML~ and\n~toml~).\n\nThe config itself is defined with a YANG model which is fully defined at the end\nof this document. Below is an tree diagram of the overal format of a config file:\n\n#+NAME: Munet standalone config YANG tree diagram\n#+CALL: generate-tree(module=labn-munet-config)\n# Remove the #+RESULTS: before pushing to git, github is broken and\n# won\'t render it\n\n#+begin_example\nmodule: labn-munet-config\n  +--rw cli\n  |  +--rw commands* [name]\n  |     +--rw exec?          string\n  |     +--rw exec-kind* [kind]\n  |     |  +--rw kind    string\n  |     |  +--rw exec?   string\n  |     +--rw format?        string\n  |     +--rw help?          string\n  |     +--rw interactive?   boolean\n  |     +--rw kinds*         -> ../../../kinds/name\n  |     +--rw name           string\n  |     +--rw new-window?    boolean\n  |     +--rw top-level?     boolean\n  +--rw kinds* [name]\n  |  +--rw merge*         string\n  |  +--rw cap-add*       string\n  |  +--rw cap-remove*    string\n  |  +--rw cmd?           string\n  |  +--rw cleanup-cmd?   string\n  |  +--rw image?         string\n  |  +--rw server?        string\n  |  +--rw server-port?   uint16\n  |  +--rw qemu\n  |  |  +--rw bios?            string\n  |  |  +--rw disk?            string\n  |  |  +--rw kerenel?         string\n  |  |  +--rw initrd?          string\n  |  |  +--rw kvm?             boolean\n  |  |  +--rw ncpu?            uint32\n  |  |  +--rw memory?          string\n  |  |  +--rw root?            string\n  |  |  +--rw cmdline-extra?   string\n  |  |  +--rw extra-args?      string\n  |  |  +--rw console\n  |  |     +--rw user?       string\n  |  |     +--rw password?   string\n  |  |     +--rw expects*    string\n  |  |     +--rw sends*      string\n  |  |     +--rw timeout?    uint32\n  |  +--rw connections* [to]\n  |  |  +--rw to                    string\n  |  |  +--rw ip?                   string\n  |  |  +--rw name?                 string\n  |  |  +--rw hostintf?             string\n  |  |  +--rw physical?             string\n  |  |  +--rw remote-name?          string\n  |  |  +--rw driver?               string\n  |  |  +--rw delay?                uint64\n  |  |  +--rw jitter?               uint64\n  |  |  +--rw jitter-correlation?   decimal64\n  |  |  +--rw loss?                 uint64\n  |  |  +--rw loss-correlation?     decimal64\n  |  |  +--rw rate\n  |  |     +--rw rate?    number64\n  |  |     +--rw limit?   number64\n  |  |     +--rw burst?   number64\n  |  +--rw env* [name]\n  |  |  +--rw name     string\n  |  |  +--rw value?   string\n  |  +--rw gdb-cmd?       string\n  |  +--rw gdb-run-cmd*   string\n  |  +--rw init?          union\n  |  +--rw mounts* [destination]\n  |  |  +--rw destination    string\n  |  |  +--rw source?        string\n  |  |  +--rw tmpfs-size?    string\n  |  |  +--rw type?          string\n  |  +--rw name           string\n  |  +--rw podman\n  |  |  +--rw extra-args*   string\n  |  +--rw privileged?    boolean\n  |  +--rw shell?         union\n  |  +--rw volumes*       string\n  +--rw topology\n  |  +--rw dns-network?           -> ../networks/name\n  |  +--rw ipv6-enable?           boolean\n  |  +--rw networks-autonumber?   boolean\n  |  +--rw networks* [name]\n  |  |  +--rw name    string\n  |  |  +--rw ip?     string\n  |  +--rw nodes* [name]\n  |     +--rw id?            uint32\n  |     +--rw kind?          -> ../../../kinds/name\n  |     +--rw cap-add*       string\n  |     +--rw cap-remove*    string\n  |     +--rw cmd?           string\n  |     +--rw cleanup-cmd?   string\n  |     +--rw image?         string\n  |     +--rw server?        string\n  |     +--rw server-port?   uint16\n  |     +--rw qemu\n  |     |  +--rw bios?            string\n  |     |  +--rw disk?            string\n  |     |  +--rw kerenel?         string\n  |     |  +--rw initrd?          string\n  |     |  +--rw kvm?             boolean\n  |     |  +--rw ncpu?            uint32\n  |     |  +--rw memory?          string\n  |     |  +--rw root?            string\n  |     |  +--rw cmdline-extra?   string\n  |     |  +--rw extra-args?      string\n  |     |  +--rw console\n  |     |     +--rw user?       string\n  |     |     +--rw password?   string\n  |     |     +--rw expects*    string\n  |     |     +--rw sends*      string\n  |     |     +--rw timeout?    uint32\n  |     +--rw connections* [to]\n  |     |  +--rw to                    string\n  |     |  +--rw ip?                   string\n  |     |  +--rw name?                 string\n  |     |  +--rw hostintf?             string\n  |     |  +--rw physical?             string\n  |     |  +--rw remote-name?          string\n  |     |  +--rw driver?               string\n  |     |  +--rw delay?                uint64\n  |     |  +--rw jitter?               uint64\n  |     |  +--rw jitter-correlation?   decimal64\n  |     |  +--rw loss?                 uint64\n  |     |  +--rw loss-correlation?     decimal64\n  |     |  +--rw rate\n  |     |     +--rw rate?    number64\n  |     |     +--rw limit?   number64\n  |     |     +--rw burst?   number64\n  |     +--rw env* [name]\n  |     |  +--rw name     string\n  |     |  +--rw value?   string\n  |     +--rw gdb-cmd?       string\n  |     +--rw gdb-run-cmd*   string\n  |     +--rw init?          union\n  |     +--rw mounts* [destination]\n  |     |  +--rw destination    string\n  |     |  +--rw source?        string\n  |     |  +--rw tmpfs-size?    string\n  |     |  +--rw type?          string\n  |     +--rw name           string\n  |     +--rw podman\n  |     |  +--rw extra-args*   string\n  |     +--rw privileged?    boolean\n  |     +--rw shell?         union\n  |     +--rw volumes*       string\n  +--rw version?    uint32\n#+end_example\n\n** Examples\n*** Two Hosts Topology\n\nA very simple config with 2 hosts connected to a mgmt network.\n\nIn this config the networks are autonumbered which starts with\n~10.0.0.0/24~. So, ~h1~ will have an ~eth0~ interface with IP\n~10.0.0.1~ and ~h2~ will likewise have an ~eth0~ interface, and an IP\nof ~10.0.0.2~.\n\n#+begin_src yaml\n  topology:\n  networks-autonumber: true\n  networks:\n    - name: net0\n  nodes:\n    - name: h1\n      connections: ["net0"]\n    - name: h2\n      connections: ["net0"]\n#+end_src\n\n*** Router VM\n\nNOTE: This example is testing the boundaries of what munet can do\nwith a node. Its really here to document how to do this very complex\nthing. Beginners should probably skip it.\n\nRouter VMs are very different from standard unix-like OSs. Munet does a lot of\nautomatic configuration assuming a unix-like (and mostly Linux) OS. Various\nconfiguration parameters need to be set to tune the automatic configuration and\nassumptions down. Here\'s an example munet config fragment that shows booting a\ncisco VM using a nexos file system image.\n\n#+begin_src yaml\n  topology:\n  networks-autonumber: true\n  dns-network: "mgmt0"\n  networks:\n    - name: mgmt0\n      ip: 192.168.0.254/24\n      nat: true\n    - name: net0\n  nodes:\n    # ...\n    - name: r1\n      kind: cisco\n      connections:\n        - to: "mgmt0"\n          name: "eth1"\n          driver: "e1000"\n        - to: "net0"\n          name: "eth2"\n          driver: "e1000"\n  kinds:\n    - name: cisco\n      shell: false\n      cmd: |\n        terminal terminal-type dumb\n        terminal length 0\n        terminal width 511\n        terminal session 0\n        conf t\n        line console\n        exec-timeout 0\n        line vty\n        exec-timeout 0\n        int mgmt0\n          ip address 192.168.0.2/24\n        exit\n        feature ssh\n        feature telnet\n        end\n      qemu:\n        unix-os: false\n        disk: "%CONFIGDIR%/nexus9300v64.10.2.3.F.qcow2"\n        bios: "open-firmware"\n        memory: "8192M"\n        smp: 2\n        kvm: true\n        console:\n          stdio: false\n          user: "admin"\n          password: ""\n          prompt: "(^|\\r?\\n\\r?)switch(\\\\([^\\\\)]+\\\\))?#"\n          expects:\n            - "skip - bypass.*yes/skip/no\\\\)\\\\[no\\\\]:"\n            - "loader > "\n          sends:\n            - "skip\\n"\n            - "boot nxos64-cs.10.2.3.F.bin\\n"\n          timeout: 900\n\n  cli:\n    commands:\n      - name: ssh\n        exec: "ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null admin@%IPADDR%"\n        kinds: ["cisco"]\n        format: "ssh NODE [NODE ...]"\n        top-level: true\n        new-window: true\n#+end_src\n\n\n** Development\n\n*** Dependencies\n\nμNET requires the following packages:\n\n  python3 python3-venv\n\nAutomate tests require the following system packages:\n\n  podman\n\nEnsure you have poetry setup, the following instructions work around some bugs\nwith poetry:\n\n#+begin_src shell\n  python3 -m venv ~/.poetrybin\n  source ~/.poetrybin/bin/activate\n  pip install poetry\n  pip uninstall keyring\n#+end_src\n\nNOTE: add "~/.poetrybin/bin" to your $PATH\n\nInstall μNET with dependencies:\n\n  poetry install --all-extras\n\n*** Check your install\n\n make\n\n*** Run an example\n\nThe following uses FRR (see https://frrouting.org)\n\n   sudo poetry run munet -c examples/frr/ospf/ospf/munet.yaml\n\nFor example:\n#+begin_src shell\nmunet$ sudo poetry run munet -c examples/frr/ospf/ospf/munet.yaml\n2022-09-16 13:37:05,603: INFO: Loaded logging config /home/lberger/Code/github/labn/munet/munet/logconf.yaml\n2022-09-16 13:37:05,609: INFO: Loaded config from /home/lberger/Code/github/labn/munet/examples/frr/ospf/ospf/munet.yaml\n2022-09-16 13:37:05,623: INFO: Loaded kinds config /home/lberger/Code/github/labn/munet/munet/kinds.yaml\n2022-09-16 13:37:05,745: INFO: Munet(munet): created\n2022-09-16 13:37:05,926: INFO: L3NamespaceNode(r1): created\n2022-09-16 13:37:06,086: INFO: L3NamespaceNode(r2): created\n2022-09-16 13:37:06,247: INFO: L3NamespaceNode(r3): created\n2022-09-16 13:37:06,778: INFO: Topology up: rundir: /tmp/unet-root\n\n--- Munet CLI Starting ---\n\n\nmunet>\nmunet> help\n\nBasic Commands:\n  cli   :: open a secondary CLI window\n  help  :: this help\n  hosts :: list hosts\n  quit  :: quit the cli\n\n  HOST can be a host or one of the following:\n    - \'*\' for all hosts\n    - \'.\' for the parent munet\n    - a regex specified between \'/\' (e.g., \'/rtr.*/\')\n\nNew Window Commands:\n  hterm HOST [HOST ...] :: open terminal[s] on HOST[S] (outside containers), * for all\n  pcap NETWORK  :: capture packets from NETWORK into file capture-NETWORK.pcap the command is run within a new window which also shows packet summaries\n  stdout HOST [HOST ...]        :: tail -f on the stdout of the cmd for this node\n  stdout HOST [HOST ...]        :: tail -f on the stdout of the cmd for this node\n  term HOST [HOST ...]  :: open terminal[s] (TMUX or XTerm) on HOST[S], * for all\n  vtysh ROUTER [ROUTER ...]     ::\n  xterm HOST [HOST ...] :: open XTerm[s] on HOST[S], * for all\nInline Commands:\n  [ROUTER ...] COMMAND  :: execute vtysh COMMAND on the router[s]\n  [HOST ...] sh <SHELL-COMMAND> :: execute <SHELL-COMMAND> on hosts\n  [HOST ...] shi <INTERACTIVE-COMMAND>  :: execute <INTERACTIVE-COMMAND> on HOST[s]\nmunet> show ip ospf neighbor\n2022-09-16 13:43:13,172: INFO: Filtering hosts to kinds: [\'frr\']\n2022-09-16 13:43:13,172: INFO: Filtered hosts: [\'r1\', \'r2\', \'r3\']\n------ Host: r1 ------\n\nNeighbor ID     Pri State           Up Time         Dead Time Address         Interface                        RXmtL RqstL DBsmL\n172.16.0.2        1 Full/DR         5m21s             33.727s 10.0.1.2        eth0:10.0.1.1                        0     0     0\n172.16.0.3        1 Full/DR         5m26s             33.735s 10.0.2.3        eth1:10.0.2.1                        0     0     0\n\n------- End: r1 ------\n------ Host: r2 ------\n\nNeighbor ID     Pri State           Up Time         Dead Time Address         Interface                        RXmtL RqstL DBsmL\n172.16.0.1        1 Full/Backup     5m21s             33.707s 10.0.1.1        eth0:10.0.1.2                        0     0     0\n172.16.0.3        1 Full/DR         5m26s             33.715s 10.0.3.3        eth1:10.0.3.2                        0     0     0\n\n------- End: r2 ------\n------ Host: r3 ------\n\nNeighbor ID     Pri State           Up Time         Dead Time Address         Interface                        RXmtL RqstL DBsmL\n172.16.0.1        1 Full/Backup     5m26s             33.707s 10.0.2.1        eth0:10.0.2.3                        0     0     0\n172.16.0.2        1 Full/Backup     5m26s             33.706s 10.0.3.2        eth1:10.0.3.3                        0     0     0\n\n------- End: r3 ------\nmunet> r1 show ip ospf neighbor\n2022-09-16 13:43:18,073: INFO: Filtering hosts to kinds: [\'frr\']\n2022-09-16 13:43:18,075: INFO: Filtered hosts: [\'r1\']\n\nNeighbor ID     Pri State           Up Time         Dead Time Address         Interface                        RXmtL RqstL DBsmL\n172.16.0.2        1 Full/DR         5m26s             38.788s 10.0.1.2        eth0:10.0.1.1                        0     0     0\n172.16.0.3        1 Full/DR         5m31s             38.795s 10.0.2.3        eth1:10.0.2.1                        0     0     0\n\nmunet>\n\n#+end_src\n\n\n** Config Model\n#+NAME: test-validate-module\n#+CALL: validate-module(module=labn-munet-config)\n\n#+NAME: labn-munet-config\n#+HEADER: :var dep1=dep-babel\n#+HEADER: :file labn-munet-config.yang :results output file silent :cache yes\n#+begin_src yang :exports code\n  module labn-munet-config {\n    yang-version 1.1;\n    namespace "urn:labn:yang:labn-munet-config";\n    prefix c;\n\n    organization\n      "LabN Consulting, L.L.C.";\n\n    contact\n      "Author: Christian Hopps\n               <mailto:chopps@labn.net>";\n\n    description\n      "This module defines the configuration state for munet.";\n\n    revision 2021-12-18 {\n      description "Initial Revision";\n      reference "https://github.com/LabNConsulting/munet/blob/main/README.md";\n    }\n\n    typedef number64 {\n      type union {\n        type uint64;\n        type string {\n          pattern \'[0-9]+([KMGTPE]i?)?\';\n        }\n      }\n      description\n        "A number with optional suffix, where suffix means:\n           K -> value*10^3, Ki -> value*2^10,\n           M -> value*10^6, Mi -> value*2^20,\n           G -> value*10^9, Gi -> value*2^30,\n           T -> value*10^12, Gi -> value*2^40,\n           P -> value*10^15, Gi -> value*2^50,\n           E -> value*10^18, Gi -> value*2^60";\n    }\n\n    grouping intf-constraints {\n      description "traffic control based interface constraints";\n      leaf delay {\n        type uint64;\n        description "number of microseconds of delay";\n      }\n      leaf jitter {\n        type uint64;\n        must "../delay";\n        description "number of microseconds of possible jitter";\n      }\n      leaf jitter-correlation {\n        type decimal64 {\n          fraction-digits 16;\n          range "0..100";\n        }\n        must "../jitter";\n        description "percent correlation between consecutive jitter values";\n      }\n      leaf loss {\n        type uint64;\n        must "../delay";\n        description "number of microseconds of possible jitter";\n      }\n      leaf loss-correlation {\n        type decimal64 {\n          fraction-digits 16;\n          range "0..100";\n        }\n        must "../loss";\n        description "percent correlation between consecutive loss values";\n      }\n      container rate {\n        description "bits per second maximum rate with possible limit and burst";\n        leaf rate {\n          type number64;\n          description "bits per second maximum rate";\n        }\n        leaf limit {\n          type number64;\n          must "../rate";\n          description "bits per second maximum rate";\n        }\n        leaf burst {\n          type number64;\n          must "../rate";\n          description "bits per second maximum rate";\n        }\n      }\n    }\n\n    grouping common-node {\n      description "Common node properties";\n      leaf-list cap-add {\n        type string;\n        description "Capabilities to add to a container.";\n        reference "https://man7.org/linux/man-pages/man7/capabilities.7.html";\n      }\n      leaf-list cap-remove {\n        type string;\n        description "Capabilities to remove from a container.";\n        reference "https://man7.org/linux/man-pages/man7/capabilities.7.html";\n      }\n      leaf cmd {\n        type string;\n        description "Shell command[s] to execute when creating the node.";\n      }\n      leaf cleanup-cmd {\n        type string;\n        description\n          "Shell command[s] to execute when deleting the node.\n\n           NOTE: With container nodes, the cleanup-cmd will be run\n           prior to the `cmd` being killed, so that the container is\n           present. For Qemu/VM nodes the cleanup command is run prior\n           to the VM being brought down.";\n      }\n      leaf ready-cmd {\n        type string;\n        description\n          "Shell command[s] to execute to determine if the node is ready";\n      }\n      leaf image {\n        type string;\n        must "not(../server) and not(../qemu)" {\n          error-message "Can only have one of image, server or qemu";\n        }\n        description "Container image specification.";\n      }\n      leaf server {\n        type string;\n        must "not(../image) and not(../qemu)" {\n          error-message "Can only have one of image, server or qemu";\n        }\n        description\n          "Name of server for SSHRemote node functionality. If using\n           within pytest make sure you utilize the `unet_share` fixture\n           instead of the normal `unet` one, otherwise ssh may not\n           work as it is executing inside the munet namespace.";\n      }\n      leaf server-port {\n        type uint16;\n        must "../server" {\n          error-message "server-port requires a server";\n        }\n        default 22;\n        description\n          "SSH port to connect to server on";\n      }\n      container qemu {\n        must "not(../image) and not(../server)" {\n          error-message "Can only have one of image, server or qemu";\n        }\n        description "Specify parameters for Qemu VM node";\n        leaf bios {\n          type string;\n          description\n            "\'open-firmare\' to use open firmware bios, or a path to\n             bios image file";\n        }\n        leaf disk {\n          type string;\n          description "path to disk image possibly to boot from";\n        }\n        leaf kerenel {\n          type string;\n          description "path to kernel image (e.g,. bzImage) to boot";\n        }\n        leaf initrd {\n          type string;\n          description "path to initrd image (e.g,. rootfs.ext2) to boot";\n        }\n        leaf kvm {\n          type boolean;\n          default true;\n          description "Run with HW acceleration";\n        }\n        leaf ncpu {\n          type uint32;\n          default 1;\n          description "Number of cores";\n        }\n        leaf memory {\n          type string;\n          default "512M";\n          description "ammount of memory for VM.";\n        }\n        leaf root {\n          type string;\n          default "/dev/ram0";\n          description "root file system passed in cmdline as root=<value>";\n        }\n        leaf cmdline-extra {\n          type string;\n          description "string to add to the kernel cmdline (qemu -append)";\n        }\n        leaf extra-args {\n          type string;\n          description "extra qemu args passed when launching";\n        }\n        container console {\n          description "Configuration for console handling";\n          leaf user {\n            type string;\n            description "User to login to console with";\n          }\n          leaf password {\n            type string;\n            description "Password to login to console with";\n          }\n          leaf-list expects {\n            type string;\n            description "Strings to expect for logging into the console";\n          }\n          leaf-list sends {\n            type string;\n            description\n              "Strings paired to `expects` for logging into the\n               console. These are sent to the console when the\n               corresponding expect is seen, zero length strings are\n               allowed which indicate send nothing. An Expect with a\n               send nothing could be used to reset the timeout timer on\n               long boots";\n          }\n          leaf timeout {\n            type uint32;\n            description "Timeout for logging into the console";\n          }\n        }\n      }\n      list connections {\n        key to;\n        description "Connections to other networks or nodes from this node";\n\n        leaf to {\n          type string;\n          description "The target of this connection.";\n        }\n        leaf ip {\n          type string;\n          description "IPv4 address and mask for the connection (interface).";\n        }\n        leaf ipv6 {\n          type string;\n          description "IPv6 address and mask for the connection (interface).";\n        }\n        leaf name {\n          type string;\n          description "Name for the connection (interface name).";\n        }\n        leaf hostintf {\n          type string;\n          description "Host interface name for wired connections";\n        }\n        leaf physical {\n          type string;\n          description "Physical interface name for wired connections";\n        }\n        leaf remote-name {\n          type string;\n          description\n            "The remote name of a p2p connection. This is used for disambiguation\n             when there are multiple point-to-point connections to the same\n             remote node.";\n        }\n        leaf driver {\n          type string;\n          default "virtio-net-pc";\n          description "driver name for qemu based interfaces";\n        }\n        uses intf-constraints;\n      }\n      list env {\n        key name;\n        description\n          "List of environment variable to add to the `cmd` execution\n           environment";\n        leaf name {\n          type string;\n          description "Environment variable name.";\n        }\n        leaf value {\n          type string;\n          description "Environment variable value.";\n        }\n      }\n      leaf gdb-cmd {\n        type string;\n        description "Command to execute when --gdb option specified" ;\n      }\n      leaf-list gdb-target-cmds {\n        type string;\n        description\n          "GDB commands to execute to prior to setting breakpoints" ;\n      }\n      leaf-list gdb-run-cmds {\n        type string;\n        description\n          "GDB commands to send to gdb (e.g., to start the process running)" ;\n      }\n      leaf init {\n        type union {\n          type boolean;\n          type string;\n        }\n        description "Controls use of an init process.";\n      }\n      list mounts {\n        key destination;\n        description\n          "Mounts to be made inside the namespace. Currently only supported for\n           container based nodes.";\n\n        leaf destination {\n          type string;\n          description\n            "The inner mount point. If no source is given this will be a tmpfs\n             mount, otherwise the it is a bind mount from the `source`.";\n        }\n        leaf source {\n          type string;\n          description "The source of the bind mount.";\n        }\n        leaf tmpfs-size {\n          type string;\n          description "The size of the tmpfs.";\n        }\n        leaf type {\n          type string;\n          description "The type of the mount (currently bind or tmpfs).";\n        }\n      }\n      leaf name {\n        type string;\n        description "Name of this node or kind.";\n      }\n      container podman {\n        description "Configuration related to podman containers.";\n        leaf-list extra-args {\n          type string;\n          description "list of CLI arguments to add to the podman run command.";\n        }\n      }\n      leaf privileged {\n        type boolean;\n        description "Controls running the container in privileged mode.";\n      }\n      leaf shell {\n        type union {\n          type boolean;\n          type string;\n        }\n        description\n          "Controls use of an shell process for `cmd` execution. If \'false\' then\n           `cmd` will be run directly with exec(1), otherwise a shell will be\n           used. If this value is `true` then the default shell will be used,\n           otherwise it is a string which specifies the path to the shell to\n           use.";\n      }\n      leaf-list volumes {\n        type string;\n        description\n          "Bind or tmpfs mounts. For bind mounts the format of the string is\n           <outer>:<inner>, for tmpfs it\'s simply the inner mount path.";\n      }\n    }\n\n    container cli {\n      description "CLI additions.";\n      list commands {\n        key name;\n        description "A command to add to the CLI.";\n\n        leaf exec {\n          type string;\n          description\n            "Command to execute when the CLI command is given. The string is\n             evaluated as a python f-string with `{host}` set to the current\n             host object (or None) `{unet}` set to the Munet object, and\n             `{user_input}` to any user input that follows the command (or \'\' if\n             none specified).";\n        }\n        list exec-kind {\n          key kind;\n          description "A kind specific execution formats.";\n\n          leaf kind {\n            type string;\n            description "Kind for which this command format should be used.";\n          }\n          leaf exec {\n            type string;\n            description\n              "Command to execute when the CLI command is given. The string is\n               evaluated as a python f-string with `{host}` set to the current\n               host object (or None) `{unet}` set to the Munet object, and\n               `{user_input}` to any user input that follows the command (or \'\'\n               if none specified).";\n          }\n        }\n        leaf format {\n          type string;\n          description\n            "The format of the command. Used to print help string for user.";\n        }\n        leaf help {\n          type string;\n          description\n            "The description of the command. Used to print help string for\n             user.";\n        }\n        leaf interactive {\n          type boolean;\n          description\n            "Run the command in interactive pty.";\n        }\n        leaf-list kinds {\n          type leafref {\n            path "../../../kinds/name";\n          }\n          description\n            "List of kinds for which this command should be restricted to\n             running on.";\n        }\n        leaf name {\n          type string;\n          description "CLI command name.";\n        }\n        leaf new-window {\n          type boolean;\n          description\n            "Controls if the command runs in the CLI window or opens a new\n             terminal window to run the command in.";\n        }\n        leaf top-level {\n          type boolean;\n          default false;\n          description\n            "If true the command is run in the top-level containing namespace.\n             This is the namespace from which each of the hosts allocated\n             sub-namespaces from. Multple hosts are still allowed and their\n             variables will be substituted accordingly.";\n        }\n      }\n    }\n\n    list kinds {\n      key name;\n      description\n        "List of kinds used to group and share common node properities.";\n\n      leaf-list merge {\n        type string;\n        description\n          "List of properties which should be merged with their node specific\n           values, rather than being replaced by the node specific version.";\n      }\n      uses common-node;\n    }\n\n    container topology {\n      description "The topology munet should create.";\n\n      leaf dns-network {\n        type leafref {\n          path "../networks/name";\n        }\n        description "network used for DNS addresses of hosts in hosts files.";\n      }\n\n      leaf ipv6-enable {\n        type boolean;\n        default false;\n        description\n          "Controls if IPv6 is enabled or disabled.";\n      }\n\n      leaf networks-autonumber {\n        type boolean;\n        description\n          "Controls if networks and node connections are given IP addresses if\n           not explicitly configured.";\n      }\n\n      list networks {\n        key name;\n        description "List of networks to create.";\n\n        leaf name {\n          type string {\n            length "1..11";\n            pattern "[-a-zA-Z0-9_]+";\n          }\n          description "Name of the network";\n        }\n        leaf ip {\n          type string;\n          description\n            "IPv4 prefix for the network. If host bit\'s are set then the linux\n             bridge will be assigned that IP.";\n        }\n        leaf ipv6 {\n          type string;\n          description\n            "IPv6 prefix for the network. If host bit\'s are set then the linux\n             bridge will be assigned that IP.";\n        }\n      }\n\n      list nodes {\n        key name;\n        description "Nodes in the topology.";\n\n        leaf id {\n          type uint32;\n          description "Explicitly set the ID for the node.";\n        }\n        leaf kind {\n          type leafref {\n            path "../../../kinds/name";\n          }\n          description\n            "Indicate the kind of this node, which pulls in the properies of that\n             `kind` for this node.";\n        }\n        uses common-node;\n      }\n    }\n    leaf version {\n      type uint32;\n      description "version of this config";\n    }\n  }\n#+end_src\n\n* Appendix: Org Babel Functions\n\n#+name: dep-babel\n#+begin_src emacs-lisp :results none :exports none\n    (org-babel-do-load-languages \'org-babel-load-languages \'((shell . t)))\n    (setq fill-column 69)\n    (setq org-confirm-babel-evaluate nil)\n#+end_src\n\n#+NAME: generate-tree\n#+HEADER: :var dep1=dep-babel\n#+begin_src shell :results output verbatim replace :wrap example :exports results\n  [ -d /yang ] || DOCKER="sudo podman run --net=host -v $(pwd):/work docker.io/labn/org-rfc" #\n  $DOCKER pyang --tree-line-length=69 -f tree ${module} 2> err.out;\n#+end_src\n\n#+NAME: validate-module\n#+HEADER: :var dep1=dep-babel\n#+begin_src bash :results output verbatim replace :wrap comment :exports none\n  [ -d /yang ] || DOCKER="sudo podman run --net=host -v $(pwd):/work docker.io/labn/org-rfc"\n  if ! $DOCKER pyang -P build --lax-quote-checks -Werror --lint $module 2>&1; then echo FAIL; fi\n#+end_src\n\n',
    'author': 'Christian Hopps',
    'author_email': 'chopps@labn.net',
    'maintainer': 'None',
    'maintainer_email': 'None',
    'url': 'https://github.com/LabNConsulting/munet',
    'packages': packages,
    'package_data': package_data,
    'install_requires': install_requires,
    'entry_points': entry_points,
    'python_requires': '>=3.8,<4.0',
}


setup(**setup_kwargs)
