diff --git a/.gitmodules b/.gitmodules index 9013bdb67021..e21c5aa8bf42 100644 --- a/.gitmodules +++ b/.gitmodules @@ -124,3 +124,9 @@ [submodule "platform/innovium/sonic-platform-marvell"] path = platform/innovium/sonic-platform-marvell url = https://github.com/Marvell-switching/sonic-platform-marvell +[submodule "src/sonic-framework/gnoi"] + path = src/sonic-framework/gnoi + url = https://github.com/openconfig/gnoi +[submodule "gnoi"] + path = gnoi + url = https://github.com/openconfig/gnoi diff --git a/dockers/docker-framework/Dockerfile.j2 b/dockers/docker-framework/Dockerfile.j2 new file mode 100644 index 000000000000..9b80d028ba20 --- /dev/null +++ b/dockers/docker-framework/Dockerfile.j2 @@ -0,0 +1,33 @@ +{% from "dockers/dockerfile-macros.j2" import install_debian_packages, install_python_wheels, copy_files %} +FROM docker-config-engine-bullseye-{{DOCKER_USERNAME}}:{{DOCKER_USERTAG}} + +ARG docker_container_name +RUN [ -f /etc/rsyslog.conf ] && sed -ri "s/%syslogtag%/$docker_container_name#%syslogtag%/;" /etc/rsyslog.conf + +## Make apt-get non-interactive +ENV DEBIAN_FRONTEND=noninteractive + +RUN apt-get update && \ + apt-get install -f -y \ + libdbus-1-3 \ + libdbus-c++-1-0v5 + +{% if docker_framework_debs.strip() -%} +# Copy locally-built Debian package dependencies +{{ copy_files("debs/", docker_framework_debs.split(' '), "/debs/") }} + +# Install locally-built Debian packages and implicitly install their dependencies +{{ install_debian_packages(docker_framework_debs.split(' ')) }} +{%- endif %} + +RUN apt-get clean -y && \ + apt-get autoclean - && \ + apt-get autoremove -y && \ + rm -rf /debs /var/lib/apt/lists/* /tmp/* ~/.cache/ + +COPY ["start.sh", "/usr/bin/"] +COPY ["supervisord.conf", "/etc/supervisor/conf.d/"] +COPY ["files/supervisor-proc-exit-listener", "/usr/bin"] +# COPY ["git_commits", "/usr"] + +ENTRYPOINT ["/usr/local/bin/supervisord"] diff --git a/dockers/docker-framework/framework.sh b/dockers/docker-framework/framework.sh new file mode 100755 index 000000000000..2d2e4c2c6fa5 --- /dev/null +++ b/dockers/docker-framework/framework.sh @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +exec /usr/local/bin/framework --logtostderr diff --git a/dockers/docker-framework/start.sh b/dockers/docker-framework/start.sh new file mode 100755 index 000000000000..d6722a27fc77 --- /dev/null +++ b/dockers/docker-framework/start.sh @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +mkdir -p /var/sonic +echo "# Config files managed by sonic-config-engine" > /var/sonic/config_status diff --git a/dockers/docker-framework/supervisord.conf b/dockers/docker-framework/supervisord.conf new file mode 100644 index 000000000000..306e612ab7cd --- /dev/null +++ b/dockers/docker-framework/supervisord.conf @@ -0,0 +1,64 @@ +[supervisord] +logfile_maxbytes=1MB +logfile_backups=2 +loglevel=warn +nodaemon=true + +[eventlistener:dependent-startup] +command=python3 -m supervisord_dependent_startup --log-level warn +autostart=true +autorestart=unexpected +stdout_logfile=syslog +stderr_logfile=syslog +startretries=0 +exitcodes=0,3 +events=PROCESS_STATE +buffer_size=50 + +[eventlistener:supervisor-proc-exit-listener] +command=/usr/bin/supervisor-proc-exit-listener --container-name framework +events=PROCESS_STATE_EXITED +autostart=true +autorestart=unexpected +stdout_logfile=syslog +stderr_logfile=syslog + +[program:rsyslogd] +command=/usr/sbin/rsyslogd -n -iNONE +priority=1 +autostart=false +autorestart=unexpected +stdout_logfile=syslog +stderr_logfile=syslog +dependent_startup=true + +[program:start] +command=/usr/bin/start.sh +priority=2 +autostart=false +autorestart=false +startsecs=0 +stdout_logfile=syslog +stderr_logfile=syslog +dependent_startup=true +dependent_startup_wait_for=rsyslogd:running + +[program:stateverificationd] +command=/usr/bin/stateverificationd +priority=3 +autostart=false +autorestart=true +stdout_logfile=syslog +stderr_logfile=syslog +dependent_startup=true +dependent_startup_wait_for=start:exited + +[program:rebootbackend] +command=/usr/bin/rebootbackend +priority=3 +autostart=false +autorestart=true +stdout_logfile=syslog +stderr_logfile=syslog +dependent_startup=true +dependent_startup_wait_for=start:exited diff --git a/files/build/versions/dockers/docker-framework/versions-deb-bullseye b/files/build/versions/dockers/docker-framework/versions-deb-bullseye new file mode 100644 index 000000000000..6d3e221b421e --- /dev/null +++ b/files/build/versions/dockers/docker-framework/versions-deb-bullseye @@ -0,0 +1,229 @@ +adduser==3.118+deb11u1 +apt==2.2.4 +apt-utils==2.2.4 +base-files==11.1+deb11u9 +base-passwd==3.5.51 +bash==5.1-2+deb11u1 +bsdutils==1:2.36.1-8+deb11u2 +ca-certificates==20210119 +coreutils==8.32-4+b1 +curl==7.74.0-1.3+deb11u11 +dash==0.5.11+git20200708+dd9ef66-5 +debconf==1.5.77 +debian-archive-keyring==2021.1.1+deb11u1 +debianutils==4.11.2 +diffutils==1:3.7-5 +dpkg==1.20.13 +dpkg-dev==1.20.13 +e2fsprogs==1.46.2-2 +findutils==4.8.0-1 +framework==1.0.0 +framework-dbg==1.0.0 +gcc-10-base==10.2.1-6 +gcc-9-base==9.3.0-22 +gdb==10.1-1.7 +gdbserver==10.1-1.7 +gpgv==2.2.27-2+deb11u2 +grep==3.6-1+deb11u1 +gzip==1.10-4+deb11u1 +hostname==3.23 +init-system-helpers==1.60 +iproute2==5.10.0-4 +jq==1.6-2.1 +less==551-2+deb11u2 +libabsl20200923==0~20200923.3-2 +libacl1==2.2.53-10 +libapt-pkg6.0==2.2.4 +libatomic1==10.2.1-6 +libattr1==1:2.4.48-6 +libaudit-common==1:3.0-2 +libaudit1==1:3.0-2 +libbabeltrace1==1.5.8-1+b3 +libblkid1==2.36.1-8+deb11u2 +libboost-regex1.74.0==1.74.0-9 +libboost-serialization1.74.0==1.74.0-9 +libbpf0==1:0.3-3 +libbrotli1==1.0.9-2+b2 +libbsd0==0.11.3-1+deb11u1 +libbz2-1.0==1.0.8-4 +libc-ares2==1.17.1-1+deb11u3 +libc-bin==2.31-13+deb11u10 +libc6==2.31-13+deb11u10 +libcap-ng0==0.7.9-2.2+b1 +libcap2==1:2.44-1 +libcap2-bin==1:2.44-1 +libcbor0==0.5.0+dfsg-2 +libcom-err2==1.46.2-2 +libcrypt1==1:4.4.18-4 +libcurl3-gnutls==7.74.0-1.3+deb11u11 +libcurl4==7.74.0-1.3+deb11u11 +libdaemon0==0.14-7.1 +libdb5.3==5.3.28+dfsg1-0.8 +libdbus-1-3==1.12.28-0+deb11u1 +libdbus-c++-1-0v5==0.9.0-8.2 +libdebconfclient0==0.260 +libdebuginfod1==0.183-1 +libdw1==0.183-1 +libecore1==1.25.1-1 +libedit2==3.1-20191231-2+b1 +libeina1a==1.25.1-1 +libelf1==0.183-1 +libestr0==0.1.10-2.1+b1 +libexpat1==2.2.10-2+deb11u5 +libext2fs2==1.46.2-2 +libfastjson4==0.99.9-1 +libffi7==3.3-6 +libfido2-1==1.6.0-2 +libgcc-s1==10.2.1-6 +libgcrypt20==1.8.7-6 +libgdbm-compat4==1.19-2 +libgdbm6==1.19-2 +libglib2.0-0==2.66.8-1+deb11u3 +libgmp10==2:6.2.1+dfsg-1+deb11u1 +libgnutls30==3.7.1-5+deb11u4 +libgpg-error0==1.38-2 +libgpm2==1.20.7-8 +libgrpc++1==1.30.2-3 +libgrpc10==1.30.2-3 +libgssapi-krb5-2==1.18.3-6+deb11u4 +libhiredis0.14==0.14.1-1 +libhiredis0.14-dbgsym==0.14.1-1 +libhogweed6==3.7.3-1 +libicu67==67.1-7 +libidn2-0==2.3.0-5 +libipt2==2.0.3-1 +libjansson4==2.13.1-1.1 +libjemalloc2==5.2.1-3 +libjq1==1.6-2.1 +libjs-jquery==3.5.1+dfsg+~3.5.5-7 +libk5crypto3==1.18.3-6+deb11u4 +libkeyutils1==1.6.1-2 +libkrb5-3==1.18.3-6+deb11u4 +libkrb5support0==1.18.3-6+deb11u4 +libldap-2.4-2==2.4.57+dfsg-3+deb11u1 +liblognorm5==2.0.5-1.1 +liblua5.1-0==5.1.5-8.1+b3 +liblz4-1==1.9.3-2 +liblzf1==3.6-3 +liblzma5==5.2.5-2.1~deb11u1 +libmd0==1.0.3-3 +libmnl0==1.0.4-3 +libmount1==2.36.1-8+deb11u2 +libmpdec3==2.5.1-1 +libmpfr6==4.1.0-3 +libncurses6==6.2+20201114-2+deb11u2 +libncursesw6==6.2+20201114-2+deb11u2 +libnettle8==3.7.3-1 +libnghttp2-14==1.43.0-1+deb11u1 +libnl-3-200==3.5.0-1 +libnl-cli-3-200==3.5.0-1 +libnl-genl-3-200==3.5.0-1 +libnl-nf-3-200==3.5.0-1 +libnl-route-3-200==3.5.0-1 +libnorm1==1.5.9+dfsg-2 +libnsl2==1.3.0-2 +libonig5==6.9.6-1.1 +libp11-kit0==0.23.22-1 +libpam-modules==1.4.0-9+deb11u1 +libpam-modules-bin==1.4.0-9+deb11u1 +libpam-runtime==1.4.0-9+deb11u1 +libpam0g==1.4.0-9+deb11u1 +libpcre2-8-0==10.36-2+deb11u1 +libpcre3==2:8.39-13 +libperl5.32==5.32.1-4+deb11u3 +libpgm-5.3-0==5.3.128~dfsg-2 +libprocps8==2:3.3.17-5 +libprotobuf-dev==3.21.12-3 +libprotobuf-lite32==3.21.12-3 +libprotobuf32==3.21.12-3 +libprotoc32==3.21.12-3 +libpsl5==0.21.0-1.2 +libpython3-stdlib==3.9.2-3 +libpython3.9==3.9.2-1 +libpython3.9-minimal==3.9.2-1 +libpython3.9-stdlib==3.9.2-1 +libreadline8==8.1-1 +librtmp1==2.4+20151223.gitfa8646d.1-2+b2 +libsasl2-2==2.1.27+dfsg-2.1+deb11u1 +libsasl2-modules-db==2.1.27+dfsg-2.1+deb11u1 +libseccomp2==2.5.1-1+deb11u1 +libselinux1==3.1-3 +libsemanage-common==3.1-1 +libsemanage1==3.1-1+b2 +libsepol1==3.1-1 +libsmartcols1==2.36.1-8+deb11u2 +libsodium23==1.0.18-1 +libsource-highlight-common==3.1.9-3 +libsource-highlight4v5==3.1.9-3+b1 +libsqlite3-0==3.34.1-3 +libss2==1.46.2-2 +libssh2-1==1.9.0-2 +libssl1.1==1.1.1w-0+deb11u1 +libstdc++6==10.2.1-6 +libswsscommon==1.0.0 +libswsscommon-dbgsym==1.0.0 +libsystemd0==247.3-7+deb11u4 +libtasn1-6==4.16.0-2+deb11u1 +libtinfo6==6.2+20201114-2+deb11u2 +libtirpc-common==1.3.1-1+deb11u1 +libtirpc3==1.3.1-1+deb11u1 +libudev1==247.3-7+deb11u4 +libunistring2==0.9.10-4 +libunwind8==1.3.2-2 +libuuid1==2.36.1-8+deb11u2 +libwrap0==7.6.q-31 +libxtables12==1.8.7-1 +libxxhash0==0.8.0-2 +libyang==1.0.73 +libyang-cpp==1.0.73 +libzmq5==4.3.4-1+deb11u1 +libzstd1==1.4.8+dfsg-2.1 +login==1:4.8.1-1 +logsave==1.46.2-2 +lsb-base==11.1.0 +lua-bitop==1.0.2-5 +lua-cjson==2.1.0+dfsg-2.1 +mawk==1.3.4.20200120-2 +media-types==4.0.0 +mount==2.36.1-8+deb11u2 +ncurses-base==6.2+20201114-2+deb11u2 +ncurses-bin==6.2+20201114-2+deb11u2 +net-tools==1.60+git20181103.0eebece-1 +netbase==6.3 +openssh-client==1:8.4p1-5+deb11u3 +openssl==1.1.1w-0+deb11u1 +passwd==1:4.8.1-1 +perl==5.32.1-4+deb11u3 +perl-base==5.32.1-4+deb11u3 +perl-modules-5.32==5.32.1-4+deb11u3 +procps==2:3.3.17-5 +protobuf-compiler==3.21.12-3 +python-is-python3==3.9.2-1 +python3==3.9.2-3 +python3-distutils==3.9.2-1 +python3-lib2to3==3.9.2-1 +python3-minimal==3.9.2-3 +python3-swsscommon==1.0.0 +python3-yang==1.0.73 +python3.9==3.9.2-1 +python3.9-minimal==3.9.2-1 +readline-common==8.1-1 +redis-tools==5:6.0.16-1+deb11u2 +rsyslog==8.2302.0-1~bpo11+1 +sed==4.7-1 +socat==1.7.4.1-3 +sonic-build-hooks==1.0 +sonic-db-cli==1.0.0 +sonic-eventd==1.0.0-0 +sshpass==1.09-1+b1 +strace==5.10-1 +sysvinit-utils==2.96-7+deb11u1 +tar==1.34+dfsg-1+deb11u1 +tzdata==2024a-0+deb11u1 +util-linux==2.36.1-8+deb11u2 +vim==2:8.2.2434-3+deb11u1 +vim-common==2:8.2.2434-3+deb11u1 +vim-runtime==2:8.2.2434-3+deb11u1 +vim-tiny==2:8.2.2434-3+deb11u1 +xxd==2:8.2.2434-3+deb11u1 +zlib1g==1:1.2.11.dfsg-2+deb11u2 diff --git a/files/build/versions/dockers/docker-framework/versions-mirror b/files/build/versions/dockers/docker-framework/versions-mirror new file mode 100644 index 000000000000..1cc5fd8352b0 --- /dev/null +++ b/files/build/versions/dockers/docker-framework/versions-mirror @@ -0,0 +1,3 @@ +debian-archive.trafficmanager.net_debian-security_dists_bullseye-security==2024-05-10T08:02:59Z +debian-archive.trafficmanager.net_debian_dists_bullseye-backports==2024-05-10T02:16:16Z +debian-archive.trafficmanager.net_debian_dists_bullseye-updates==2024-05-10T02:16:16Z diff --git a/files/build/versions/dockers/docker-framework/versions-py3 b/files/build/versions/dockers/docker-framework/versions-py3 new file mode 100644 index 000000000000..3388288851dc --- /dev/null +++ b/files/build/versions/dockers/docker-framework/versions-py3 @@ -0,0 +1,26 @@ +async-timeout==4.0.3 +bitarray==1.5.3 +ijson==2.6.1 +ipaddress==1.0.23 +j2cli==0.3.10 +jinja2==3.1.4 +jsondiff==2.0.0 +lxml==4.9.1 +markupsafe==2.1.5 +natsort==6.2.1 +netaddr==0.8.0 +pip==24.0 +pyang==2.6.0 +pyangbind==0.8.1 +pyyaml==5.4.1 +redis==4.5.4 +redis-dump-load==1.1 +regex==2024.5.10 +setuptools==58.1.0 +six==1.16.0 +supervisor==4.2.1 +supervisord-dependent-startup==1.4.0 +tabulate==0.8.2 +toposort==1.10 +wheel==0.40.0 +xmltodict==0.12.0 diff --git a/files/build/versions/dockers/docker-gbsyncd-broncos/versions-deb-bullseye b/files/build/versions/dockers/docker-gbsyncd-broncos/versions-deb-bullseye index 1b81a742370b..4d6e23e85f0e 100644 --- a/files/build/versions/dockers/docker-gbsyncd-broncos/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-gbsyncd-broncos/versions-deb-bullseye @@ -17,9 +17,10 @@ libicu67==67.1-7 libipt2==2.0.3-1 libmpfr6==4.1.0-3 libnsl-dev==1.3.0-2 -libprotobuf-dev==3.12.4-1+deb11u1 -libprotobuf-lite23==3.12.4-1+deb11u1 -libprotobuf23==3.12.4-1+deb11u1 +libprotobuf-dev==3.21.12-3 +libprotobuf-lite32==3.21.12-3 +libprotobuf32==3.21.12-3 +libprotoc32==3.21.12-3 libsaibroncos==3.11 libsaimetadata==1.0.0 libsairedis==1.0.0 diff --git a/files/build/versions/dockers/docker-sonic-vs/versions-deb-bullseye b/files/build/versions/dockers/docker-sonic-vs/versions-deb-bullseye index 9086a97ef363..3567db934fff 100644 --- a/files/build/versions/dockers/docker-sonic-vs/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-sonic-vs/versions-deb-bullseye @@ -13,6 +13,7 @@ fontconfig-config==2.13.1-4.2 fonts-dejavu-core==2.37-2 fonts-font-awesome==5.0.10+really4.7.0~dfsg-4.1 fonts-lato==2.0-2.1 +framework==1.0.0 frr==8.5.4-sonic-0 gettext-base==0.21-4 gir1.2-glib-2.0==1.66.1-1+b1 diff --git a/files/build/versions/dockers/docker-syncd-pensando/versions-deb-bullseye b/files/build/versions/dockers/docker-syncd-pensando/versions-deb-bullseye index d79c3934e176..e8a796ae282e 100644 --- a/files/build/versions/dockers/docker-syncd-pensando/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-syncd-pensando/versions-deb-bullseye @@ -6,12 +6,12 @@ libgrpc++1==1.30.2-3 libgrpc-dev==1.30.2-3 libgrpc10==1.30.2-3 libkmod2==28-1 -libprotobuf-dev==3.12.4-1+deb11u1 -libprotobuf-lite23==3.12.4-1+deb11u1 -libprotobuf23==3.12.4-1+deb11u1 -libprotoc23==3.12.4-1+deb11u1 +libprotobuf-dev==3.21.12-3 +libprotobuf-lite32==3.21.12-3 +libprotobuf32==3.21.12-3 +libprotoc32==3.21.12-3 libsai==1.10.1-0 libsaimetadata==1.0.0 libsairedis==1.0.0 -protobuf-compiler==3.12.4-1+deb11u1 +protobuf-compiler==3.21.12-3 syncd==1.0.0 diff --git a/files/build_templates/framework.service.j2 b/files/build_templates/framework.service.j2 new file mode 100644 index 000000000000..c6273a3c4bc9 --- /dev/null +++ b/files/build_templates/framework.service.j2 @@ -0,0 +1,20 @@ +[Unit] +Description=Framework Container +Requires=database.service +After=database.service swss.service +BindsTo=sonic.target +After=sonic.target +Before=ntp-config.service +StartLimitIntervalSec=1200 +StartLimitBurst=3 + +[Service] +User={{ sonicadmin_user }} +ExecStartPre=/usr/bin/{{docker_container_name}}.sh start +ExecStart=/usr/bin/{{docker_container_name}}.sh wait +ExecStop=/usr/bin/{{docker_container_name}}.sh stop +Restart=always +RestartSec=30 + +[Install] +WantedBy=sonic.target diff --git a/files/build_templates/init_cfg.json.j2 b/files/build_templates/init_cfg.json.j2 index f8083f040541..ad36673f53fe 100644 --- a/files/build_templates/init_cfg.json.j2 +++ b/files/build_templates/init_cfg.json.j2 @@ -37,6 +37,7 @@ }, {%- set features = [("bgp", "{% if not DEVICE_RUNTIME_METADATA['ETHERNET_PORTS_PRESENT'] or ('CHASSIS_METADATA' in DEVICE_RUNTIME_METADATA and DEVICE_RUNTIME_METADATA['CHASSIS_METADATA']['module_type'] in ['supervisor']) %}disabled{% else %}enabled{% endif %}", false, "enabled"), ("database", "always_enabled", false, "always_enabled"), + ("framework", "enabled", false, "enabled"), ("lldp", "enabled", true, "enabled"), ("pmon", "enabled", "{% if 'type' in DEVICE_METADATA['localhost'] and DEVICE_METADATA['localhost']['type'] == 'SpineRouter' %}False{% else %}True{% endif %}", "enabled"), ("snmp", "enabled", true, "enabled"), diff --git a/gnoi b/gnoi new file mode 160000 index 000000000000..8e23e5d63965 --- /dev/null +++ b/gnoi @@ -0,0 +1 @@ +Subproject commit 8e23e5d63965c3787a5331e330b3a9450a302130 diff --git a/rules/docker-framework.dep b/rules/docker-framework.dep new file mode 100644 index 000000000000..238e16db8b09 --- /dev/null +++ b/rules/docker-framework.dep @@ -0,0 +1,10 @@ +DPATH := $($(DOCKER_FRAMEWORK)_PATH) +DEP_FILES := $(SONIC_COMMON_FILES_LIST) rules/docker-framework.mk rules/docker-framework.dep +DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST) +DEP_FILES += $(shell git ls-files $(DPATH)) + +$(DOCKER_FRAMEWORK)_CACHE_MODE := GIT_CONTENT_SHA +$(DOCKER_FRAMEWORK)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST) +$(DOCKER_FRAMEWORK)_DEP_FILES := $(DEP_FILES) + +$(eval $(call add_dbg_docker,$(DOCKER_FRAMEWORK),$(DOCKER_FRAMEWORK_DBG))) diff --git a/rules/docker-framework.mk b/rules/docker-framework.mk new file mode 100644 index 000000000000..df9a2b0b104a --- /dev/null +++ b/rules/docker-framework.mk @@ -0,0 +1,35 @@ +# docker image for framework + +DOCKER_FRAMEWORK_STEM = docker-framework +DOCKER_FRAMEWORK = $(DOCKER_FRAMEWORK_STEM).gz +DOCKER_FRAMEWORK_DBG = $(DOCKER_FRAMEWORK_STEM)-$(DBG_IMAGE_MARK).gz + +$(DOCKER_FRAMEWORK)_PATH = $(DOCKERS_PATH)/$(DOCKER_FRAMEWORK_STEM) + +$(DOCKER_FRAMEWORK)_DEPENDS += $(FRAMEWORK) +$(DOCKER_FRAMEWORK)_DBG_DEPENDS = $($(DOCKER_CONFIG_ENGINE_BULLSEYE)_DBG_DEPENDS) +$(DOCKER_FRAMEWORK)_DBG_DEPENDS += $(FRAMEWORK_DBG) $(LIBSWSSCOMMON_DBG) +$(DOCKER_FRAMEWORK)_DBG_IMAGE_PACKAGES = $($(DOCKER_CONFIG_ENGINE_BULLSEYE)_DBG_IMAGE_PACKAGES) + +$(DOCKER_FRAMEWORK)_LOAD_DOCKERS += $(DOCKER_CONFIG_ENGINE_BULLSEYE) +$(DOCKER_FRAMEWORK)_LOAD_DOCKERS += $($(DOCKER_CONFIG_ENGINE_BULLSEYE)_LOAD_DOCKERS) + +$(DOCKER_FRAMEWORK)_VERSION = 1.0.0 +$(DOCKER_FRAMEWORK)_PACKAGE_NAME = framework + +SONIC_DOCKER_IMAGES += $(DOCKER_FRAMEWORK) +SONIC_INSTALL_DOCKER_IMAGES += $(DOCKER_FRAMEWORK) + +SONIC_DOCKER_DBG_IMAGES += $(DOCKER_FRAMEWORK_DBG) +SONIC_INSTALL_DOCKER_DBG_IMAGES += $(DOCKER_FRAMEWORK_DBG) + +$(DOCKER_FRAMEWORK)_CONTAINER_NAME = framework +$(DOCKER_FRAMEWORK)_RUN_OPT += --privileged -t +$(DOCKER_FRAMEWORK)_RUN_OPT += -v /etc/sonic:/etc/sonic:ro +$(DOCKER_FRAMEWORK)_GIT_REPOSITORIES += "sonic-swss" +$(DOCKER_FRAMEWORK)_GIT_REPOSITORIES += "sonic-swss-common" + +$(DOCKER_FRAMEWORK)_FILES += $(SUPERVISOR_PROC_EXIT_LISTENER_SCRIPT) + +SONIC_BULLSEYE_DOCKERS += $(DOCKER_FRAMEWORK) +SONIC_BULLSEYE_DBG_DOCKERS += $(DOCKER_FRAMEWORK_DBG) diff --git a/rules/framework.dep b/rules/framework.dep new file mode 100644 index 000000000000..fab64e430136 --- /dev/null +++ b/rules/framework.dep @@ -0,0 +1,13 @@ + +SPATH := $($(FRAMEWORK)_SRC_PATH) +DEP_FILES := $(SONIC_COMMON_FILES_LIST) rules/framework.mk rules/framework.dep +DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST) +SMDEP_PATHS := $(SPATH) $(SPATH)/gnoi +$(foreach path, $(SMDEP_PATHS), $(eval $(path) :=$(filter-out $(SMDEP_PATHS),$(addprefix $(path)/, \ + $(shell cd $(path) && git ls-files | grep -v " "))))) + +$(FRAMEWORK)_CACHE_MODE := GIT_CONTENT_SHA +$(FRAMEWORK)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST) $(ENABLE_ASAN) +$(FRAMEWORK)_DEP_FILES := $(DEP_FILES) +$(FRAMEWORK)_SMDEP_FILES := $(foreach path, $(SMDEP_PATHS), $($(path))) +$(FRAMEWORK)_SMDEP_PATHS := $(SPATH) diff --git a/rules/framework.mk b/rules/framework.mk new file mode 100644 index 000000000000..9526ebcc20a7 --- /dev/null +++ b/rules/framework.mk @@ -0,0 +1,18 @@ +# framework package + +FRAMEWORK = framework_1.0.0_$(CONFIGURED_ARCH).deb +$(FRAMEWORK)_SRC_PATH = $(SRC_PATH)/sonic-framework +$(FRAMEWORK)_DEPENDS += $(LIBSWSSCOMMON_DEV) + +$(FRAMEWORK)_RDEPENDS += $(LIBSWSSCOMMON) +SONIC_DPKG_DEBS += $(FRAMEWORK) + +FRAMEWORK_DBG = framework-dbg_1.0.0_$(CONFIGURED_ARCH).deb +$(FRAMEWORK_DBG)_DEPENDS += $(FRAMEWORK) +$(FRAMEWORK_DBG)_RDEPENDS += $(FRAMEWORK) +$(eval $(call add_derived_package,$(FRAMEWORK),$(FRAMEWORK_DBG))) + +# The .c, .cpp, .h & .hpp files under src/{$DBG_SRC_ARCHIVE list} +# are archived into debug one image to facilitate debugging. +# +DBG_SRC_ARCHIVE += sonic-framework diff --git a/sonic-slave-bullseye/Dockerfile.j2 b/sonic-slave-bullseye/Dockerfile.j2 index 1aca2a0ba5e3..ef1e97d8aee9 100644 --- a/sonic-slave-bullseye/Dockerfile.j2 +++ b/sonic-slave-bullseye/Dockerfile.j2 @@ -1,92 +1,29 @@ -{% set prefix = DEFAULT_CONTAINER_REGISTRY %} -{%- if CONFIGURED_ARCH == "armhf" and MULTIARCH_QEMU_ENVIRON == "y" %} -FROM {{ prefix }}multiarch/qemu-user-static:x86_64-arm-6.1.0-8 as qemu -FROM {{ prefix }}multiarch/debian-debootstrap:armhf-bullseye -COPY --from=qemu /usr/bin/qemu-arm-static /usr/bin -{%- elif CONFIGURED_ARCH == "arm64" and MULTIARCH_QEMU_ENVIRON == "y" %} -FROM {{ prefix }}multiarch/qemu-user-static:x86_64-aarch64-6.1.0-8 as qemu -FROM {{ prefix }}multiarch/debian-debootstrap:arm64-bullseye -COPY --from=qemu /usr/bin/qemu-aarch64-static /usr/bin -{%- elif CONFIGURED_ARCH == "armhf" and CROSS_BUILD_ENVIRON == "y" %} -FROM {{ prefix }}multiarch/qemu-user-static:x86_64-arm-6.1.0-8 as qemu -FROM {{ prefix }}debian:bullseye -COPY --from=qemu /usr/bin/qemu-arm-static /usr/bin -{%- elif CONFIGURED_ARCH == "arm64" and CROSS_BUILD_ENVIRON == "y" %} -FROM {{ prefix }}multiarch/qemu-user-static:x86_64-aarch64-6.1.0-8 as qemu -FROM {{ prefix }}debian:bullseye -COPY --from=qemu /usr/bin/qemu-aarch64-static /usr/bin -{%- else -%} -FROM {{ prefix }}debian:bullseye -{%- endif %} +FROM debian:bullseye MAINTAINER gulv@microsoft.com COPY ["no-check-valid-until", "/etc/apt/apt.conf.d/"] COPY ["apt-retries-count", "/etc/apt/apt.conf.d"] - -{%- if CROSS_BUILD_ENVIRON != "y" %} -COPY ["sources.list.{{ CONFIGURED_ARCH }}", "/etc/apt/sources.list"] -{%- else %} COPY ["sources.list.amd64", "/etc/apt/sources.list"] -{%- if CONFIGURED_ARCH == "armhf" %} -ARG arch=armhf -ARG gcc_arch=arm-linux-gnueabihf -ARG PYTHON_CROSS_PLATFORM=linux_armv7l -{%- elif CONFIGURED_ARCH == "arm64" %} -ARG arch=arm64 -ARG gcc_arch=aarch64-linux-gnu -ARG PYTHON_CROSS_PLATFORM=linux_aarch64 -{%- endif %} - -RUN dpkg --add-architecture $arch -RUN apt-get update && apt-get install -y eatmydata -RUN eatmydata apt-get install -y crossbuild-essential-$arch -RUN eatmydata apt-get install -y gcc-$gcc_arch - -RUN apt-mark hold g++-$gcc_arch -RUN apt-mark hold g++-10-$gcc_arch -RUN apt-mark hold gcc-$gcc_arch -RUN apt-mark hold gcc-10-$gcc_arch - -ARG CROSS_CC=${gcc_arch}-gcc -ARG CROSS_CXX=${gcc_arch}-g++ -{%- endif %} ## Make apt-get non-interactive ENV DEBIAN_FRONTEND=noninteractive -{%- if CROSS_BUILD_ENVIRON == "y" %} -RUN eatmydata apt-get install -y python3 python3-pip -RUN apt-get install -y python3-minimal:$arch python3.9:$arch python3:$arch python3-dev:$arch python3-setuptools:$arch -RUN apt-get download python3-distutils && eatmydata dpkg --force-all -i python3-distutils* -RUN apt-get download python3-pip && eatmydata dpkg --force-all -i python3-pip* -RUN which pip3 && pip3 install enum34 -RUN pip3 install virtualenv - -# Create target arm python3 virtual environments with all required packages installed -RUN mkdir /python_virtualenv -RUN cd /python_virtualenv && python3 -m virtualenv --copies -p /usr/bin/python3 env3 - -RUN PATH=/python_virtualenv/env3/bin/:$PATH pip3 install setuptools==49.6.00 wheel==0.35.1 fastentrypoints pytest pytest-cov pytest-runner==5.2 nose==1.3.7 mockredispy==2.9.3 mock==3.0.5 PyYAML==5.4.1 redis==3.5.3 pexpect==4.8.0 Pympler==0.8 parameterized natsort==6.2.1 MarkupSafe==2.0.1 Jinja2==3.0.3 click tabulate netaddr netifaces pyroute2 pyfakefs sphinx && ln -s /python_virtualenv/env3/bin/pytest /python_virtualenv/env3/bin/pytest-3 - -RUN eatmydata apt-get --fix-broken install -y -RUN LIBPYTHON3_DEPS="`apt-cache depends libpython3-dev:$arch |grep Depends|awk {'print \$2;'}|tr "\n" " "`" && eatmydata apt-get install -y libpython2.7-dev:$arch $LIBPYTHON3_DEPS libxml2-dev:$arch libxslt-dev:$arch libssl-dev:$arch libz-dev:$arch - -RUN eatmydata apt-get install -y swig libssl-dev - -RUN PATH=/python_virtualenv/env3/bin/:$PATH python3 -m pip install pyang==2.4.0 -RUN PATH=/python_virtualenv/env3/bin/:$PATH python3 -m pip install pyangbind==0.8.1 -RUN PATH=/python_virtualenv/env3/bin/:$PATH python3 -m pip uninstall -y enum34 -RUN PATH=/python_virtualenv/env3/bin/:$PATH pip3 install --force-reinstall --no-cache-dir coverage -{%- endif %} - -{%- if CONFIGURED_ARCH == "arm64" and MULTIARCH_QEMU_ENVIRON == "y" %} -# multiarch/debian-debootstrap:arm64-bullseye is too old. It needs to install keys -RUN apt-get update || apt-get install -y gnupg -RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 0E98404D386FA1D9 -RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 6ED0E7B82643E131 -{%- endif %} - +# Auto-Generated for buildinfo +ARG SONIC_VERSION_CACHE +ARG SONIC_VERSION_CONTROL_COMPONENTS +COPY ["buildinfo", "/usr/local/share/buildinfo"] +COPY vcache/ /sonic/target/vcache/sonic-slave-bullseye +RUN dpkg -i /usr/local/share/buildinfo/sonic-build-hooks_1.0_all.deb +ENV IMAGENAME=sonic-slave-bullseye +ENV DISTRO=bullseye +RUN pre_run_buildinfo sonic-slave-bullseye + +RUN echo "========== BEGIN: CHECK IF PROTOBUF COMPILER EXISTS ALREADY AND UNINSTALL IT ===========" +RUN dpkg -r protobuf-compiler protobuf-compiler-grpc +RUN echo "========== END: CHECK IF PROTOBUF COMPILER EXISTS ALREADY AND UNINSTALL IT ============" + +RUN echo "======== BEGIN: PART-1 BUILD =============" RUN apt-get update && apt-get install -y eatmydata && eatmydata apt-get install -y \ apt-utils \ default-jre-headless \ @@ -116,7 +53,12 @@ RUN apt-get update && apt-get install -y eatmydata && eatmydata apt-get install dh-autoreconf \ doxygen \ devscripts \ - git-buildpackage \ + git-buildpackage + +RUN echo "======== END: PART-1 BUILD =============" +RUN echo "======== BEGIN: PART-2 BUILD =============" + +RUN apt-get install -y \ perl-modules \ libclass-accessor-perl \ libswitch-perl \ @@ -127,6 +69,17 @@ RUN apt-get update && apt-get install -y eatmydata && eatmydata apt-get install cron \ # For sonic-swss-common nlohmann-json3-dev \ +# For protobuf and gRPC + libprotobuf-dev=3.21.12-3 \ + libgrpc++-dev \ + protobuf-compiler=3.21.12-3 \ + protobuf-compiler-grpc +# For protobuf + +RUN echo "======== END: PART-2 BUILD =============" + +RUN echo "======== BEGIN: PART-3 BUILD =============" +RUN apt-get install -y \ # For quagga build libreadline-dev \ texlive-latex-base \ @@ -148,10 +101,10 @@ RUN apt-get update && apt-get install -y eatmydata && eatmydata apt-get install libsystemd-dev \ python3-ipaddr \ libcmocka-dev \ -#{%- if CROSS_BUILD_ENVIRON != "y" %} +# python3-all-dev \ python3-all-dbg \ -#{%- endif %} +# install-info \ logrotate \ # For libnl3 (local) build @@ -181,9 +134,9 @@ RUN apt-get update && apt-get install -y eatmydata && eatmydata apt-get install gem2deb \ libevent-dev \ libglib2.0-dev \ -#{%- if CROSS_BUILD_ENVIRON != "y" %} +# python3-all-dev \ -#{%- endif %} +# python3-twisted \ phpunit \ libbit-vector-perl \ @@ -224,12 +177,7 @@ RUN apt-get update && apt-get install -y eatmydata && eatmydata apt-get install squashfs-tools \ zip \ # For broadcom sdk build -{%- if CONFIGURED_ARCH == "amd64" %} linux-compiler-gcc-10-x86 \ -{%- endif %} -{%- if CONFIGURED_ARCH == "armhf" and CROSS_BUILD_ENVIRON != "y" %} - linux-compiler-gcc-10-arm \ -{%- endif %} linux-kbuild-5.10 \ # teamd build libdaemon-dev \ @@ -296,12 +244,7 @@ RUN apt-get update && apt-get install -y eatmydata && eatmydata apt-get install sphinx-common \ python3-sphinx \ # For sonic config engine testing -{%- if CROSS_BUILD_ENVIRON != "y" %} python3-dev \ -{%- endif %} -{%- if CONFIGURED_ARCH == "armhf" or CONFIGURED_ARCH == "arm64" %} - libxslt-dev \ -{%- endif %} # For lockfile procmail \ # For gtest @@ -334,12 +277,10 @@ RUN apt-get update && apt-get install -y eatmydata && eatmydata apt-get install # For initramfs shellcheck \ bash-completion \ -{%- if CONFIGURED_ARCH == "amd64" %} # For sonic vs image build dosfstools \ qemu-kvm \ libvirt-clients \ -{%- endif %} # For ntp autogen \ libopts25-dev \ @@ -420,14 +361,13 @@ RUN apt-get update && apt-get install -y eatmydata && eatmydata apt-get install # For audisp-tacplus libauparse-dev \ auditd \ -# For protobuf +# For framework container build + libdbus-c++-dev \ dh-elpa \ xmlto \ rake-compiler \ default-jdk \ libgoogle-gson-java - -{%- if CONFIGURED_ARCH != "arm64" and CONFIGURED_ARCH != "armhf" %} # For DASH BMv2 RUN eatmydata apt install -y \ # For grpc @@ -456,44 +396,14 @@ RUN eatmydata apt install -y \ python3-scapy \ python3-thrift \ libabsl20200923 libc-ares2 python3-six libboost-thread1.74.0 libboost-dev libboost-system-dev libboost-thread-dev libboost-filesystem1.74.0 libboost-program-options1.74.0 libboost-thread1.74.0 libnanomsg5 libpcap0.8 libthrift-0.13.0 libboost-dev libboost-filesystem-dev libboost-program-options-dev libgmp-dev libnanomsg-dev libpcap-dev libtool pkg-config libthrift-dev python3-thrift thrift-compiler libboost-iostreams1.74.0 libgc1 cpp libboost-dev libboost-all-dev libboost-graph-dev libboost-iostreams-dev libfl-dev libgc-dev libgmp-dev libbpf-dev tcpdump libelf-dev llvm clang python3-pyroute2 python3-ply python3-scapy python3-setuptools python3-thrift libthrift-0.13.0 -{%- endif %} -{%- if CROSS_BUILD_ENVIRON == "y" %} -# Arm vs. amd64 versions conflict - remove amd64 packages -RUN apt-get remove -y libnl-3-200 -RUN eatmydata apt-get install -y libpcre3:$arch -{%- endif %} +RUN echo "======== END: PART-3 BUILD =============" RUN eatmydata apt-get -y build-dep openssh # Build fix for ARM64 and ARMHF /etc/debian_version -{%- if CONFIGURED_ARCH == "armhf" or CONFIGURED_ARCH == "arm64" %} -RUN eatmydata apt upgrade -y base-files libc-bin=$(dpkg-query -W -f '${Version}' libc-bin) -{%- endif %} # Build fix for ARMHF bullseye libsairedis -{%- if CONFIGURED_ARCH == "armhf" and MULTIARCH_QEMU_ENVIRON == "y" %} - # Install doxygen build dependency packages - RUN eatmydata apt install -y libxapian-dev yui-compressor texlive-extra-utils \ - texlive-font-utils rdfind llvm-11-dev libclang-11-dev sassc faketime mat2 - - # Update doxygen with 64bit file offset patch - RUN dget -u http://deb.debian.org/debian/pool/main/d/doxygen/doxygen_1.9.1-2.dsc && \ - cd doxygen-1.9.1 && \ - sed -i '56 a add_definitions(-D_FILE_OFFSET_BITS=64)' CMakeLists.txt && \ - DEB_BUILD_OPTIONS=nocheck dpkg-buildpackage -us -uc -b && \ - cd .. && \ - eatmydata dpkg -i ./doxygen_1.9.1-2_armhf.deb && \ - rm -fr doxygen* - - # Aspell is unable to locate the language dictionaries. - # Re-installing aspell-en dictionary to fix it. - RUN eatmydata apt-get install --reinstall -y aspell-en - - # workaround because of https://bugs.launchpad.net/qemu/+bug/1805913, just disable aspell - # Issue now being tracked here - https://gitlab.com/qemu-project/qemu/-/issues/263 - RUN cp /bin/true /usr/bin/aspell -{%- endif %} ## Config dpkg ## install the configuration file if it’s currently missing @@ -502,23 +412,16 @@ RUN sudo augtool --autosave "set /files/etc/dpkg/dpkg.cfg/force-confmiss" RUN sudo augtool --autosave "set /files/etc/dpkg/dpkg.cfg/force-confdef" ## do not modify the current configuration file, the new version is installed with a .dpkg-dist suffix RUN sudo augtool --autosave "set /files/etc/dpkg/dpkg.cfg/force-confold" - -{%- if CROSS_BUILD_ENVIRON != "y" %} # For linux build RUN eatmydata apt-get -y build-dep linux -{%- else %} -RUN eatmydata apt-get install -y kernel-wedge -{%- endif %} # For gobgp and telemetry build RUN eatmydata apt-get install -y golang-1.15 && ln -s /usr/lib/go-1.15 /usr/local/go -{%- if INCLUDE_FIPS == "y" %} -RUN wget -O golang-go.deb 'https://sonicstorage.blob.core.windows.net/public/fips/bullseye/{{ FIPS_VERSION }}/{{ CONFIGURED_ARCH }}/golang-1.15-go_{{ FIPS_GOLANG_VERSION }}_{{ CONFIGURED_ARCH }}.deb' \ - && wget -O golang-src.deb 'https://sonicstorage.blob.core.windows.net/public/fips/bullseye/{{ FIPS_VERSION }}/{{ CONFIGURED_ARCH }}/golang-1.15-src_{{ FIPS_GOLANG_VERSION }}_{{ CONFIGURED_ARCH }}.deb' \ +RUN wget -O golang-go.deb 'https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.13/amd64/golang-1.15-go_1.15.15-1~deb11u4+fips_amd64.deb' \ + && wget -O golang-src.deb 'https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.13/amd64/golang-1.15-src_1.15.15-1~deb11u4+fips_amd64.deb' \ && eatmydata dpkg -i golang-go.deb golang-src.deb \ && ln -sf /usr/lib/go-1.15 /usr/local/go \ && rm golang-go.deb golang-src.deb -{%- endif %} RUN pip3 install --upgrade pip==24.2 RUN apt-get purge -y python3-pip python3-yaml @@ -527,16 +430,6 @@ RUN apt-get purge -y python3-pip python3-yaml RUN pip3 install setuptools==49.6.00 RUN pip3 install wheel==0.38.1 -{%- if CONFIGURED_ARCH == "armhf" %} -# Allow only manylinux wheels on armhf, to ensure that binaries/libraries work correctly on armhf -COPY ["disable-non-manylinux.patch", "/"] -{%- if CROSS_BUILD_ENVIRON == "y" %} -RUN patch -p1 -i /disable-non-manylinux.patch /python_virtualenv/env3/lib/python3.9/site-packages/pip/_vendor/packaging/tags.py -{%- else %} -RUN patch -p1 -i /disable-non-manylinux.patch /usr/local/lib/python3.9/dist-packages/pip/_vendor/packaging/tags.py -{%- endif %} -{%- endif %} - # For building sonic-utilities RUN pip3 install fastentrypoints mock @@ -551,16 +444,6 @@ RUN pip3 install nose==1.3.7 RUN pip3 install mockredispy==2.9.3 # Fix CVE-2021-23437, need to build and install libjpeg-dev for armhf for pillow 9.4.0 -{%- if CONFIGURED_ARCH == "armhf" %} -RUN TMP_DIR=$(mktemp -d) && \ - cd $TMP_DIR && \ - eatmydata apt-get install -y nasm && \ - apt-get source libjpeg-turbo && \ - cd $(ls -d libjpeg-turbo*/) && \ - dpkg-buildpackage -rfakeroot -b -us -uc > $TMP_DIR/libjpeg-dev.log && \ - eatmydata dpkg -i $TMP_DIR/libjpeg*-dev*.deb && \ - rm -rf $TMP_DIR -{%- endif %} RUN pip3 install pillow==9.4.0 # For p4 build @@ -581,9 +464,7 @@ RUN pip3 install j2cli==0.3.10 # For sonic-mgmt-framework # The option --no-build-isolation can be removed when upgrading PyYAML to 6.0.1 RUN pip3 install "PyYAML==5.4.1" --no-build-isolation -{%- if CROSS_BUILD_ENVIRON != "y" %} RUN pip3 install "lxml==4.9.1" -{%- endif %} # For sonic-platform-common testing RUN pip3 install redis @@ -617,12 +498,7 @@ RUN eatmydata apt-get install -y vim # Install rsyslog RUN eatmydata apt-get install -y rsyslog - -{%- if CROSS_BUILD_ENVIRON == "y" %} -RUN cd /usr/src/gtest && CXX=$CROSS_CXX CC=$CROSS_CC cmake . && make -C /usr/src/gtest -{%- else %} RUN cd /usr/src/gtest && cmake . && make -C /usr/src/gtest -{%- endif %} RUN mkdir /var/run/sshd EXPOSE 22 @@ -639,21 +515,14 @@ RUN eatmydata apt-get install -y \ curl \ gnupg2 \ software-properties-common -{%- if CONFIGURED_ARCH == "armhf" %} - RUN update-ca-certificates --fresh -{%- endif %} RUN curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add - RUN add-apt-repository \ -{%- if CROSS_BUILD_ENVIRON == "y" %} - "deb https://download.docker.com/linux/debian \ -{%- else %} - "deb [arch={{ CONFIGURED_ARCH }}] https://download.docker.com/linux/debian \ -{%- endif %} + "deb [arch=amd64] https://download.docker.com/linux/debian \ $(lsb_release -cs) \ stable" RUN apt-get update RUN eatmydata apt-get install -y docker-ce=5:24.0.2-1~debian.11~bullseye docker-ce-cli=5:24.0.2-1~debian.11~bullseye containerd.io=1.6.21-1 docker-buildx-plugin=0.10.5-1~debian.11~bullseye docker-compose-plugin=2.18.1-1~debian.11~bullseye -RUN echo "DOCKER_OPTS=\"--experimental --storage-driver=vfs {{ DOCKER_EXTRA_OPTS }}\"" >> /etc/default/docker +RUN echo "DOCKER_OPTS=\"--experimental --storage-driver=vfs \"" >> /etc/default/docker RUN update-alternatives --set iptables /usr/sbin/iptables-legacy # Install m2crypto package, needed by SWI tools @@ -662,35 +531,14 @@ RUN pip3 install m2crypto==0.36.0 # Install swi tools RUN pip3 install git+https://github.com/aristanetworks/swi-tools.git@bead66bf261770237f7dd21ace3774ba04a017e9 -{% if CONFIGURED_ARCH != "amd64" -%} -# Install node.js for azure pipeline -RUN curl -sL https://deb.nodesource.com/setup_14.x | bash - -RUN eatmydata apt-get install -y nodejs - -{%- if CROSS_BUILD_ENVIRON == "y" %} -RUN eatmydata apt-get install -y rsync dh-python - -RUN eatmydata apt-get install -y libelf-dev:$arch libdw-dev:$arch libbz2-dev:$arch liblzo2-dev:$arch libedit-dev:$arch libevent-dev:$arch libopts25-dev:$arch libssl-dev:$arch pps-tools:$arch libpam-cap:$arch libcap-dev:$arch libpam0g-dev:$arch libaudit-dev:$arch libgtk-3-dev:$arch libkrb5-dev:$arch libsystemd-dev:$arch libwrap0-dev:$arch libkrb5-dev:$arch libboost1.74-dev:$arch libboost-dev:$arch libzmq5:$arch libzmq3-dev:$arch libdaemon-dev:$arch libjansson-dev:$arch libmnl-dev:$arch libsensors5:$arch libsensors4-dev:$arch libperl-dev:$arch libmariadb-dev:$arch libmariadb-dev-compat:$arch libpci-dev:$arch libjson-c-dev:$arch libreadline-dev:$arch librtr-dev:$arch librrd-dev:$arch libnetfilter-conntrack-dev:$arch libnetfilter-conntrack3:$arch libnfnetlink-dev:$arch libnftnl-dev:$arch libldap2-dev:$arch libbind-export-dev:$arch check:$arch libboost-atomic-dev:$arch libboost-test-dev:$arch libglib2.0-dev:$arch libexplain-dev:$arch libc-ares-dev:$arch libiptc0:$arch libxtables12:$arch libatm1-dev:$arch libbpf-dev:$arch libdb-dev:$arch pkg-config:$arch libnghttp2-14:$arch librtmp1:$arch libssh2-1:$arch libcjson1:$arch libcjson-dev:$arch libcurl4-openssl-dev:$arch libboost-thread1.74-dev:$arch libboost-thread-dev:$arch libboost-system1.74-dev:$arch libboost-system-dev:$arch libgtest-dev:$arch libgmock-dev:$arch libfido2-dev:$arch libcunit1:$arch libcunit1-dev:$arch libauparse-dev:$arch libnetsnmptrapd40:$arch qtbase5-dev:$arch libboost-log-dev:$arch libboost-filesystem-dev:$arch libboost-program-options-dev:$arch - -RUN apt-get download libgirepository1.0-dev:$arch && eatmydata dpkg --force-all -i libgirepository1.0-dev* -RUN PATH=/python_virtualenv/env3/bin/:$PATH pip3 install pycairo - -# Install libpcsclite-dev for wpasupplicant using download because regular install removes amd64 python package -RUN apt-get download libpcsclite1:$arch && eatmydata dpkg --force-all -i libpcsclite1* && apt-get download libpcsclite-dev:$arch && eatmydata dpkg --force-all -i libpcsclite-dev* -# Install python3-dev for frr (/usr/bin/python3-config for $arch) using download because regular install removes amd64 python package -RUN apt-get download python3.9-dev:$arch && apt-get download python3-dev:$arch && eatmydata dpkg --force-all -i python3*-dev* -{% endif %} - -# Tell azure pipeline to use node.js in the docker -LABEL "com.azure.dev.pipelines.agent.handler.node.path"="/usr/bin/node" -{% endif -%} - # Install Bazel build system (amd64 and arm64 architectures are supported using this method) # TODO(PINS): Remove once pre-build Bazel binaries are available for armhf (armv7l) -{%- if CONFIGURED_ARCH == "amd64" or CONFIGURED_ARCH == "arm64" %} -ARG bazelisk_url=https://github.com/bazelbuild/bazelisk/releases/latest/download/bazelisk-linux-{{ CONFIGURED_ARCH }} +ARG bazelisk_url=https://github.com/bazelbuild/bazelisk/releases/latest/download/bazelisk-linux-amd64 RUN curl -fsSL -o /usr/local/bin/bazel ${bazelisk_url} && chmod 755 /usr/local/bin/bazel # Bazel requires "python" # TODO(PINS): remove when Bazel is okay with "python3" binary name RUN eatmydata apt install -y python-is-python3 -{% endif -%} + +RUN post_run_buildinfo sonic-slave-bullseye + +RUN post_run_cleanup sonic-slave-bullseye diff --git a/sonic-slave-bullseye/Dockerfile.j2.orig b/sonic-slave-bullseye/Dockerfile.j2.orig new file mode 100644 index 000000000000..72e23af4b5f4 --- /dev/null +++ b/sonic-slave-bullseye/Dockerfile.j2.orig @@ -0,0 +1,706 @@ +{% set prefix = DEFAULT_CONTAINER_REGISTRY %} +{%- if CONFIGURED_ARCH == "armhf" and MULTIARCH_QEMU_ENVIRON == "y" %} +FROM {{ prefix }}multiarch/qemu-user-static:x86_64-arm-6.1.0-8 as qemu +FROM {{ prefix }}multiarch/debian-debootstrap:armhf-bullseye +COPY --from=qemu /usr/bin/qemu-arm-static /usr/bin +{%- elif CONFIGURED_ARCH == "arm64" and MULTIARCH_QEMU_ENVIRON == "y" %} +FROM {{ prefix }}multiarch/qemu-user-static:x86_64-aarch64-6.1.0-8 as qemu +FROM {{ prefix }}multiarch/debian-debootstrap:arm64-bullseye +COPY --from=qemu /usr/bin/qemu-aarch64-static /usr/bin +{%- elif CONFIGURED_ARCH == "armhf" and CROSS_BUILD_ENVIRON == "y" %} +FROM {{ prefix }}multiarch/qemu-user-static:x86_64-arm-6.1.0-8 as qemu +FROM {{ prefix }}debian:bullseye +COPY --from=qemu /usr/bin/qemu-arm-static /usr/bin +{%- elif CONFIGURED_ARCH == "arm64" and CROSS_BUILD_ENVIRON == "y" %} +FROM {{ prefix }}multiarch/qemu-user-static:x86_64-aarch64-6.1.0-8 as qemu +FROM {{ prefix }}debian:bullseye +COPY --from=qemu /usr/bin/qemu-aarch64-static /usr/bin +{%- else -%} +FROM {{ prefix }}debian:bullseye +{%- endif %} + +MAINTAINER gulv@microsoft.com + +COPY ["no-check-valid-until", "/etc/apt/apt.conf.d/"] +COPY ["apt-retries-count", "/etc/apt/apt.conf.d"] + +{%- if CROSS_BUILD_ENVIRON != "y" %} +COPY ["sources.list.{{ CONFIGURED_ARCH }}", "/etc/apt/sources.list"] +{%- else %} +COPY ["sources.list.amd64", "/etc/apt/sources.list"] +{%- if CONFIGURED_ARCH == "armhf" %} +ARG arch=armhf +ARG gcc_arch=arm-linux-gnueabihf +ARG PYTHON_CROSS_PLATFORM=linux_armv7l +{%- elif CONFIGURED_ARCH == "arm64" %} +ARG arch=arm64 +ARG gcc_arch=aarch64-linux-gnu +ARG PYTHON_CROSS_PLATFORM=linux_aarch64 +{%- endif %} + +RUN dpkg --add-architecture $arch +RUN apt-get update && apt-get install -y eatmydata +RUN eatmydata apt-get install -y crossbuild-essential-$arch +RUN eatmydata apt-get install -y gcc-$gcc_arch + +RUN apt-mark hold g++-$gcc_arch +RUN apt-mark hold g++-10-$gcc_arch +RUN apt-mark hold gcc-$gcc_arch +RUN apt-mark hold gcc-10-$gcc_arch + +ARG CROSS_CC=${gcc_arch}-gcc +ARG CROSS_CXX=${gcc_arch}-g++ +{%- endif %} + +## Make apt-get non-interactive +ENV DEBIAN_FRONTEND=noninteractive + +{%- if CROSS_BUILD_ENVIRON == "y" %} +RUN eatmydata apt-get install -y python3 python3-pip +RUN apt-get install -y python3-minimal:$arch python3.9:$arch python3:$arch python3-dev:$arch python3-setuptools:$arch +RUN apt-get download python3-distutils && eatmydata dpkg --force-all -i python3-distutils* +RUN apt-get download python3-pip && eatmydata dpkg --force-all -i python3-pip* +RUN which pip3 && pip3 install enum34 +RUN pip3 install virtualenv + +# Create target arm python3 virtual environments with all required packages installed +RUN mkdir /python_virtualenv +RUN cd /python_virtualenv && python3 -m virtualenv --copies -p /usr/bin/python3 env3 + +RUN PATH=/python_virtualenv/env3/bin/:$PATH pip3 install setuptools==49.6.00 wheel==0.35.1 fastentrypoints pytest pytest-cov pytest-runner==5.2 nose==1.3.7 mockredispy==2.9.3 mock==3.0.5 PyYAML==5.4.1 redis==3.5.3 pexpect==4.8.0 Pympler==0.8 parameterized natsort==6.2.1 MarkupSafe==2.0.1 Jinja2==3.0.3 click tabulate netaddr netifaces pyroute2 pyfakefs sphinx && ln -s /python_virtualenv/env3/bin/pytest /python_virtualenv/env3/bin/pytest-3 + +RUN eatmydata apt-get --fix-broken install -y +RUN LIBPYTHON3_DEPS="`apt-cache depends libpython3-dev:$arch |grep Depends|awk {'print \$2;'}|tr "\n" " "`" && eatmydata apt-get install -y libpython2.7-dev:$arch $LIBPYTHON3_DEPS libxml2-dev:$arch libxslt-dev:$arch libssl-dev:$arch libz-dev:$arch + +RUN eatmydata apt-get install -y swig libssl-dev + +RUN PATH=/python_virtualenv/env3/bin/:$PATH python3 -m pip install pyang==2.4.0 +RUN PATH=/python_virtualenv/env3/bin/:$PATH python3 -m pip install pyangbind==0.8.1 +RUN PATH=/python_virtualenv/env3/bin/:$PATH python3 -m pip uninstall -y enum34 +RUN PATH=/python_virtualenv/env3/bin/:$PATH pip3 install --force-reinstall --no-cache-dir coverage +{%- endif %} + +{%- if CONFIGURED_ARCH == "arm64" and MULTIARCH_QEMU_ENVIRON == "y" %} +# multiarch/debian-debootstrap:arm64-bullseye is too old. It needs to install keys +RUN apt-get update || apt-get install -y gnupg +RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 0E98404D386FA1D9 +RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 6ED0E7B82643E131 +{%- endif %} + +RUN echo "========== BEGIN: CHECK IF PROTOBUF COMPILER EXISTS ALREADY AND UNINSTALL IT ===========" +RUN dpkg -r protobuf-compiler protobuf-compiler-grpc +RUN echo "========== END: CHECK IF PROTOBUF COMPILER EXISTS ALREADY AND UNINSTALL IT ============" + +RUN apt-get update && apt-get install -y eatmydata && eatmydata apt-get install -y \ + apt-utils \ + default-jre-headless \ + openssh-server \ + curl \ + wget \ + unzip \ + gzip \ + pigz \ + git \ + build-essential \ + remake \ + libtool \ + lintian \ + sudo \ + dh-make \ + dh-exec \ + kmod \ + libtinyxml2-dev \ + python-all \ + python-dev \ + python-setuptools \ + python3 \ + python3-pip \ + libncurses5-dev \ + texinfo \ + dh-autoreconf \ + doxygen \ + devscripts \ + git-buildpackage \ + perl-modules \ + libclass-accessor-perl \ + libswitch-perl \ + libzmq5 \ + libzmq3-dev \ + uuid-dev \ + jq \ + cron \ +# For sonic-swss-common + nlohmann-json3-dev \ +# For protobuf and gRPC + libprotobuf-dev \ + libgrpc++-dev \ + protobuf-compiler \ + protobuf-compiler-grpc \ +# For protobuf +# For quagga build + libreadline-dev \ + texlive-latex-base \ + texlive-plain-generic \ + texlive-fonts-recommended \ + libpam0g-dev \ + libpam-dev \ + libcap-dev \ + imagemagick \ + ghostscript \ + groff \ + libpcre3-dev \ + gawk \ + chrpath \ +# For frr build + libc-ares-dev \ + libsnmp-dev \ + libjson-c-dev \ + libsystemd-dev \ + python3-ipaddr \ + libcmocka-dev \ +#{%- if CROSS_BUILD_ENVIRON != "y" %} + python3-all-dev \ + python3-all-dbg \ +#{%- endif %} + install-info \ + logrotate \ +# For libnl3 (local) build + cdbs \ +# For SAI meta build + libxml-simple-perl \ + graphviz \ + aspell \ +# For SAI meta rpc build - make rpc + libgetopt-long-descriptive-perl \ + libconst-fast-perl \ + libtemplate-perl \ + libnamespace-autoclean-perl \ + libmoose-perl \ + libmoosex-aliases-perl \ +# For linux build + bc \ + fakeroot \ + build-essential \ + devscripts \ + quilt \ + stgit \ + sbsigntool \ +# For platform-modules build + module-assistant \ +# For thrift build\ + gem2deb \ + libevent-dev \ + libglib2.0-dev \ +#{%- if CROSS_BUILD_ENVIRON != "y" %} + python3-all-dev \ +#{%- endif %} + python3-twisted \ + phpunit \ + libbit-vector-perl \ + openjdk-11-jdk \ + javahelper \ + maven-debian-helper \ + ant \ + libhttpclient-java \ + libslf4j-java \ + libservlet3.1-java \ + pkg-php-tools \ +# For mellanox sdk build + libpcre3 \ + libpcre3-dev \ + byacc \ + flex \ + libglib2.0-dev \ + bison \ + expat \ + libexpat1-dev \ + dpatch \ + libdb-dev \ + libiptc-dev \ + libxtables-dev \ + libbpf-dev \ +# For mellanox sai build + libtool-bin \ + libxml2-dev \ +# For BFN sdk build + libusb-1.0-0-dev \ + libcurl4-openssl-dev \ + libunwind8-dev \ + telnet \ + libc-ares2 \ + libgoogle-perftools4 \ +# For build image + cpio \ + squashfs-tools \ + zip \ +# For broadcom sdk build +{%- if CONFIGURED_ARCH == "amd64" %} + linux-compiler-gcc-10-x86 \ +{%- endif %} +{%- if CONFIGURED_ARCH == "armhf" and CROSS_BUILD_ENVIRON != "y" %} + linux-compiler-gcc-10-arm \ +{%- endif %} + linux-kbuild-5.10 \ +# teamd build + libdaemon-dev \ + libdbus-1-dev \ + libjansson-dev \ +# For cavium sdk build + libpcap-dev \ + dnsutils \ + libusb-dev \ +# For cisco sdk build + libgrpc++1 \ + libabsl-dev \ +# For debian image reconfiguration + augeas-tools \ +# For p4 build + libyaml-dev \ + libevent-dev \ + libjudy-dev \ + libedit-dev \ + libnanomsg-dev \ + python3-stdeb \ +# For redis build + libjemalloc-dev \ + liblua5.1-0-dev \ + lua-bitop-dev \ + lua-cjson-dev \ +# For mft kernel module build + dkms \ +# For Jenkins static analysis, unit testing and code coverage + cppcheck \ + clang \ + pylint \ + python3-pytest \ + python3-venv \ + gcovr \ + python3-pytest-cov \ + python3-pytest-cov \ + python3-parse \ +# For snmpd + default-libmysqlclient-dev \ + libssl-dev \ + libperl-dev \ + libpci-dev \ + libpci3 \ + libsensors5 \ + libsensors4-dev \ + libwrap0-dev \ +# For lldpd + debhelper \ + autotools-dev \ + libbsd-dev \ + pkg-config \ + check \ +# For mpdecimal + docutils-common \ + libjs-sphinxdoc \ + libjs-underscore \ + python3-docutils \ + python3-jinja2 \ + python3-markupsafe \ + python3-pygments \ + python3-roman \ + python3-sphinx \ + sphinx-common \ + python3-sphinx \ +# For sonic config engine testing +{%- if CROSS_BUILD_ENVIRON != "y" %} + python3-dev \ +{%- endif %} +{%- if CONFIGURED_ARCH == "armhf" or CONFIGURED_ARCH == "arm64" %} + libxslt-dev \ +{%- endif %} +# For lockfile + procmail \ +# For gtest + libgtest-dev \ + cmake \ +# For gmock + libgmock-dev \ +# For pam_tacplus build + autoconf-archive \ +# For iproute2 + cm-super-minimal \ + libatm1-dev \ + libbpf-dev \ + libelf-dev \ + libmnl-dev \ + libselinux1-dev \ + linuxdoc-tools \ + lynx \ + texlive-latex-extra \ + texlive-latex-recommended \ + iproute2 \ +# For bash + texi2html \ + sharutils \ + locales \ + time \ + man2html-base \ + libcunit1 \ + libcunit1-dev \ +# For initramfs + shellcheck \ + bash-completion \ +{%- if CONFIGURED_ARCH == "amd64" %} +# For sonic vs image build + dosfstools \ + qemu-kvm \ + libvirt-clients \ +{%- endif %} +# For ntp + autogen \ + libopts25-dev \ + pps-tools \ + dh-apparmor \ +# For lm-sensors + librrd8 \ + librrd-dev \ + rrdtool \ +# For kdump-tools + liblzo2-dev \ +# For iptables + libnetfilter-conntrack-dev \ + libnftnl-dev \ +# For SAI3.7 + xxd \ +# For DHCP Monitor tool + libexplain-dev \ + libevent-dev \ +# For libyang + swig \ +# For build dtb + device-tree-compiler \ +# For sonic-mgmt-framework + autoconf \ + m4 \ + libxml2-utils \ + xsltproc \ + python3-lxml \ + libexpat1-dev \ + libcurl4 \ + libcjson-dev \ +# For WPA supplication + qtbase5-dev \ + aspell-en \ + libssl-dev \ + dbus \ + libdbus-1-dev \ + libdbus-glib-1-2 \ + libdbus-glib-1-dev \ + libreadline-dev \ + libncurses5-dev \ + libpcsclite-dev \ + docbook-to-man \ + docbook-utils \ +# For kdump-tools + libbz2-dev \ +# For linkmgrd + libboost-dev \ + libboost-program-options-dev \ + libboost-system-dev \ + libboost-serialization1.74-dev \ + libboost-thread-dev \ + libboost-atomic-dev \ + libboost-chrono-dev \ + libboost-container-dev \ + libboost-context-dev \ + libboost-contract-dev \ + libboost-coroutine-dev \ + libboost-date-time-dev \ + libboost-fiber-dev \ + libboost-filesystem-dev \ + libboost-graph-parallel-dev \ + libboost-log-dev \ + libboost-regex-dev \ + googletest \ + libgtest-dev \ + libgmock-dev \ + libgcc-10-dev \ +# For sonic-host-services build + libcairo2-dev \ + libdbus-1-dev \ + libgirepository1.0-dev \ + libsystemd-dev \ + pkg-config \ +# For sonic-swss-common build + libhiredis-dev \ +# For audisp-tacplus + libauparse-dev \ + auditd \ +# For framework container build + libdbus-c++-dev \ + dh-elpa \ + xmlto \ + rake-compiler \ + default-jdk \ + libgoogle-gson-java +{%- if CONFIGURED_ARCH != "arm64" and CONFIGURED_ARCH != "armhf" %} +# For DASH BMv2 +RUN eatmydata apt install -y \ +# For grpc + libgflags-dev \ + libgoogle-perftools-dev \ + ruby-googleauth \ + ruby-googleapis-common-protos-types \ + ruby-simplecov \ + cython3 \ +# For p4 libraries + valgrind \ + thrift-compiler \ + gfortran \ + libopenmpi-dev \ + libthrift-0.13.0 \ + libthrift-dev \ + libboost-all-dev \ + libboost-graph-dev \ + libboost-iostreams-dev \ + libgc-dev \ + tcpdump \ + llvm \ + net-tools \ + python3-pyroute2 \ + python3-ply \ + python3-scapy \ + python3-thrift \ + libabsl20200923 libc-ares2 python3-six libboost-thread1.74.0 libboost-dev libboost-system-dev libboost-thread-dev libboost-filesystem1.74.0 libboost-program-options1.74.0 libboost-thread1.74.0 libnanomsg5 libpcap0.8 libthrift-0.13.0 libboost-dev libboost-filesystem-dev libboost-program-options-dev libgmp-dev libnanomsg-dev libpcap-dev libtool pkg-config libthrift-dev python3-thrift thrift-compiler libboost-iostreams1.74.0 libgc1 cpp libboost-dev libboost-all-dev libboost-graph-dev libboost-iostreams-dev libfl-dev libgc-dev libgmp-dev libbpf-dev tcpdump libelf-dev llvm clang python3-pyroute2 python3-ply python3-scapy python3-setuptools python3-thrift libthrift-0.13.0 +{%- endif %} + +{%- if CROSS_BUILD_ENVIRON == "y" %} +# Arm vs. amd64 versions conflict - remove amd64 packages +RUN apt-get remove -y libnl-3-200 +RUN eatmydata apt-get install -y libpcre3:$arch +{%- endif %} + +RUN eatmydata apt-get -y build-dep openssh + +# Build fix for ARM64 and ARMHF /etc/debian_version +{%- if CONFIGURED_ARCH == "armhf" or CONFIGURED_ARCH == "arm64" %} +RUN eatmydata apt upgrade -y base-files libc-bin=$(dpkg-query -W -f '${Version}' libc-bin) +{%- endif %} + +# Build fix for ARMHF bullseye libsairedis +{%- if CONFIGURED_ARCH == "armhf" and MULTIARCH_QEMU_ENVIRON == "y" %} + # Install doxygen build dependency packages + RUN eatmydata apt install -y libxapian-dev yui-compressor texlive-extra-utils \ + texlive-font-utils rdfind llvm-11-dev libclang-11-dev sassc faketime mat2 + + # Update doxygen with 64bit file offset patch + RUN dget -u http://deb.debian.org/debian/pool/main/d/doxygen/doxygen_1.9.1-2.dsc && \ + cd doxygen-1.9.1 && \ + sed -i '56 a add_definitions(-D_FILE_OFFSET_BITS=64)' CMakeLists.txt && \ + DEB_BUILD_OPTIONS=nocheck dpkg-buildpackage -us -uc -b && \ + cd .. && \ + eatmydata dpkg -i ./doxygen_1.9.1-2_armhf.deb && \ + rm -fr doxygen* + + # Aspell is unable to locate the language dictionaries. + # Re-installing aspell-en dictionary to fix it. + RUN eatmydata apt-get install --reinstall -y aspell-en + + # workaround because of https://bugs.launchpad.net/qemu/+bug/1805913, just disable aspell + # Issue now being tracked here - https://gitlab.com/qemu-project/qemu/-/issues/263 + RUN cp /bin/true /usr/bin/aspell +{%- endif %} + +## Config dpkg +## install the configuration file if it’s currently missing +RUN sudo augtool --autosave "set /files/etc/dpkg/dpkg.cfg/force-confmiss" +## combined with confold: overwrite configuration files that you have not modified +RUN sudo augtool --autosave "set /files/etc/dpkg/dpkg.cfg/force-confdef" +## do not modify the current configuration file, the new version is installed with a .dpkg-dist suffix +RUN sudo augtool --autosave "set /files/etc/dpkg/dpkg.cfg/force-confold" + +{%- if CROSS_BUILD_ENVIRON != "y" %} +# For linux build +RUN eatmydata apt-get -y build-dep linux +{%- else %} +RUN eatmydata apt-get install -y kernel-wedge +{%- endif %} + +# For gobgp and telemetry build +RUN eatmydata apt-get install -y golang-1.15 && ln -s /usr/lib/go-1.15 /usr/local/go +{%- if INCLUDE_FIPS == "y" %} +RUN wget -O golang-go.deb 'https://sonicstorage.blob.core.windows.net/public/fips/bullseye/{{ FIPS_VERSION }}/{{ CONFIGURED_ARCH }}/golang-1.15-go_{{ FIPS_GOLANG_VERSION }}_{{ CONFIGURED_ARCH }}.deb' \ + && wget -O golang-src.deb 'https://sonicstorage.blob.core.windows.net/public/fips/bullseye/{{ FIPS_VERSION }}/{{ CONFIGURED_ARCH }}/golang-1.15-src_{{ FIPS_GOLANG_VERSION }}_{{ CONFIGURED_ARCH }}.deb' \ + && eatmydata dpkg -i golang-go.deb golang-src.deb \ + && ln -sf /usr/lib/go-1.15 /usr/local/go \ + && rm golang-go.deb golang-src.deb +{%- endif %} + +RUN pip3 install --upgrade pip==24.2 +RUN apt-get purge -y python3-pip python3-yaml + +# For building Python packages +RUN pip3 install setuptools==49.6.00 +RUN pip3 install wheel==0.38.1 + +{%- if CONFIGURED_ARCH == "armhf" %} +# Allow only manylinux wheels on armhf, to ensure that binaries/libraries work correctly on armhf +COPY ["disable-non-manylinux.patch", "/"] +{%- if CROSS_BUILD_ENVIRON == "y" %} +RUN patch -p1 -i /disable-non-manylinux.patch /python_virtualenv/env3/lib/python3.9/site-packages/pip/_vendor/packaging/tags.py +{%- else %} +RUN patch -p1 -i /disable-non-manylinux.patch /usr/local/lib/python3.9/dist-packages/pip/_vendor/packaging/tags.py +{%- endif %} +{%- endif %} + +# For building sonic-utilities +RUN pip3 install fastentrypoints mock + +# For building sonic_ycabled +# Note: upstream build breaks with old version of setuptools +# ref: https://github.com/grpc/grpc/issues/34569 +RUN pip3 install grpcio==1.58.0 grpcio-tools==1.58.0 + +# For running Python unit tests +RUN pip3 install pytest-runner==5.2 +RUN pip3 install nose==1.3.7 +RUN pip3 install mockredispy==2.9.3 + +# Fix CVE-2021-23437, need to build and install libjpeg-dev for armhf for pillow 9.4.0 +{%- if CONFIGURED_ARCH == "armhf" %} +RUN TMP_DIR=$(mktemp -d) && \ + cd $TMP_DIR && \ + eatmydata apt-get install -y nasm && \ + apt-get source libjpeg-turbo && \ + cd $(ls -d libjpeg-turbo*/) && \ + dpkg-buildpackage -rfakeroot -b -us -uc > $TMP_DIR/libjpeg-dev.log && \ + eatmydata dpkg -i $TMP_DIR/libjpeg*-dev*.deb && \ + rm -rf $TMP_DIR +{%- endif %} +RUN pip3 install pillow==9.4.0 + +# For p4 build +RUN pip3 install \ + ctypesgen==1.0.2 \ + crc16 + +# For sonic config engine testing +# Install pyangbind here, outside sonic-config-engine dependencies, as pyangbind causes enum34 to be installed. +# enum34 causes Python 're' package to not work properly as it redefines an incompatible enum.py module +# https://github.com/robshakir/pyangbind/issues/232 +RUN pip3 install pyangbind==0.8.1 +RUN pip3 uninstall -y enum34 + +# For templating +RUN pip3 install j2cli==0.3.10 + +# For sonic-mgmt-framework +# The option --no-build-isolation can be removed when upgrading PyYAML to 6.0.1 +RUN pip3 install "PyYAML==5.4.1" --no-build-isolation +{%- if CROSS_BUILD_ENVIRON != "y" %} +RUN pip3 install "lxml==4.9.1" +{%- endif %} + +# For sonic-platform-common testing +RUN pip3 install redis +RUN pip3 install psutil +RUN pip3 install blkinfo + +# For vs image build +RUN pip3 install pexpect==4.8.0 + +# For sonic-swss-common testing +RUN pip3 install Pympler==0.8 + +# For sonic_yang_model build +RUN pip3 install pyang==2.4.0 + +# For mgmt-framework build +RUN pip3 install mmh3==2.5.1 + +RUN pip3 install parameterized==0.8.1 + +# For DASH BMv2 +RUN pip3 install jsonpath_ng + +RUN eatmydata apt-get install -y xsltproc + +# Install dependencies for isc-dhcp-relay build +RUN eatmydata apt-get -y build-dep isc-dhcp + +# Install vim +RUN eatmydata apt-get install -y vim + +# Install rsyslog +RUN eatmydata apt-get install -y rsyslog + +{%- if CROSS_BUILD_ENVIRON == "y" %} +RUN cd /usr/src/gtest && CXX=$CROSS_CXX CC=$CROSS_CC cmake . && make -C /usr/src/gtest +{%- else %} +RUN cd /usr/src/gtest && cmake . && make -C /usr/src/gtest +{%- endif %} + +RUN mkdir /var/run/sshd +EXPOSE 22 + +# Install dependencies for dhcp relay test +RUN pip3 install parameterized==0.8.1 +RUN pip3 install pyfakefs + +# Install docker engine 24 inside docker and enable experimental feature +RUN apt-get update +RUN eatmydata apt-get install -y \ + apt-transport-https \ + ca-certificates \ + curl \ + gnupg2 \ + software-properties-common +{%- if CONFIGURED_ARCH == "armhf" %} + RUN update-ca-certificates --fresh +{%- endif %} +RUN curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add - +RUN add-apt-repository \ +{%- if CROSS_BUILD_ENVIRON == "y" %} + "deb https://download.docker.com/linux/debian \ +{%- else %} + "deb [arch={{ CONFIGURED_ARCH }}] https://download.docker.com/linux/debian \ +{%- endif %} + $(lsb_release -cs) \ + stable" +RUN apt-get update +RUN eatmydata apt-get install -y docker-ce=5:24.0.2-1~debian.11~bullseye docker-ce-cli=5:24.0.2-1~debian.11~bullseye containerd.io=1.6.21-1 docker-buildx-plugin=0.10.5-1~debian.11~bullseye docker-compose-plugin=2.18.1-1~debian.11~bullseye +RUN echo "DOCKER_OPTS=\"--experimental --storage-driver=vfs {{ DOCKER_EXTRA_OPTS }}\"" >> /etc/default/docker +RUN update-alternatives --set iptables /usr/sbin/iptables-legacy + +# Install m2crypto package, needed by SWI tools +RUN pip3 install m2crypto==0.36.0 + +# Install swi tools +RUN pip3 install git+https://github.com/aristanetworks/swi-tools.git@bead66bf261770237f7dd21ace3774ba04a017e9 + +{% if CONFIGURED_ARCH != "amd64" -%} +# Install node.js for azure pipeline +RUN curl -sL https://deb.nodesource.com/setup_14.x | bash - +RUN eatmydata apt-get install -y nodejs + +{%- if CROSS_BUILD_ENVIRON == "y" %} +RUN eatmydata apt-get install -y rsync dh-python + +RUN eatmydata apt-get install -y libelf-dev:$arch libdw-dev:$arch libbz2-dev:$arch liblzo2-dev:$arch libedit-dev:$arch libevent-dev:$arch libopts25-dev:$arch libssl-dev:$arch pps-tools:$arch libpam-cap:$arch libcap-dev:$arch libpam0g-dev:$arch libaudit-dev:$arch libgtk-3-dev:$arch libkrb5-dev:$arch libsystemd-dev:$arch libwrap0-dev:$arch libkrb5-dev:$arch libboost1.74-dev:$arch libboost-dev:$arch libzmq5:$arch libzmq3-dev:$arch libdaemon-dev:$arch libjansson-dev:$arch libmnl-dev:$arch libsensors5:$arch libsensors4-dev:$arch libperl-dev:$arch libmariadb-dev:$arch libmariadb-dev-compat:$arch libpci-dev:$arch libjson-c-dev:$arch libreadline-dev:$arch librtr-dev:$arch librrd-dev:$arch libnetfilter-conntrack-dev:$arch libnetfilter-conntrack3:$arch libnfnetlink-dev:$arch libnftnl-dev:$arch libldap2-dev:$arch libbind-export-dev:$arch check:$arch libboost-atomic-dev:$arch libboost-test-dev:$arch libglib2.0-dev:$arch libexplain-dev:$arch libc-ares-dev:$arch libiptc0:$arch libxtables12:$arch libatm1-dev:$arch libbpf-dev:$arch libdb-dev:$arch pkg-config:$arch libnghttp2-14:$arch librtmp1:$arch libssh2-1:$arch libcjson1:$arch libcjson-dev:$arch libcurl4-openssl-dev:$arch libboost-thread1.74-dev:$arch libboost-thread-dev:$arch libboost-system1.74-dev:$arch libboost-system-dev:$arch libgtest-dev:$arch libgmock-dev:$arch libfido2-dev:$arch libcunit1:$arch libcunit1-dev:$arch libauparse-dev:$arch libnetsnmptrapd40:$arch qtbase5-dev:$arch libboost-log-dev:$arch libboost-filesystem-dev:$arch libboost-program-options-dev:$arch + +RUN apt-get download libgirepository1.0-dev:$arch && eatmydata dpkg --force-all -i libgirepository1.0-dev* +RUN PATH=/python_virtualenv/env3/bin/:$PATH pip3 install pycairo + +# Install libpcsclite-dev for wpasupplicant using download because regular install removes amd64 python package +RUN apt-get download libpcsclite1:$arch && eatmydata dpkg --force-all -i libpcsclite1* && apt-get download libpcsclite-dev:$arch && eatmydata dpkg --force-all -i libpcsclite-dev* +# Install python3-dev for frr (/usr/bin/python3-config for $arch) using download because regular install removes amd64 python package +RUN apt-get download python3.9-dev:$arch && apt-get download python3-dev:$arch && eatmydata dpkg --force-all -i python3*-dev* +{% endif %} + +# Tell azure pipeline to use node.js in the docker +LABEL "com.azure.dev.pipelines.agent.handler.node.path"="/usr/bin/node" +{% endif -%} + +# Install Bazel build system (amd64 and arm64 architectures are supported using this method) +# TODO(PINS): Remove once pre-build Bazel binaries are available for armhf (armv7l) +{%- if CONFIGURED_ARCH == "amd64" or CONFIGURED_ARCH == "arm64" %} +ARG bazelisk_url=https://github.com/bazelbuild/bazelisk/releases/latest/download/bazelisk-linux-{{ CONFIGURED_ARCH }} +RUN curl -fsSL -o /usr/local/bin/bazel ${bazelisk_url} && chmod 755 /usr/local/bin/bazel +# Bazel requires "python" +# TODO(PINS): remove when Bazel is okay with "python3" binary name +RUN eatmydata apt install -y python-is-python3 +{% endif -%} diff --git a/src/sonic-framework/.gitignore b/src/sonic-framework/.gitignore new file mode 100644 index 000000000000..b3c79bc051f0 --- /dev/null +++ b/src/sonic-framework/.gitignore @@ -0,0 +1,45 @@ +# Compiled Source # +################### +*.la +*.lo +*.o +*.pyc + +# Packaging Files # +################### +**/Makefile +Makefile.in +aclocal.m4 +autom4te.cache/ +config +config.h +config.h.in +config.h.in~ +config.log +config.status +configure +libtool +stamp-h1 + +debian/.debhelper/ +debian/autoreconf.after +debian/autoreconf.before +debian/debhelper-build-stamp +debian/files +debian/*.debhelper.log +debian/*.substvars + +debian/framework +debian/framework-dbg + +# Prebuilt Source +############### +rebootbackend/common +rebootbackend/system +rebootbackend/types + +# Executables # +############### +rebootbackend/rebootbackend +stateverificationd/stateverificationd + diff --git a/src/sonic-framework/Makefile.am b/src/sonic-framework/Makefile.am new file mode 100644 index 000000000000..37ad5a41dc7c --- /dev/null +++ b/src/sonic-framework/Makefile.am @@ -0,0 +1,21 @@ +.PHONY: compile_protobufs +BUILT_SOURCES = rebootbackend_protobuf_compilation rebootbackend_dbus_compilation + +# compile_protobufs target needed by: +# gpins-cicd/scripts/sonic-framework/build_and_test_in_docker.sh +compile_protobufs: rebootbackend_protobuf_compilation rebootbackend_dbus_compilation + +rebootbackend_protobuf_compilation: + /usr/bin/protoc --cpp_out=rebootbackend --proto_path=./gnoi \ + ./gnoi/types/types.proto \ + ./gnoi/common/common.proto \ + ./gnoi/system/system.proto + /usr/bin/protoc --experimental_allow_proto3_optional --cpp_out=. rebootbackend/container_stop.proto + +rebootbackend_dbus_compilation: + /usr/bin/dbusxx-xml2cpp rebootbackend/gnoi_reboot.xml \ + --proxy=rebootbackend/gnoi_reboot_dbus.h + /usr/bin/dbusxx-xml2cpp rebootbackend/gnoi_container_shutdown.xml \ + --proxy=rebootbackend/gnoi_container_shutdown_dbus.h + +SUBDIRS = rebootbackend diff --git a/src/sonic-framework/autogen.sh b/src/sonic-framework/autogen.sh new file mode 100755 index 000000000000..c282a898f1c1 --- /dev/null +++ b/src/sonic-framework/autogen.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +libtoolize --force --copy && +autoreconf --force --install -I m4 +rm -Rf autom4te.cache diff --git a/src/sonic-framework/configure.ac b/src/sonic-framework/configure.ac new file mode 100644 index 000000000000..3a315230495f --- /dev/null +++ b/src/sonic-framework/configure.ac @@ -0,0 +1,84 @@ +AC_INIT([sonic-swss],[1.0]) +AC_CONFIG_SRCDIR([]) +AC_CONFIG_AUX_DIR(config) +AM_CONFIG_HEADER(config.h) +AM_INIT_AUTOMAKE([foreign]) +AC_LANG_C +AC_LANG([C++]) +AC_PROG_CC +AC_PROG_CXX +AC_PROG_LIBTOOL +AC_HEADER_STDC + +AC_CHECK_LIB([hiredis], [redisConnect],, + AC_MSG_ERROR([libhiredis is not installed.])) + +PKG_CHECK_MODULES([JANSSON], [jansson]) + +AC_ARG_ENABLE(debug, +[ --enable-debug Compile with debugging flags], +[case "${enableval}" in + yes) debug=true ;; + no) debug=false ;; + *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;; +esac],[debug=false]) +AM_CONDITIONAL(DEBUG, test x$debug = xtrue) + +AC_ARG_WITH(extra-inc, +[ --with-extra-inc=DIR + prefix where extra includes are installed], +[AC_SUBST(CPPFLAGS, "$CPPFLAGS -I${withval} -I${withval}/swss")]) + +AC_ARG_WITH(extra-lib, +[ --with-extra-lib=DIR + prefix where extra libraries are installed], +[AC_SUBST(LDFLAGS, "$LDFLAGS -L${withval}")]) + +CFLAGS_COMMON="-std=c++14 -Wall -fPIC -Wno-write-strings -I/usr/include/swss" + +CFLAGS_COMMON+=" -Werror" +CFLAGS_COMMON+=" -Wno-reorder" +CFLAGS_COMMON+=" -Wcast-align" +CFLAGS_COMMON+=" -Wcast-qual" +#TODO (b/314850353): Re-enable conversion errors with updated protoc compiler. +#CFLAGS_COMMON+=" -Wconversion" +CFLAGS_COMMON+=" -Wdisabled-optimization" +CFLAGS_COMMON+=" -Wextra" +CFLAGS_COMMON+=" -Wfloat-equal" +CFLAGS_COMMON+=" -Wformat=2" +CFLAGS_COMMON+=" -Wformat-nonliteral" +CFLAGS_COMMON+=" -Wformat-security" +CFLAGS_COMMON+=" -Wformat-y2k" +CFLAGS_COMMON+=" -Wimport" +CFLAGS_COMMON+=" -Winit-self" +CFLAGS_COMMON+=" -Winvalid-pch" +CFLAGS_COMMON+=" -Wlong-long" +CFLAGS_COMMON+=" -Wmissing-field-initializers" +CFLAGS_COMMON+=" -Wmissing-format-attribute" +CFLAGS_COMMON+=" -Wno-aggregate-return" +CFLAGS_COMMON+=" -Wno-padded" +CFLAGS_COMMON+=" -Wno-switch-enum" +CFLAGS_COMMON+=" -Wno-unused-parameter" +CFLAGS_COMMON+=" -Wpacked" +CFLAGS_COMMON+=" -Wpointer-arith" +CFLAGS_COMMON+=" -Wredundant-decls" +CFLAGS_COMMON+=" -Wstack-protector" +CFLAGS_COMMON+=" -Wstrict-aliasing=3" +CFLAGS_COMMON+=" -Wswitch" +CFLAGS_COMMON+=" -Wswitch-default" +CFLAGS_COMMON+=" -Wunreachable-code" +CFLAGS_COMMON+=" -Wunused" +CFLAGS_COMMON+=" -Wvariadic-macros" +CFLAGS_COMMON+=" -Wno-switch-default" +CFLAGS_COMMON+=" -Wno-long-long" +CFLAGS_COMMON+=" -Wno-redundant-decls" + +AC_SUBST(CFLAGS_COMMON) + +AC_CONFIG_FILES([ + Makefile + rebootbackend/Makefile + tests/Makefile +]) + +AC_OUTPUT diff --git a/src/sonic-framework/debian/changelog b/src/sonic-framework/debian/changelog new file mode 100644 index 000000000000..04ec2aecab85 --- /dev/null +++ b/src/sonic-framework/debian/changelog @@ -0,0 +1,6 @@ +sonic (1.0.0) stable; urgency=medium + + * Initial release. + + -- Runming Wu Wed, 20 Sep 2023 12:00:00 -0800 + diff --git a/src/sonic-framework/debian/compat b/src/sonic-framework/debian/compat new file mode 100644 index 000000000000..f599e28b8ab0 --- /dev/null +++ b/src/sonic-framework/debian/compat @@ -0,0 +1 @@ +10 diff --git a/src/sonic-framework/debian/control b/src/sonic-framework/debian/control new file mode 100644 index 000000000000..d1c19f4ad296 --- /dev/null +++ b/src/sonic-framework/debian/control @@ -0,0 +1,18 @@ +Source: sonic +Maintainer: Runming Wu +Section: net +Priority: optional +Build-Depends: dh-exec (>=0.3), debhelper (>= 9), autotools-dev +Standards-Version: 1.0.0 + +Package: framework +Architecture: any +Depends: ${shlibs:Depends} +Description: This package contains framework service for GPINs project. + +Package: framework-dbg +Architecture: any +Section: debug +Priority: extra +Depends: framework (=${binary:Version}) +Description: debugging symbols for framework diff --git a/src/sonic-framework/debian/rules b/src/sonic-framework/debian/rules new file mode 100755 index 000000000000..a1a2957b9fec --- /dev/null +++ b/src/sonic-framework/debian/rules @@ -0,0 +1,38 @@ +#!/usr/bin/make -f +# See debhelper(7) (uncomment to enable) +# output every command that modifies files on the build system. +#export DH_VERBOSE = 1 + +# see EXAMPLES in dpkg-buildflags(1) and read /usr/share/dpkg/* +DPKG_EXPORT_BUILDFLAGS = 1 +include /usr/share/dpkg/default.mk + +# see FEATURE AREAS in dpkg-buildflags(1) +#export DEB_BUILD_MAINT_OPTIONS = hardening=+all + +# see ENVIRONMENT in dpkg-buildflags(1) +# package maintainers to append CFLAGS +#export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic +# package maintainers to append LDFLAGS +#export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed + + +# main packaging script based on dh7 syntax +%: + dh $@ --with autotools-dev + +# dh_make generated override targets +# This is example for Cmake (See https://bugs.debian.org/641051 ) +#override_dh_auto_configure: +# dh_auto_configure -- \ +# -DCMAKE_LIBRARY_PATH=$(DEB_HOST_MULTIARCH) + +override_dh_auto_configure: + dh_auto_configure -- $(configure_opts) + +override_dh_auto_install: + dh_auto_install --destdir=debian/framework + +override_dh_strip: + dh_strip -pframework --dbg-package=framework-dbg + diff --git a/src/sonic-framework/gnoi/.bazelversion b/src/sonic-framework/gnoi/.bazelversion new file mode 100644 index 000000000000..19b860c1872d --- /dev/null +++ b/src/sonic-framework/gnoi/.bazelversion @@ -0,0 +1 @@ +6.4.0 diff --git a/src/sonic-framework/gnoi/.github/dependabot.yml b/src/sonic-framework/gnoi/.github/dependabot.yml new file mode 100644 index 000000000000..a2a66d097fb4 --- /dev/null +++ b/src/sonic-framework/gnoi/.github/dependabot.yml @@ -0,0 +1,15 @@ +# To get started with Dependabot version updates, you'll need to specify which +# package ecosystems to update and where the package manifests are located. +# Please see the documentation for all configuration options: +# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates + +version: 2 +updates: + - package-ecosystem: "gomod" # See documentation for possible values + directory: "/" # Location of package manifests + schedule: + interval: "weekly" + - package-ecosystem: "github-actions" # See documentation for possible values + directory: "/" # Location of package manifests + schedule: + interval: "weekly" diff --git a/src/sonic-framework/gnoi/.github/protolint.yaml b/src/sonic-framework/gnoi/.github/protolint.yaml new file mode 100644 index 000000000000..a4aba2e48227 --- /dev/null +++ b/src/sonic-framework/gnoi/.github/protolint.yaml @@ -0,0 +1,6 @@ +lint: + rules: + remove: + - ENUM_FIELD_NAMES_PREFIX + - ENUM_FIELD_NAMES_ZERO_VALUE_END_WITH + - REPEATED_FIELD_NAMES_PLURALIZED diff --git a/src/sonic-framework/gnoi/.github/workflows/ci-cpp-build-gnoi.yml b/src/sonic-framework/gnoi/.github/workflows/ci-cpp-build-gnoi.yml new file mode 100644 index 000000000000..e293c6498660 --- /dev/null +++ b/src/sonic-framework/gnoi/.github/workflows/ci-cpp-build-gnoi.yml @@ -0,0 +1,38 @@ +name: "bazel build" + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + schedule: + - cron: "0 0 * * *" + +jobs: + build: + runs-on: ubuntu-latest + env: + BAZEL: bazelisk-linux-amd64 + steps: + - uses: actions/checkout@v4 + with: + submodules: recursive + + - name: Mount bazel cache + uses: actions/cache@v4 + with: + # See https://docs.bazel.build/versions/master/output_directories.html + path: "~/.cache/bazel" + # Create a new cache entry whenever Bazel files change. + # See https://docs.github.com/en/actions/guides/caching-dependencies-to-speed-up-workflows + key: bazel-${{ runner.os }}-build-${{ hashFiles('**/*.bzl', '**/*.bazel') }} + restore-keys: | + bazel-${{ runner.os }}-build- + - name: Install bazelisk + run: | + curl -LO "https://github.com/bazelbuild/bazelisk/releases/download/v1.8.1/$BAZEL" + chmod +x $BAZEL + sudo mv $BAZEL /usr/local/bin/bazel + + - name: Build + run: bazel build //... diff --git a/src/sonic-framework/gnoi/.github/workflows/go.yml b/src/sonic-framework/gnoi/.github/workflows/go.yml new file mode 100644 index 000000000000..66814b3c6ebf --- /dev/null +++ b/src/sonic-framework/gnoi/.github/workflows/go.yml @@ -0,0 +1,12 @@ +name: Go + +on: + push: + branches: [ main ] + pull_request: + schedule: + - cron: "0 0 * * *" + +jobs: + go: + uses: openconfig/common-ci/.github/workflows/basic_go.yml@66c8f8f6a58d5f9c9e84efe89f542b08cb6a0a33 diff --git a/src/sonic-framework/gnoi/.github/workflows/linter.yml b/src/sonic-framework/gnoi/.github/workflows/linter.yml new file mode 100644 index 000000000000..2320d4051128 --- /dev/null +++ b/src/sonic-framework/gnoi/.github/workflows/linter.yml @@ -0,0 +1,24 @@ +name: Lint Code Base + +on: + push: + branches-ignore: [main] + # Remove the line above to run when pushing to master + pull_request: + branches: [main] + +jobs: + build: + name: Lint Code Base + runs-on: ubuntu-latest + + steps: + - name: Checkout Code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Lint protobuf + uses: plexsystems/protolint-action@v0.7.0 + with: + configDirectory: .github diff --git a/src/sonic-framework/gnoi/.gitignore b/src/sonic-framework/gnoi/.gitignore new file mode 100644 index 000000000000..ac51a054d2da --- /dev/null +++ b/src/sonic-framework/gnoi/.gitignore @@ -0,0 +1 @@ +bazel-* diff --git a/src/sonic-framework/gnoi/BUILD.bazel b/src/sonic-framework/gnoi/BUILD.bazel new file mode 100644 index 000000000000..805bd137468b --- /dev/null +++ b/src/sonic-framework/gnoi/BUILD.bazel @@ -0,0 +1,28 @@ +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Supporting infrastructure for implementing and testing PINS. +load("@bazel_gazelle//:def.bzl", "gazelle") + +package( + default_visibility = ["//visibility:public"], + licenses = ["notice"], +) + +exports_files(["LICENSE"]) + +# gazelle:prefix github.com/openconfig/gnoi +gazelle(name = "gazelle") + +# gazelle:exclude **.pb.go diff --git a/src/sonic-framework/gnoi/CONTRIBUTING.md b/src/sonic-framework/gnoi/CONTRIBUTING.md new file mode 100644 index 000000000000..4bb0d8374d6d --- /dev/null +++ b/src/sonic-framework/gnoi/CONTRIBUTING.md @@ -0,0 +1,26 @@ +``` +# How to contribute + +In order to contribute to this project, please follow the +guidelines below. + +## Contributor License Agreement + +Contributions to this project must be accompanied by a Contributor License +Agreement. You (or your employer) retain the copyright to your contribution, +this simply gives us permission to use and redistribute your contributions as +part of the project. Head over to to see +your current agreements on file or to sign a new one. + +You generally only need to submit a CLA once, so if you've already submitted one +(even if it was for a different project), you probably don't need to do it +again. + +## Code reviews + +All submissions, including submissions by project members, require review. We +use GitHub pull requests for this purpose. Consult +[GitHub Help](https://help.github.com/articles/about-pull-requests/) for more +information on using pull requests. + +``` \ No newline at end of file diff --git a/src/sonic-framework/gnoi/CONTRIBUTORS b/src/sonic-framework/gnoi/CONTRIBUTORS new file mode 100644 index 000000000000..d27bcca7ae95 --- /dev/null +++ b/src/sonic-framework/gnoi/CONTRIBUTORS @@ -0,0 +1 @@ +Google, Inc. diff --git a/src/sonic-framework/gnoi/LICENSE b/src/sonic-framework/gnoi/LICENSE new file mode 100644 index 000000000000..8dada3edaf50 --- /dev/null +++ b/src/sonic-framework/gnoi/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright {yyyy} {name of copyright owner} + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/src/sonic-framework/gnoi/MODULE.bazel b/src/sonic-framework/gnoi/MODULE.bazel new file mode 100644 index 000000000000..00bb18361f7f --- /dev/null +++ b/src/sonic-framework/gnoi/MODULE.bazel @@ -0,0 +1,6 @@ +############################################################################### +# Bazel now uses Bzlmod by default to manage external dependencies. +# Please consider migrating your external dependencies from WORKSPACE to MODULE.bazel. +# +# For more details, please check https://github.com/bazelbuild/bazel/issues/18958 +############################################################################### diff --git a/src/sonic-framework/gnoi/MODULE.bazel.lock b/src/sonic-framework/gnoi/MODULE.bazel.lock new file mode 100644 index 000000000000..524a898c5a7e --- /dev/null +++ b/src/sonic-framework/gnoi/MODULE.bazel.lock @@ -0,0 +1,1273 @@ +{ + "lockFileVersion": 3, + "moduleFileHash": "0e3e315145ac7ee7a4e0ac825e1c5e03c068ec1254dd42c3caaecb27e921dc4d", + "flags": { + "cmdRegistries": [ + "https://bcr.bazel.build/" + ], + "cmdModuleOverrides": {}, + "allowedYankedVersions": [], + "envVarAllowedYankedVersions": "", + "ignoreDevDependency": false, + "directDependenciesMode": "WARNING", + "compatibilityMode": "ERROR" + }, + "localOverrideHashes": { + "bazel_tools": "922ea6752dc9105de5af957f7a99a6933c0a6a712d23df6aad16a9c399f7e787" + }, + "moduleDepGraph": { + "": { + "name": "", + "version": "", + "key": "", + "repoName": "", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + } + }, + "bazel_tools@_": { + "name": "bazel_tools", + "version": "", + "key": "bazel_tools@_", + "repoName": "bazel_tools", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [ + "@local_config_cc_toolchains//:all", + "@local_config_sh//:local_sh_toolchain" + ], + "extensionUsages": [ + { + "extensionBzlFile": "@bazel_tools//tools/cpp:cc_configure.bzl", + "extensionName": "cc_configure_extension", + "usingModule": "bazel_tools@_", + "location": { + "file": "@@bazel_tools//:MODULE.bazel", + "line": 17, + "column": 29 + }, + "imports": { + "local_config_cc": "local_config_cc", + "local_config_cc_toolchains": "local_config_cc_toolchains" + }, + "devImports": [], + "tags": [], + "hasDevUseExtension": false, + "hasNonDevUseExtension": true + }, + { + "extensionBzlFile": "@bazel_tools//tools/osx:xcode_configure.bzl", + "extensionName": "xcode_configure_extension", + "usingModule": "bazel_tools@_", + "location": { + "file": "@@bazel_tools//:MODULE.bazel", + "line": 21, + "column": 32 + }, + "imports": { + "local_config_xcode": "local_config_xcode" + }, + "devImports": [], + "tags": [], + "hasDevUseExtension": false, + "hasNonDevUseExtension": true + }, + { + "extensionBzlFile": "@rules_java//java:extensions.bzl", + "extensionName": "toolchains", + "usingModule": "bazel_tools@_", + "location": { + "file": "@@bazel_tools//:MODULE.bazel", + "line": 24, + "column": 32 + }, + "imports": { + "local_jdk": "local_jdk", + "remote_java_tools": "remote_java_tools", + "remote_java_tools_linux": "remote_java_tools_linux", + "remote_java_tools_windows": "remote_java_tools_windows", + "remote_java_tools_darwin_x86_64": "remote_java_tools_darwin_x86_64", + "remote_java_tools_darwin_arm64": "remote_java_tools_darwin_arm64" + }, + "devImports": [], + "tags": [], + "hasDevUseExtension": false, + "hasNonDevUseExtension": true + }, + { + "extensionBzlFile": "@bazel_tools//tools/sh:sh_configure.bzl", + "extensionName": "sh_configure_extension", + "usingModule": "bazel_tools@_", + "location": { + "file": "@@bazel_tools//:MODULE.bazel", + "line": 35, + "column": 39 + }, + "imports": { + "local_config_sh": "local_config_sh" + }, + "devImports": [], + "tags": [], + "hasDevUseExtension": false, + "hasNonDevUseExtension": true + }, + { + "extensionBzlFile": "@bazel_tools//tools/test:extensions.bzl", + "extensionName": "remote_coverage_tools_extension", + "usingModule": "bazel_tools@_", + "location": { + "file": "@@bazel_tools//:MODULE.bazel", + "line": 39, + "column": 48 + }, + "imports": { + "remote_coverage_tools": "remote_coverage_tools" + }, + "devImports": [], + "tags": [], + "hasDevUseExtension": false, + "hasNonDevUseExtension": true + }, + { + "extensionBzlFile": "@bazel_tools//tools/android:android_extensions.bzl", + "extensionName": "remote_android_tools_extensions", + "usingModule": "bazel_tools@_", + "location": { + "file": "@@bazel_tools//:MODULE.bazel", + "line": 42, + "column": 42 + }, + "imports": { + "android_gmaven_r8": "android_gmaven_r8", + "android_tools": "android_tools" + }, + "devImports": [], + "tags": [], + "hasDevUseExtension": false, + "hasNonDevUseExtension": true + } + ], + "deps": { + "rules_cc": "rules_cc@0.0.9", + "rules_java": "rules_java@7.1.0", + "rules_license": "rules_license@0.0.7", + "rules_proto": "rules_proto@4.0.0", + "rules_python": "rules_python@0.4.0", + "platforms": "platforms@0.0.7", + "com_google_protobuf": "protobuf@3.19.6", + "zlib": "zlib@1.3", + "build_bazel_apple_support": "apple_support@1.5.0", + "local_config_platform": "local_config_platform@_" + } + }, + "local_config_platform@_": { + "name": "local_config_platform", + "version": "", + "key": "local_config_platform@_", + "repoName": "local_config_platform", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "platforms": "platforms@0.0.7", + "bazel_tools": "bazel_tools@_" + } + }, + "rules_cc@0.0.9": { + "name": "rules_cc", + "version": "0.0.9", + "key": "rules_cc@0.0.9", + "repoName": "rules_cc", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [ + "@local_config_cc_toolchains//:all" + ], + "extensionUsages": [ + { + "extensionBzlFile": "@bazel_tools//tools/cpp:cc_configure.bzl", + "extensionName": "cc_configure_extension", + "usingModule": "rules_cc@0.0.9", + "location": { + "file": "https://bcr.bazel.build/modules/rules_cc/0.0.9/MODULE.bazel", + "line": 9, + "column": 29 + }, + "imports": { + "local_config_cc_toolchains": "local_config_cc_toolchains" + }, + "devImports": [], + "tags": [], + "hasDevUseExtension": false, + "hasNonDevUseExtension": true + } + ], + "deps": { + "platforms": "platforms@0.0.7", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "name": "rules_cc~0.0.9", + "urls": [ + "https://github.com/bazelbuild/rules_cc/releases/download/0.0.9/rules_cc-0.0.9.tar.gz" + ], + "integrity": "sha256-IDeHW5pEVtzkp50RKorohbvEqtlo5lh9ym5k86CQDN8=", + "strip_prefix": "rules_cc-0.0.9", + "remote_patches": { + "https://bcr.bazel.build/modules/rules_cc/0.0.9/patches/module_dot_bazel_version.patch": "sha256-mM+qzOI0SgAdaJBlWOSMwMPKpaA9b7R37Hj/tp5bb4g=" + }, + "remote_patch_strip": 0 + } + } + }, + "rules_java@7.1.0": { + "name": "rules_java", + "version": "7.1.0", + "key": "rules_java@7.1.0", + "repoName": "rules_java", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [ + "//toolchains:all", + "@local_jdk//:runtime_toolchain_definition", + "@local_jdk//:bootstrap_runtime_toolchain_definition", + "@remotejdk11_linux_toolchain_config_repo//:all", + "@remotejdk11_linux_aarch64_toolchain_config_repo//:all", + "@remotejdk11_linux_ppc64le_toolchain_config_repo//:all", + "@remotejdk11_linux_s390x_toolchain_config_repo//:all", + "@remotejdk11_macos_toolchain_config_repo//:all", + "@remotejdk11_macos_aarch64_toolchain_config_repo//:all", + "@remotejdk11_win_toolchain_config_repo//:all", + "@remotejdk11_win_arm64_toolchain_config_repo//:all", + "@remotejdk17_linux_toolchain_config_repo//:all", + "@remotejdk17_linux_aarch64_toolchain_config_repo//:all", + "@remotejdk17_linux_ppc64le_toolchain_config_repo//:all", + "@remotejdk17_linux_s390x_toolchain_config_repo//:all", + "@remotejdk17_macos_toolchain_config_repo//:all", + "@remotejdk17_macos_aarch64_toolchain_config_repo//:all", + "@remotejdk17_win_toolchain_config_repo//:all", + "@remotejdk17_win_arm64_toolchain_config_repo//:all", + "@remotejdk21_linux_toolchain_config_repo//:all", + "@remotejdk21_linux_aarch64_toolchain_config_repo//:all", + "@remotejdk21_macos_toolchain_config_repo//:all", + "@remotejdk21_macos_aarch64_toolchain_config_repo//:all", + "@remotejdk21_win_toolchain_config_repo//:all" + ], + "extensionUsages": [ + { + "extensionBzlFile": "@rules_java//java:extensions.bzl", + "extensionName": "toolchains", + "usingModule": "rules_java@7.1.0", + "location": { + "file": "https://bcr.bazel.build/modules/rules_java/7.1.0/MODULE.bazel", + "line": 19, + "column": 27 + }, + "imports": { + "remote_java_tools": "remote_java_tools", + "remote_java_tools_linux": "remote_java_tools_linux", + "remote_java_tools_windows": "remote_java_tools_windows", + "remote_java_tools_darwin_x86_64": "remote_java_tools_darwin_x86_64", + "remote_java_tools_darwin_arm64": "remote_java_tools_darwin_arm64", + "local_jdk": "local_jdk", + "remotejdk11_linux_toolchain_config_repo": "remotejdk11_linux_toolchain_config_repo", + "remotejdk11_linux_aarch64_toolchain_config_repo": "remotejdk11_linux_aarch64_toolchain_config_repo", + "remotejdk11_linux_ppc64le_toolchain_config_repo": "remotejdk11_linux_ppc64le_toolchain_config_repo", + "remotejdk11_linux_s390x_toolchain_config_repo": "remotejdk11_linux_s390x_toolchain_config_repo", + "remotejdk11_macos_toolchain_config_repo": "remotejdk11_macos_toolchain_config_repo", + "remotejdk11_macos_aarch64_toolchain_config_repo": "remotejdk11_macos_aarch64_toolchain_config_repo", + "remotejdk11_win_toolchain_config_repo": "remotejdk11_win_toolchain_config_repo", + "remotejdk11_win_arm64_toolchain_config_repo": "remotejdk11_win_arm64_toolchain_config_repo", + "remotejdk17_linux_toolchain_config_repo": "remotejdk17_linux_toolchain_config_repo", + "remotejdk17_linux_aarch64_toolchain_config_repo": "remotejdk17_linux_aarch64_toolchain_config_repo", + "remotejdk17_linux_ppc64le_toolchain_config_repo": "remotejdk17_linux_ppc64le_toolchain_config_repo", + "remotejdk17_linux_s390x_toolchain_config_repo": "remotejdk17_linux_s390x_toolchain_config_repo", + "remotejdk17_macos_toolchain_config_repo": "remotejdk17_macos_toolchain_config_repo", + "remotejdk17_macos_aarch64_toolchain_config_repo": "remotejdk17_macos_aarch64_toolchain_config_repo", + "remotejdk17_win_toolchain_config_repo": "remotejdk17_win_toolchain_config_repo", + "remotejdk17_win_arm64_toolchain_config_repo": "remotejdk17_win_arm64_toolchain_config_repo", + "remotejdk21_linux_toolchain_config_repo": "remotejdk21_linux_toolchain_config_repo", + "remotejdk21_linux_aarch64_toolchain_config_repo": "remotejdk21_linux_aarch64_toolchain_config_repo", + "remotejdk21_macos_toolchain_config_repo": "remotejdk21_macos_toolchain_config_repo", + "remotejdk21_macos_aarch64_toolchain_config_repo": "remotejdk21_macos_aarch64_toolchain_config_repo", + "remotejdk21_win_toolchain_config_repo": "remotejdk21_win_toolchain_config_repo" + }, + "devImports": [], + "tags": [], + "hasDevUseExtension": false, + "hasNonDevUseExtension": true + } + ], + "deps": { + "platforms": "platforms@0.0.7", + "rules_cc": "rules_cc@0.0.9", + "bazel_skylib": "bazel_skylib@1.3.0", + "rules_proto": "rules_proto@4.0.0", + "rules_license": "rules_license@0.0.7", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "name": "rules_java~7.1.0", + "urls": [ + "https://github.com/bazelbuild/rules_java/releases/download/7.1.0/rules_java-7.1.0.tar.gz" + ], + "integrity": "sha256-o3pOX2OrgnFuXdau75iO2EYcegC46TYnImKJn1h81OE=", + "strip_prefix": "", + "remote_patches": {}, + "remote_patch_strip": 0 + } + } + }, + "rules_license@0.0.7": { + "name": "rules_license", + "version": "0.0.7", + "key": "rules_license@0.0.7", + "repoName": "rules_license", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "name": "rules_license~0.0.7", + "urls": [ + "https://github.com/bazelbuild/rules_license/releases/download/0.0.7/rules_license-0.0.7.tar.gz" + ], + "integrity": "sha256-RTHezLkTY5ww5cdRKgVNXYdWmNrrddjPkPKEN1/nw2A=", + "strip_prefix": "", + "remote_patches": {}, + "remote_patch_strip": 0 + } + } + }, + "rules_proto@4.0.0": { + "name": "rules_proto", + "version": "4.0.0", + "key": "rules_proto@4.0.0", + "repoName": "rules_proto", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "bazel_skylib": "bazel_skylib@1.3.0", + "rules_cc": "rules_cc@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "name": "rules_proto~4.0.0", + "urls": [ + "https://github.com/bazelbuild/rules_proto/archive/refs/tags/4.0.0.zip" + ], + "integrity": "sha256-Lr5z6xyuRA19pNtRYMGjKaynwQpck4H/lwYyVjyhoq4=", + "strip_prefix": "rules_proto-4.0.0", + "remote_patches": { + "https://bcr.bazel.build/modules/rules_proto/4.0.0/patches/module_dot_bazel.patch": "sha256-MclJO7tIAM2ElDAmscNId9pKTpOuDGHgVlW/9VBOIp0=" + }, + "remote_patch_strip": 0 + } + } + }, + "rules_python@0.4.0": { + "name": "rules_python", + "version": "0.4.0", + "key": "rules_python@0.4.0", + "repoName": "rules_python", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [ + "@bazel_tools//tools/python:autodetecting_toolchain" + ], + "extensionUsages": [ + { + "extensionBzlFile": "@rules_python//bzlmod:extensions.bzl", + "extensionName": "pip_install", + "usingModule": "rules_python@0.4.0", + "location": { + "file": "https://bcr.bazel.build/modules/rules_python/0.4.0/MODULE.bazel", + "line": 7, + "column": 28 + }, + "imports": { + "pypi__click": "pypi__click", + "pypi__pip": "pypi__pip", + "pypi__pip_tools": "pypi__pip_tools", + "pypi__pkginfo": "pypi__pkginfo", + "pypi__setuptools": "pypi__setuptools", + "pypi__wheel": "pypi__wheel" + }, + "devImports": [], + "tags": [], + "hasDevUseExtension": false, + "hasNonDevUseExtension": true + } + ], + "deps": { + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "name": "rules_python~0.4.0", + "urls": [ + "https://github.com/bazelbuild/rules_python/releases/download/0.4.0/rules_python-0.4.0.tar.gz" + ], + "integrity": "sha256-lUqom0kb5KCDMEosuDgBnIuMNyCnq7nEy4GseiQjDOo=", + "strip_prefix": "", + "remote_patches": { + "https://bcr.bazel.build/modules/rules_python/0.4.0/patches/propagate_pip_install_dependencies.patch": "sha256-v7S/dem/mixg63MF4KoRGDA4KEol9ab/tIVp+6Xq0D0=", + "https://bcr.bazel.build/modules/rules_python/0.4.0/patches/module_dot_bazel.patch": "sha256-kG4VIfWxQazzTuh50mvsx6pmyoRVA4lfH5rkto/Oq+Y=" + }, + "remote_patch_strip": 1 + } + } + }, + "platforms@0.0.7": { + "name": "platforms", + "version": "0.0.7", + "key": "platforms@0.0.7", + "repoName": "platforms", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "rules_license": "rules_license@0.0.7", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "name": "platforms", + "urls": [ + "https://github.com/bazelbuild/platforms/releases/download/0.0.7/platforms-0.0.7.tar.gz" + ], + "integrity": "sha256-OlYcmee9vpFzqmU/1Xn+hJ8djWc5V4CrR3Cx84FDHVE=", + "strip_prefix": "", + "remote_patches": {}, + "remote_patch_strip": 0 + } + } + }, + "protobuf@3.19.6": { + "name": "protobuf", + "version": "3.19.6", + "key": "protobuf@3.19.6", + "repoName": "protobuf", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "bazel_skylib": "bazel_skylib@1.3.0", + "zlib": "zlib@1.3", + "rules_python": "rules_python@0.4.0", + "rules_cc": "rules_cc@0.0.9", + "rules_proto": "rules_proto@4.0.0", + "rules_java": "rules_java@7.1.0", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "name": "protobuf~3.19.6", + "urls": [ + "https://github.com/protocolbuffers/protobuf/archive/refs/tags/v3.19.6.zip" + ], + "integrity": "sha256-OH4sVZuyx8G8N5jE5s/wFTgaebJ1hpavy/johzC0c4k=", + "strip_prefix": "protobuf-3.19.6", + "remote_patches": { + "https://bcr.bazel.build/modules/protobuf/3.19.6/patches/relative_repo_names.patch": "sha256-w/5gw/zGv8NFId+669hcdw1Uus2lxgYpulATHIwIByI=", + "https://bcr.bazel.build/modules/protobuf/3.19.6/patches/remove_dependency_on_rules_jvm_external.patch": "sha256-THUTnVgEBmjA0W7fKzIyZOVG58DnW9HQTkr4D2zKUUc=", + "https://bcr.bazel.build/modules/protobuf/3.19.6/patches/add_module_dot_bazel_for_examples.patch": "sha256-s/b1gi3baK3LsXefI2rQilhmkb2R5jVJdnT6zEcdfHY=", + "https://bcr.bazel.build/modules/protobuf/3.19.6/patches/module_dot_bazel.patch": "sha256-S0DEni8zgx7rHscW3z/rCEubQnYec0XhNet640cw0h4=" + }, + "remote_patch_strip": 1 + } + } + }, + "zlib@1.3": { + "name": "zlib", + "version": "1.3", + "key": "zlib@1.3", + "repoName": "zlib", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "platforms": "platforms@0.0.7", + "rules_cc": "rules_cc@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "name": "zlib~1.3", + "urls": [ + "https://github.com/madler/zlib/releases/download/v1.3/zlib-1.3.tar.gz" + ], + "integrity": "sha256-/wukwpIBPbwnUws6geH5qBPNOd4Byl4Pi/NVcC76WT4=", + "strip_prefix": "zlib-1.3", + "remote_patches": { + "https://bcr.bazel.build/modules/zlib/1.3/patches/add_build_file.patch": "sha256-Ei+FYaaOo7A3jTKunMEodTI0Uw5NXQyZEcboMC8JskY=", + "https://bcr.bazel.build/modules/zlib/1.3/patches/module_dot_bazel.patch": "sha256-fPWLM+2xaF/kuy+kZc1YTfW6hNjrkG400Ho7gckuyJk=" + }, + "remote_patch_strip": 0 + } + } + }, + "apple_support@1.5.0": { + "name": "apple_support", + "version": "1.5.0", + "key": "apple_support@1.5.0", + "repoName": "build_bazel_apple_support", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [ + "@local_config_apple_cc_toolchains//:all" + ], + "extensionUsages": [ + { + "extensionBzlFile": "@build_bazel_apple_support//crosstool:setup.bzl", + "extensionName": "apple_cc_configure_extension", + "usingModule": "apple_support@1.5.0", + "location": { + "file": "https://bcr.bazel.build/modules/apple_support/1.5.0/MODULE.bazel", + "line": 17, + "column": 35 + }, + "imports": { + "local_config_apple_cc": "local_config_apple_cc", + "local_config_apple_cc_toolchains": "local_config_apple_cc_toolchains" + }, + "devImports": [], + "tags": [], + "hasDevUseExtension": false, + "hasNonDevUseExtension": true + } + ], + "deps": { + "bazel_skylib": "bazel_skylib@1.3.0", + "platforms": "platforms@0.0.7", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "name": "apple_support~1.5.0", + "urls": [ + "https://github.com/bazelbuild/apple_support/releases/download/1.5.0/apple_support.1.5.0.tar.gz" + ], + "integrity": "sha256-miM41vja0yRPgj8txghKA+TQ+7J8qJLclw5okNW0gYQ=", + "strip_prefix": "", + "remote_patches": {}, + "remote_patch_strip": 0 + } + } + }, + "bazel_skylib@1.3.0": { + "name": "bazel_skylib", + "version": "1.3.0", + "key": "bazel_skylib@1.3.0", + "repoName": "bazel_skylib", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [ + "//toolchains/unittest:cmd_toolchain", + "//toolchains/unittest:bash_toolchain" + ], + "extensionUsages": [], + "deps": { + "platforms": "platforms@0.0.7", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "name": "bazel_skylib~1.3.0", + "urls": [ + "https://github.com/bazelbuild/bazel-skylib/releases/download/1.3.0/bazel-skylib-1.3.0.tar.gz" + ], + "integrity": "sha256-dNVE2W9KW7Yw1GXKi7z+Ix41lOWq5X4e2/F6brPKJQY=", + "strip_prefix": "", + "remote_patches": {}, + "remote_patch_strip": 0 + } + } + } + }, + "moduleExtensions": { + "@@apple_support~1.5.0//crosstool:setup.bzl%apple_cc_configure_extension": { + "general": { + "bzlTransitiveDigest": "pMLFCYaRPkgXPQ8vtuNkMfiHfPmRBy6QJfnid4sWfv0=", + "accumulatedFileDigests": {}, + "envVariables": {}, + "generatedRepoSpecs": { + "local_config_apple_cc": { + "bzlFile": "@@apple_support~1.5.0//crosstool:setup.bzl", + "ruleClassName": "_apple_cc_autoconf", + "attributes": { + "name": "apple_support~1.5.0~apple_cc_configure_extension~local_config_apple_cc" + } + }, + "local_config_apple_cc_toolchains": { + "bzlFile": "@@apple_support~1.5.0//crosstool:setup.bzl", + "ruleClassName": "_apple_cc_autoconf_toolchains", + "attributes": { + "name": "apple_support~1.5.0~apple_cc_configure_extension~local_config_apple_cc_toolchains" + } + } + }, + "recordedRepoMappingEntries": [ + [ + "apple_support~1.5.0", + "bazel_tools", + "bazel_tools" + ] + ] + } + }, + "@@bazel_tools//tools/cpp:cc_configure.bzl%cc_configure_extension": { + "general": { + "bzlTransitiveDigest": "mcsWHq3xORJexV5/4eCvNOLxFOQKV6eli3fkr+tEaqE=", + "accumulatedFileDigests": {}, + "envVariables": {}, + "generatedRepoSpecs": { + "local_config_cc": { + "bzlFile": "@@bazel_tools//tools/cpp:cc_configure.bzl", + "ruleClassName": "cc_autoconf", + "attributes": { + "name": "bazel_tools~cc_configure_extension~local_config_cc" + } + }, + "local_config_cc_toolchains": { + "bzlFile": "@@bazel_tools//tools/cpp:cc_configure.bzl", + "ruleClassName": "cc_autoconf_toolchains", + "attributes": { + "name": "bazel_tools~cc_configure_extension~local_config_cc_toolchains" + } + } + }, + "recordedRepoMappingEntries": [ + [ + "bazel_tools", + "bazel_tools", + "bazel_tools" + ] + ] + } + }, + "@@bazel_tools//tools/osx:xcode_configure.bzl%xcode_configure_extension": { + "general": { + "bzlTransitiveDigest": "Qh2bWTU6QW6wkrd87qrU4YeY+SG37Nvw3A0PR4Y0L2Y=", + "accumulatedFileDigests": {}, + "envVariables": {}, + "generatedRepoSpecs": { + "local_config_xcode": { + "bzlFile": "@@bazel_tools//tools/osx:xcode_configure.bzl", + "ruleClassName": "xcode_autoconf", + "attributes": { + "name": "bazel_tools~xcode_configure_extension~local_config_xcode", + "xcode_locator": "@bazel_tools//tools/osx:xcode_locator.m", + "remote_xcode": "" + } + } + }, + "recordedRepoMappingEntries": [] + } + }, + "@@bazel_tools//tools/sh:sh_configure.bzl%sh_configure_extension": { + "general": { + "bzlTransitiveDigest": "hp4NgmNjEg5+xgvzfh6L83bt9/aiiWETuNpwNuF1MSU=", + "accumulatedFileDigests": {}, + "envVariables": {}, + "generatedRepoSpecs": { + "local_config_sh": { + "bzlFile": "@@bazel_tools//tools/sh:sh_configure.bzl", + "ruleClassName": "sh_config", + "attributes": { + "name": "bazel_tools~sh_configure_extension~local_config_sh" + } + } + }, + "recordedRepoMappingEntries": [] + } + }, + "@@rules_java~7.1.0//java:extensions.bzl%toolchains": { + "general": { + "bzlTransitiveDigest": "D02GmifxnV/IhYgspsJMDZ/aE8HxAjXgek5gi6FSto4=", + "accumulatedFileDigests": {}, + "envVariables": {}, + "generatedRepoSpecs": { + "remotejdk21_linux_toolchain_config_repo": { + "bzlFile": "@@rules_java~7.1.0//toolchains:remote_java_repository.bzl", + "ruleClassName": "_toolchain_config", + "attributes": { + "name": "rules_java~7.1.0~toolchains~remotejdk21_linux_toolchain_config_repo", + "build_file": "\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"remotejdk_21\"},\n visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n name = \"version_setting\",\n values = {\"java_runtime_version\": \"21\"},\n visibility = [\"//visibility:private\"],\n)\nalias(\n name = \"version_or_prefix_version_setting\",\n actual = select({\n \":version_setting\": \":version_setting\",\n \"//conditions:default\": \":prefix_version_setting\",\n }),\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [\"@platforms//os:linux\", \"@platforms//cpu:x86_64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@remotejdk21_linux//:jdk\",\n)\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [\"@platforms//os:linux\", \"@platforms//cpu:x86_64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@remotejdk21_linux//:jdk\",\n)\n" + } + }, + "remotejdk17_linux_s390x_toolchain_config_repo": { + "bzlFile": "@@rules_java~7.1.0//toolchains:remote_java_repository.bzl", + "ruleClassName": "_toolchain_config", + "attributes": { + "name": "rules_java~7.1.0~toolchains~remotejdk17_linux_s390x_toolchain_config_repo", + "build_file": "\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"remotejdk_17\"},\n visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n name = \"version_setting\",\n values = {\"java_runtime_version\": \"17\"},\n visibility = [\"//visibility:private\"],\n)\nalias(\n name = \"version_or_prefix_version_setting\",\n actual = select({\n \":version_setting\": \":version_setting\",\n \"//conditions:default\": \":prefix_version_setting\",\n }),\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [\"@platforms//os:linux\", \"@platforms//cpu:s390x\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@remotejdk17_linux_s390x//:jdk\",\n)\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [\"@platforms//os:linux\", \"@platforms//cpu:s390x\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@remotejdk17_linux_s390x//:jdk\",\n)\n" + } + }, + "remotejdk17_macos_toolchain_config_repo": { + "bzlFile": "@@rules_java~7.1.0//toolchains:remote_java_repository.bzl", + "ruleClassName": "_toolchain_config", + "attributes": { + "name": "rules_java~7.1.0~toolchains~remotejdk17_macos_toolchain_config_repo", + "build_file": "\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"remotejdk_17\"},\n visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n name = \"version_setting\",\n values = {\"java_runtime_version\": \"17\"},\n visibility = [\"//visibility:private\"],\n)\nalias(\n name = \"version_or_prefix_version_setting\",\n actual = select({\n \":version_setting\": \":version_setting\",\n \"//conditions:default\": \":prefix_version_setting\",\n }),\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [\"@platforms//os:macos\", \"@platforms//cpu:x86_64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@remotejdk17_macos//:jdk\",\n)\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [\"@platforms//os:macos\", \"@platforms//cpu:x86_64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@remotejdk17_macos//:jdk\",\n)\n" + } + }, + "remotejdk21_macos_aarch64_toolchain_config_repo": { + "bzlFile": "@@rules_java~7.1.0//toolchains:remote_java_repository.bzl", + "ruleClassName": "_toolchain_config", + "attributes": { + "name": "rules_java~7.1.0~toolchains~remotejdk21_macos_aarch64_toolchain_config_repo", + "build_file": "\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"remotejdk_21\"},\n visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n name = \"version_setting\",\n values = {\"java_runtime_version\": \"21\"},\n visibility = [\"//visibility:private\"],\n)\nalias(\n name = \"version_or_prefix_version_setting\",\n actual = select({\n \":version_setting\": \":version_setting\",\n \"//conditions:default\": \":prefix_version_setting\",\n }),\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [\"@platforms//os:macos\", \"@platforms//cpu:aarch64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@remotejdk21_macos_aarch64//:jdk\",\n)\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [\"@platforms//os:macos\", \"@platforms//cpu:aarch64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@remotejdk21_macos_aarch64//:jdk\",\n)\n" + } + }, + "remotejdk17_linux_aarch64_toolchain_config_repo": { + "bzlFile": "@@rules_java~7.1.0//toolchains:remote_java_repository.bzl", + "ruleClassName": "_toolchain_config", + "attributes": { + "name": "rules_java~7.1.0~toolchains~remotejdk17_linux_aarch64_toolchain_config_repo", + "build_file": "\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"remotejdk_17\"},\n visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n name = \"version_setting\",\n values = {\"java_runtime_version\": \"17\"},\n visibility = [\"//visibility:private\"],\n)\nalias(\n name = \"version_or_prefix_version_setting\",\n actual = select({\n \":version_setting\": \":version_setting\",\n \"//conditions:default\": \":prefix_version_setting\",\n }),\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [\"@platforms//os:linux\", \"@platforms//cpu:aarch64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@remotejdk17_linux_aarch64//:jdk\",\n)\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [\"@platforms//os:linux\", \"@platforms//cpu:aarch64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@remotejdk17_linux_aarch64//:jdk\",\n)\n" + } + }, + "remotejdk21_macos_aarch64": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "name": "rules_java~7.1.0~toolchains~remotejdk21_macos_aarch64", + "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = 21,\n)\n", + "sha256": "2a7a99a3ea263dbd8d32a67d1e6e363ba8b25c645c826f5e167a02bbafaff1fa", + "strip_prefix": "zulu21.28.85-ca-jdk21.0.0-macosx_aarch64", + "urls": [ + "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu21.28.85-ca-jdk21.0.0-macosx_aarch64.tar.gz", + "https://cdn.azul.com/zulu/bin/zulu21.28.85-ca-jdk21.0.0-macosx_aarch64.tar.gz" + ] + } + }, + "remotejdk17_linux_toolchain_config_repo": { + "bzlFile": "@@rules_java~7.1.0//toolchains:remote_java_repository.bzl", + "ruleClassName": "_toolchain_config", + "attributes": { + "name": "rules_java~7.1.0~toolchains~remotejdk17_linux_toolchain_config_repo", + "build_file": "\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"remotejdk_17\"},\n visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n name = \"version_setting\",\n values = {\"java_runtime_version\": \"17\"},\n visibility = [\"//visibility:private\"],\n)\nalias(\n name = \"version_or_prefix_version_setting\",\n actual = select({\n \":version_setting\": \":version_setting\",\n \"//conditions:default\": \":prefix_version_setting\",\n }),\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [\"@platforms//os:linux\", \"@platforms//cpu:x86_64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@remotejdk17_linux//:jdk\",\n)\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [\"@platforms//os:linux\", \"@platforms//cpu:x86_64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@remotejdk17_linux//:jdk\",\n)\n" + } + }, + "remotejdk17_macos_aarch64": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "name": "rules_java~7.1.0~toolchains~remotejdk17_macos_aarch64", + "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = 17,\n)\n", + "sha256": "314b04568ec0ae9b36ba03c9cbd42adc9e1265f74678923b19297d66eb84dcca", + "strip_prefix": "zulu17.44.53-ca-jdk17.0.8.1-macosx_aarch64", + "urls": [ + "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu17.44.53-ca-jdk17.0.8.1-macosx_aarch64.tar.gz", + "https://cdn.azul.com/zulu/bin/zulu17.44.53-ca-jdk17.0.8.1-macosx_aarch64.tar.gz" + ] + } + }, + "remote_java_tools_windows": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "name": "rules_java~7.1.0~toolchains~remote_java_tools_windows", + "sha256": "c5c70c214a350f12cbf52da8270fa43ba629b795f3dd328028a38f8f0d39c2a1", + "urls": [ + "https://mirror.bazel.build/bazel_java_tools/releases/java/v13.1/java_tools_windows-v13.1.zip", + "https://github.com/bazelbuild/java_tools/releases/download/java_v13.1/java_tools_windows-v13.1.zip" + ] + } + }, + "remotejdk11_win": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "name": "rules_java~7.1.0~toolchains~remotejdk11_win", + "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = 11,\n)\n", + "sha256": "43408193ce2fa0862819495b5ae8541085b95660153f2adcf91a52d3a1710e83", + "strip_prefix": "zulu11.66.15-ca-jdk11.0.20-win_x64", + "urls": [ + "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu11.66.15-ca-jdk11.0.20-win_x64.zip", + "https://cdn.azul.com/zulu/bin/zulu11.66.15-ca-jdk11.0.20-win_x64.zip" + ] + } + }, + "remotejdk11_win_toolchain_config_repo": { + "bzlFile": "@@rules_java~7.1.0//toolchains:remote_java_repository.bzl", + "ruleClassName": "_toolchain_config", + "attributes": { + "name": "rules_java~7.1.0~toolchains~remotejdk11_win_toolchain_config_repo", + "build_file": "\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"remotejdk_11\"},\n visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n name = \"version_setting\",\n values = {\"java_runtime_version\": \"11\"},\n visibility = [\"//visibility:private\"],\n)\nalias(\n name = \"version_or_prefix_version_setting\",\n actual = select({\n \":version_setting\": \":version_setting\",\n \"//conditions:default\": \":prefix_version_setting\",\n }),\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [\"@platforms//os:windows\", \"@platforms//cpu:x86_64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@remotejdk11_win//:jdk\",\n)\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [\"@platforms//os:windows\", \"@platforms//cpu:x86_64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@remotejdk11_win//:jdk\",\n)\n" + } + }, + "remotejdk11_linux_aarch64": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "name": "rules_java~7.1.0~toolchains~remotejdk11_linux_aarch64", + "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = 11,\n)\n", + "sha256": "54174439f2b3fddd11f1048c397fe7bb45d4c9d66d452d6889b013d04d21c4de", + "strip_prefix": "zulu11.66.15-ca-jdk11.0.20-linux_aarch64", + "urls": [ + "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu11.66.15-ca-jdk11.0.20-linux_aarch64.tar.gz", + "https://cdn.azul.com/zulu/bin/zulu11.66.15-ca-jdk11.0.20-linux_aarch64.tar.gz" + ] + } + }, + "remotejdk17_linux": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "name": "rules_java~7.1.0~toolchains~remotejdk17_linux", + "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = 17,\n)\n", + "sha256": "b9482f2304a1a68a614dfacddcf29569a72f0fac32e6c74f83dc1b9a157b8340", + "strip_prefix": "zulu17.44.53-ca-jdk17.0.8.1-linux_x64", + "urls": [ + "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu17.44.53-ca-jdk17.0.8.1-linux_x64.tar.gz", + "https://cdn.azul.com/zulu/bin/zulu17.44.53-ca-jdk17.0.8.1-linux_x64.tar.gz" + ] + } + }, + "remotejdk11_linux_s390x_toolchain_config_repo": { + "bzlFile": "@@rules_java~7.1.0//toolchains:remote_java_repository.bzl", + "ruleClassName": "_toolchain_config", + "attributes": { + "name": "rules_java~7.1.0~toolchains~remotejdk11_linux_s390x_toolchain_config_repo", + "build_file": "\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"remotejdk_11\"},\n visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n name = \"version_setting\",\n values = {\"java_runtime_version\": \"11\"},\n visibility = [\"//visibility:private\"],\n)\nalias(\n name = \"version_or_prefix_version_setting\",\n actual = select({\n \":version_setting\": \":version_setting\",\n \"//conditions:default\": \":prefix_version_setting\",\n }),\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [\"@platforms//os:linux\", \"@platforms//cpu:s390x\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@remotejdk11_linux_s390x//:jdk\",\n)\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [\"@platforms//os:linux\", \"@platforms//cpu:s390x\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@remotejdk11_linux_s390x//:jdk\",\n)\n" + } + }, + "remotejdk11_linux_toolchain_config_repo": { + "bzlFile": "@@rules_java~7.1.0//toolchains:remote_java_repository.bzl", + "ruleClassName": "_toolchain_config", + "attributes": { + "name": "rules_java~7.1.0~toolchains~remotejdk11_linux_toolchain_config_repo", + "build_file": "\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"remotejdk_11\"},\n visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n name = \"version_setting\",\n values = {\"java_runtime_version\": \"11\"},\n visibility = [\"//visibility:private\"],\n)\nalias(\n name = \"version_or_prefix_version_setting\",\n actual = select({\n \":version_setting\": \":version_setting\",\n \"//conditions:default\": \":prefix_version_setting\",\n }),\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [\"@platforms//os:linux\", \"@platforms//cpu:x86_64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@remotejdk11_linux//:jdk\",\n)\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [\"@platforms//os:linux\", \"@platforms//cpu:x86_64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@remotejdk11_linux//:jdk\",\n)\n" + } + }, + "remotejdk11_macos": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "name": "rules_java~7.1.0~toolchains~remotejdk11_macos", + "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = 11,\n)\n", + "sha256": "bcaab11cfe586fae7583c6d9d311c64384354fb2638eb9a012eca4c3f1a1d9fd", + "strip_prefix": "zulu11.66.15-ca-jdk11.0.20-macosx_x64", + "urls": [ + "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu11.66.15-ca-jdk11.0.20-macosx_x64.tar.gz", + "https://cdn.azul.com/zulu/bin/zulu11.66.15-ca-jdk11.0.20-macosx_x64.tar.gz" + ] + } + }, + "remotejdk11_win_arm64": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "name": "rules_java~7.1.0~toolchains~remotejdk11_win_arm64", + "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = 11,\n)\n", + "sha256": "b8a28e6e767d90acf793ea6f5bed0bb595ba0ba5ebdf8b99f395266161e53ec2", + "strip_prefix": "jdk-11.0.13+8", + "urls": [ + "https://mirror.bazel.build/aka.ms/download-jdk/microsoft-jdk-11.0.13.8.1-windows-aarch64.zip" + ] + } + }, + "remotejdk17_macos": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "name": "rules_java~7.1.0~toolchains~remotejdk17_macos", + "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = 17,\n)\n", + "sha256": "640453e8afe8ffe0fb4dceb4535fb50db9c283c64665eebb0ba68b19e65f4b1f", + "strip_prefix": "zulu17.44.53-ca-jdk17.0.8.1-macosx_x64", + "urls": [ + "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu17.44.53-ca-jdk17.0.8.1-macosx_x64.tar.gz", + "https://cdn.azul.com/zulu/bin/zulu17.44.53-ca-jdk17.0.8.1-macosx_x64.tar.gz" + ] + } + }, + "remotejdk21_macos": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "name": "rules_java~7.1.0~toolchains~remotejdk21_macos", + "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = 21,\n)\n", + "sha256": "9639b87db586d0c89f7a9892ae47f421e442c64b97baebdff31788fbe23265bd", + "strip_prefix": "zulu21.28.85-ca-jdk21.0.0-macosx_x64", + "urls": [ + "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu21.28.85-ca-jdk21.0.0-macosx_x64.tar.gz", + "https://cdn.azul.com/zulu/bin/zulu21.28.85-ca-jdk21.0.0-macosx_x64.tar.gz" + ] + } + }, + "remotejdk21_macos_toolchain_config_repo": { + "bzlFile": "@@rules_java~7.1.0//toolchains:remote_java_repository.bzl", + "ruleClassName": "_toolchain_config", + "attributes": { + "name": "rules_java~7.1.0~toolchains~remotejdk21_macos_toolchain_config_repo", + "build_file": "\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"remotejdk_21\"},\n visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n name = \"version_setting\",\n values = {\"java_runtime_version\": \"21\"},\n visibility = [\"//visibility:private\"],\n)\nalias(\n name = \"version_or_prefix_version_setting\",\n actual = select({\n \":version_setting\": \":version_setting\",\n \"//conditions:default\": \":prefix_version_setting\",\n }),\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [\"@platforms//os:macos\", \"@platforms//cpu:x86_64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@remotejdk21_macos//:jdk\",\n)\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [\"@platforms//os:macos\", \"@platforms//cpu:x86_64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@remotejdk21_macos//:jdk\",\n)\n" + } + }, + "remotejdk17_macos_aarch64_toolchain_config_repo": { + "bzlFile": "@@rules_java~7.1.0//toolchains:remote_java_repository.bzl", + "ruleClassName": "_toolchain_config", + "attributes": { + "name": "rules_java~7.1.0~toolchains~remotejdk17_macos_aarch64_toolchain_config_repo", + "build_file": "\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"remotejdk_17\"},\n visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n name = \"version_setting\",\n values = {\"java_runtime_version\": \"17\"},\n visibility = [\"//visibility:private\"],\n)\nalias(\n name = \"version_or_prefix_version_setting\",\n actual = select({\n \":version_setting\": \":version_setting\",\n \"//conditions:default\": \":prefix_version_setting\",\n }),\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [\"@platforms//os:macos\", \"@platforms//cpu:aarch64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@remotejdk17_macos_aarch64//:jdk\",\n)\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [\"@platforms//os:macos\", \"@platforms//cpu:aarch64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@remotejdk17_macos_aarch64//:jdk\",\n)\n" + } + }, + "remotejdk17_win": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "name": "rules_java~7.1.0~toolchains~remotejdk17_win", + "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = 17,\n)\n", + "sha256": "192f2afca57701de6ec496234f7e45d971bf623ff66b8ee4a5c81582054e5637", + "strip_prefix": "zulu17.44.53-ca-jdk17.0.8.1-win_x64", + "urls": [ + "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu17.44.53-ca-jdk17.0.8.1-win_x64.zip", + "https://cdn.azul.com/zulu/bin/zulu17.44.53-ca-jdk17.0.8.1-win_x64.zip" + ] + } + }, + "remotejdk11_macos_aarch64_toolchain_config_repo": { + "bzlFile": "@@rules_java~7.1.0//toolchains:remote_java_repository.bzl", + "ruleClassName": "_toolchain_config", + "attributes": { + "name": "rules_java~7.1.0~toolchains~remotejdk11_macos_aarch64_toolchain_config_repo", + "build_file": "\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"remotejdk_11\"},\n visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n name = \"version_setting\",\n values = {\"java_runtime_version\": \"11\"},\n visibility = [\"//visibility:private\"],\n)\nalias(\n name = \"version_or_prefix_version_setting\",\n actual = select({\n \":version_setting\": \":version_setting\",\n \"//conditions:default\": \":prefix_version_setting\",\n }),\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [\"@platforms//os:macos\", \"@platforms//cpu:aarch64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@remotejdk11_macos_aarch64//:jdk\",\n)\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [\"@platforms//os:macos\", \"@platforms//cpu:aarch64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@remotejdk11_macos_aarch64//:jdk\",\n)\n" + } + }, + "remotejdk11_linux_ppc64le_toolchain_config_repo": { + "bzlFile": "@@rules_java~7.1.0//toolchains:remote_java_repository.bzl", + "ruleClassName": "_toolchain_config", + "attributes": { + "name": "rules_java~7.1.0~toolchains~remotejdk11_linux_ppc64le_toolchain_config_repo", + "build_file": "\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"remotejdk_11\"},\n visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n name = \"version_setting\",\n values = {\"java_runtime_version\": \"11\"},\n visibility = [\"//visibility:private\"],\n)\nalias(\n name = \"version_or_prefix_version_setting\",\n actual = select({\n \":version_setting\": \":version_setting\",\n \"//conditions:default\": \":prefix_version_setting\",\n }),\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [\"@platforms//os:linux\", \"@platforms//cpu:ppc\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@remotejdk11_linux_ppc64le//:jdk\",\n)\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [\"@platforms//os:linux\", \"@platforms//cpu:ppc\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@remotejdk11_linux_ppc64le//:jdk\",\n)\n" + } + }, + "remotejdk21_linux": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "name": "rules_java~7.1.0~toolchains~remotejdk21_linux", + "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = 21,\n)\n", + "sha256": "0c0eadfbdc47a7ca64aeab51b9c061f71b6e4d25d2d87674512e9b6387e9e3a6", + "strip_prefix": "zulu21.28.85-ca-jdk21.0.0-linux_x64", + "urls": [ + "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu21.28.85-ca-jdk21.0.0-linux_x64.tar.gz", + "https://cdn.azul.com/zulu/bin/zulu21.28.85-ca-jdk21.0.0-linux_x64.tar.gz" + ] + } + }, + "remote_java_tools_linux": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "name": "rules_java~7.1.0~toolchains~remote_java_tools_linux", + "sha256": "d134da9b04c9023fb6e56a5d4bffccee73f7bc9572ddc4e747778dacccd7a5a7", + "urls": [ + "https://mirror.bazel.build/bazel_java_tools/releases/java/v13.1/java_tools_linux-v13.1.zip", + "https://github.com/bazelbuild/java_tools/releases/download/java_v13.1/java_tools_linux-v13.1.zip" + ] + } + }, + "remotejdk21_win": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "name": "rules_java~7.1.0~toolchains~remotejdk21_win", + "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = 21,\n)\n", + "sha256": "e9959d500a0d9a7694ac243baf657761479da132f0f94720cbffd092150bd802", + "strip_prefix": "zulu21.28.85-ca-jdk21.0.0-win_x64", + "urls": [ + "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu21.28.85-ca-jdk21.0.0-win_x64.zip", + "https://cdn.azul.com/zulu/bin/zulu21.28.85-ca-jdk21.0.0-win_x64.zip" + ] + } + }, + "remotejdk21_linux_aarch64": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "name": "rules_java~7.1.0~toolchains~remotejdk21_linux_aarch64", + "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = 21,\n)\n", + "sha256": "1fb64b8036c5d463d8ab59af06bf5b6b006811e6012e3b0eb6bccf57f1c55835", + "strip_prefix": "zulu21.28.85-ca-jdk21.0.0-linux_aarch64", + "urls": [ + "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu21.28.85-ca-jdk21.0.0-linux_aarch64.tar.gz", + "https://cdn.azul.com/zulu/bin/zulu21.28.85-ca-jdk21.0.0-linux_aarch64.tar.gz" + ] + } + }, + "remotejdk11_linux_aarch64_toolchain_config_repo": { + "bzlFile": "@@rules_java~7.1.0//toolchains:remote_java_repository.bzl", + "ruleClassName": "_toolchain_config", + "attributes": { + "name": "rules_java~7.1.0~toolchains~remotejdk11_linux_aarch64_toolchain_config_repo", + "build_file": "\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"remotejdk_11\"},\n visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n name = \"version_setting\",\n values = {\"java_runtime_version\": \"11\"},\n visibility = [\"//visibility:private\"],\n)\nalias(\n name = \"version_or_prefix_version_setting\",\n actual = select({\n \":version_setting\": \":version_setting\",\n \"//conditions:default\": \":prefix_version_setting\",\n }),\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [\"@platforms//os:linux\", \"@platforms//cpu:aarch64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@remotejdk11_linux_aarch64//:jdk\",\n)\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [\"@platforms//os:linux\", \"@platforms//cpu:aarch64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@remotejdk11_linux_aarch64//:jdk\",\n)\n" + } + }, + "remotejdk11_linux_s390x": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "name": "rules_java~7.1.0~toolchains~remotejdk11_linux_s390x", + "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = 11,\n)\n", + "sha256": "a58fc0361966af0a5d5a31a2d8a208e3c9bb0f54f345596fd80b99ea9a39788b", + "strip_prefix": "jdk-11.0.15+10", + "urls": [ + "https://mirror.bazel.build/github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.15+10/OpenJDK11U-jdk_s390x_linux_hotspot_11.0.15_10.tar.gz", + "https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.15+10/OpenJDK11U-jdk_s390x_linux_hotspot_11.0.15_10.tar.gz" + ] + } + }, + "remotejdk17_linux_aarch64": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "name": "rules_java~7.1.0~toolchains~remotejdk17_linux_aarch64", + "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = 17,\n)\n", + "sha256": "6531cef61e416d5a7b691555c8cf2bdff689201b8a001ff45ab6740062b44313", + "strip_prefix": "zulu17.44.53-ca-jdk17.0.8.1-linux_aarch64", + "urls": [ + "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu17.44.53-ca-jdk17.0.8.1-linux_aarch64.tar.gz", + "https://cdn.azul.com/zulu/bin/zulu17.44.53-ca-jdk17.0.8.1-linux_aarch64.tar.gz" + ] + } + }, + "remotejdk17_win_arm64_toolchain_config_repo": { + "bzlFile": "@@rules_java~7.1.0//toolchains:remote_java_repository.bzl", + "ruleClassName": "_toolchain_config", + "attributes": { + "name": "rules_java~7.1.0~toolchains~remotejdk17_win_arm64_toolchain_config_repo", + "build_file": "\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"remotejdk_17\"},\n visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n name = \"version_setting\",\n values = {\"java_runtime_version\": \"17\"},\n visibility = [\"//visibility:private\"],\n)\nalias(\n name = \"version_or_prefix_version_setting\",\n actual = select({\n \":version_setting\": \":version_setting\",\n \"//conditions:default\": \":prefix_version_setting\",\n }),\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [\"@platforms//os:windows\", \"@platforms//cpu:arm64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@remotejdk17_win_arm64//:jdk\",\n)\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [\"@platforms//os:windows\", \"@platforms//cpu:arm64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@remotejdk17_win_arm64//:jdk\",\n)\n" + } + }, + "remotejdk11_linux": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "name": "rules_java~7.1.0~toolchains~remotejdk11_linux", + "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = 11,\n)\n", + "sha256": "a34b404f87a08a61148b38e1416d837189e1df7a040d949e743633daf4695a3c", + "strip_prefix": "zulu11.66.15-ca-jdk11.0.20-linux_x64", + "urls": [ + "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu11.66.15-ca-jdk11.0.20-linux_x64.tar.gz", + "https://cdn.azul.com/zulu/bin/zulu11.66.15-ca-jdk11.0.20-linux_x64.tar.gz" + ] + } + }, + "remotejdk11_macos_toolchain_config_repo": { + "bzlFile": "@@rules_java~7.1.0//toolchains:remote_java_repository.bzl", + "ruleClassName": "_toolchain_config", + "attributes": { + "name": "rules_java~7.1.0~toolchains~remotejdk11_macos_toolchain_config_repo", + "build_file": "\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"remotejdk_11\"},\n visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n name = \"version_setting\",\n values = {\"java_runtime_version\": \"11\"},\n visibility = [\"//visibility:private\"],\n)\nalias(\n name = \"version_or_prefix_version_setting\",\n actual = select({\n \":version_setting\": \":version_setting\",\n \"//conditions:default\": \":prefix_version_setting\",\n }),\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [\"@platforms//os:macos\", \"@platforms//cpu:x86_64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@remotejdk11_macos//:jdk\",\n)\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [\"@platforms//os:macos\", \"@platforms//cpu:x86_64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@remotejdk11_macos//:jdk\",\n)\n" + } + }, + "remotejdk17_linux_ppc64le_toolchain_config_repo": { + "bzlFile": "@@rules_java~7.1.0//toolchains:remote_java_repository.bzl", + "ruleClassName": "_toolchain_config", + "attributes": { + "name": "rules_java~7.1.0~toolchains~remotejdk17_linux_ppc64le_toolchain_config_repo", + "build_file": "\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"remotejdk_17\"},\n visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n name = \"version_setting\",\n values = {\"java_runtime_version\": \"17\"},\n visibility = [\"//visibility:private\"],\n)\nalias(\n name = \"version_or_prefix_version_setting\",\n actual = select({\n \":version_setting\": \":version_setting\",\n \"//conditions:default\": \":prefix_version_setting\",\n }),\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [\"@platforms//os:linux\", \"@platforms//cpu:ppc\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@remotejdk17_linux_ppc64le//:jdk\",\n)\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [\"@platforms//os:linux\", \"@platforms//cpu:ppc\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@remotejdk17_linux_ppc64le//:jdk\",\n)\n" + } + }, + "remotejdk17_win_arm64": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "name": "rules_java~7.1.0~toolchains~remotejdk17_win_arm64", + "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = 17,\n)\n", + "sha256": "6802c99eae0d788e21f52d03cab2e2b3bf42bc334ca03cbf19f71eb70ee19f85", + "strip_prefix": "zulu17.44.53-ca-jdk17.0.8.1-win_aarch64", + "urls": [ + "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu17.44.53-ca-jdk17.0.8.1-win_aarch64.zip", + "https://cdn.azul.com/zulu/bin/zulu17.44.53-ca-jdk17.0.8.1-win_aarch64.zip" + ] + } + }, + "remote_java_tools_darwin_arm64": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "name": "rules_java~7.1.0~toolchains~remote_java_tools_darwin_arm64", + "sha256": "dab5bb87ec43e980faea6e1cec14bafb217b8e2f5346f53aa784fd715929a930", + "urls": [ + "https://mirror.bazel.build/bazel_java_tools/releases/java/v13.1/java_tools_darwin_arm64-v13.1.zip", + "https://github.com/bazelbuild/java_tools/releases/download/java_v13.1/java_tools_darwin_arm64-v13.1.zip" + ] + } + }, + "remotejdk17_linux_ppc64le": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "name": "rules_java~7.1.0~toolchains~remotejdk17_linux_ppc64le", + "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = 17,\n)\n", + "sha256": "00a4c07603d0218cd678461b5b3b7e25b3253102da4022d31fc35907f21a2efd", + "strip_prefix": "jdk-17.0.8.1+1", + "urls": [ + "https://mirror.bazel.build/github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.8.1%2B1/OpenJDK17U-jdk_ppc64le_linux_hotspot_17.0.8.1_1.tar.gz", + "https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.8.1%2B1/OpenJDK17U-jdk_ppc64le_linux_hotspot_17.0.8.1_1.tar.gz" + ] + } + }, + "remotejdk21_linux_aarch64_toolchain_config_repo": { + "bzlFile": "@@rules_java~7.1.0//toolchains:remote_java_repository.bzl", + "ruleClassName": "_toolchain_config", + "attributes": { + "name": "rules_java~7.1.0~toolchains~remotejdk21_linux_aarch64_toolchain_config_repo", + "build_file": "\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"remotejdk_21\"},\n visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n name = \"version_setting\",\n values = {\"java_runtime_version\": \"21\"},\n visibility = [\"//visibility:private\"],\n)\nalias(\n name = \"version_or_prefix_version_setting\",\n actual = select({\n \":version_setting\": \":version_setting\",\n \"//conditions:default\": \":prefix_version_setting\",\n }),\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [\"@platforms//os:linux\", \"@platforms//cpu:aarch64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@remotejdk21_linux_aarch64//:jdk\",\n)\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [\"@platforms//os:linux\", \"@platforms//cpu:aarch64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@remotejdk21_linux_aarch64//:jdk\",\n)\n" + } + }, + "remotejdk11_win_arm64_toolchain_config_repo": { + "bzlFile": "@@rules_java~7.1.0//toolchains:remote_java_repository.bzl", + "ruleClassName": "_toolchain_config", + "attributes": { + "name": "rules_java~7.1.0~toolchains~remotejdk11_win_arm64_toolchain_config_repo", + "build_file": "\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"remotejdk_11\"},\n visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n name = \"version_setting\",\n values = {\"java_runtime_version\": \"11\"},\n visibility = [\"//visibility:private\"],\n)\nalias(\n name = \"version_or_prefix_version_setting\",\n actual = select({\n \":version_setting\": \":version_setting\",\n \"//conditions:default\": \":prefix_version_setting\",\n }),\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [\"@platforms//os:windows\", \"@platforms//cpu:arm64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@remotejdk11_win_arm64//:jdk\",\n)\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [\"@platforms//os:windows\", \"@platforms//cpu:arm64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@remotejdk11_win_arm64//:jdk\",\n)\n" + } + }, + "local_jdk": { + "bzlFile": "@@rules_java~7.1.0//toolchains:local_java_repository.bzl", + "ruleClassName": "_local_java_repository_rule", + "attributes": { + "name": "rules_java~7.1.0~toolchains~local_jdk", + "java_home": "", + "version": "", + "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = {RUNTIME_VERSION},\n)\n" + } + }, + "remote_java_tools_darwin_x86_64": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "name": "rules_java~7.1.0~toolchains~remote_java_tools_darwin_x86_64", + "sha256": "0db40d8505a2b65ef0ed46e4256757807db8162f7acff16225be57c1d5726dbc", + "urls": [ + "https://mirror.bazel.build/bazel_java_tools/releases/java/v13.1/java_tools_darwin_x86_64-v13.1.zip", + "https://github.com/bazelbuild/java_tools/releases/download/java_v13.1/java_tools_darwin_x86_64-v13.1.zip" + ] + } + }, + "remote_java_tools": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "name": "rules_java~7.1.0~toolchains~remote_java_tools", + "sha256": "286bdbbd66e616fc4ed3f90101418729a73baa7e8c23a98ffbef558f74c0ad14", + "urls": [ + "https://mirror.bazel.build/bazel_java_tools/releases/java/v13.1/java_tools-v13.1.zip", + "https://github.com/bazelbuild/java_tools/releases/download/java_v13.1/java_tools-v13.1.zip" + ] + } + }, + "remotejdk17_linux_s390x": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "name": "rules_java~7.1.0~toolchains~remotejdk17_linux_s390x", + "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = 17,\n)\n", + "sha256": "ffacba69c6843d7ca70d572489d6cc7ab7ae52c60f0852cedf4cf0d248b6fc37", + "strip_prefix": "jdk-17.0.8.1+1", + "urls": [ + "https://mirror.bazel.build/github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.8.1%2B1/OpenJDK17U-jdk_s390x_linux_hotspot_17.0.8.1_1.tar.gz", + "https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.8.1%2B1/OpenJDK17U-jdk_s390x_linux_hotspot_17.0.8.1_1.tar.gz" + ] + } + }, + "remotejdk17_win_toolchain_config_repo": { + "bzlFile": "@@rules_java~7.1.0//toolchains:remote_java_repository.bzl", + "ruleClassName": "_toolchain_config", + "attributes": { + "name": "rules_java~7.1.0~toolchains~remotejdk17_win_toolchain_config_repo", + "build_file": "\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"remotejdk_17\"},\n visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n name = \"version_setting\",\n values = {\"java_runtime_version\": \"17\"},\n visibility = [\"//visibility:private\"],\n)\nalias(\n name = \"version_or_prefix_version_setting\",\n actual = select({\n \":version_setting\": \":version_setting\",\n \"//conditions:default\": \":prefix_version_setting\",\n }),\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [\"@platforms//os:windows\", \"@platforms//cpu:x86_64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@remotejdk17_win//:jdk\",\n)\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [\"@platforms//os:windows\", \"@platforms//cpu:x86_64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@remotejdk17_win//:jdk\",\n)\n" + } + }, + "remotejdk11_linux_ppc64le": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "name": "rules_java~7.1.0~toolchains~remotejdk11_linux_ppc64le", + "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = 11,\n)\n", + "sha256": "a8fba686f6eb8ae1d1a9566821dbd5a85a1108b96ad857fdbac5c1e4649fc56f", + "strip_prefix": "jdk-11.0.15+10", + "urls": [ + "https://mirror.bazel.build/github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.15+10/OpenJDK11U-jdk_ppc64le_linux_hotspot_11.0.15_10.tar.gz", + "https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.15+10/OpenJDK11U-jdk_ppc64le_linux_hotspot_11.0.15_10.tar.gz" + ] + } + }, + "remotejdk11_macos_aarch64": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "name": "rules_java~7.1.0~toolchains~remotejdk11_macos_aarch64", + "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = 11,\n)\n", + "sha256": "7632bc29f8a4b7d492b93f3bc75a7b61630894db85d136456035ab2a24d38885", + "strip_prefix": "zulu11.66.15-ca-jdk11.0.20-macosx_aarch64", + "urls": [ + "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu11.66.15-ca-jdk11.0.20-macosx_aarch64.tar.gz", + "https://cdn.azul.com/zulu/bin/zulu11.66.15-ca-jdk11.0.20-macosx_aarch64.tar.gz" + ] + } + }, + "remotejdk21_win_toolchain_config_repo": { + "bzlFile": "@@rules_java~7.1.0//toolchains:remote_java_repository.bzl", + "ruleClassName": "_toolchain_config", + "attributes": { + "name": "rules_java~7.1.0~toolchains~remotejdk21_win_toolchain_config_repo", + "build_file": "\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"remotejdk_21\"},\n visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n name = \"version_setting\",\n values = {\"java_runtime_version\": \"21\"},\n visibility = [\"//visibility:private\"],\n)\nalias(\n name = \"version_or_prefix_version_setting\",\n actual = select({\n \":version_setting\": \":version_setting\",\n \"//conditions:default\": \":prefix_version_setting\",\n }),\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [\"@platforms//os:windows\", \"@platforms//cpu:x86_64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@remotejdk21_win//:jdk\",\n)\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [\"@platforms//os:windows\", \"@platforms//cpu:x86_64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@remotejdk21_win//:jdk\",\n)\n" + } + } + }, + "recordedRepoMappingEntries": [ + [ + "rules_java~7.1.0", + "bazel_tools", + "bazel_tools" + ], + [ + "rules_java~7.1.0", + "remote_java_tools", + "rules_java~7.1.0~toolchains~remote_java_tools" + ] + ] + } + } + } +} diff --git a/src/sonic-framework/gnoi/README.md b/src/sonic-framework/gnoi/README.md new file mode 100644 index 000000000000..8bed1f5d0912 --- /dev/null +++ b/src/sonic-framework/gnoi/README.md @@ -0,0 +1,7 @@ +# gNOI - gRPC Network Operations Interface +gNOI defines a set of gRPC-based microservices for executing operational commands on network devices. + +# Rebuild *.pb.go files +``` +./regenerate-files.sh +```` diff --git a/src/sonic-framework/gnoi/WORKSPACE b/src/sonic-framework/gnoi/WORKSPACE new file mode 100644 index 000000000000..6bb13a4c9235 --- /dev/null +++ b/src/sonic-framework/gnoi/WORKSPACE @@ -0,0 +1,101 @@ +workspace(name = "com_github_openconfig_gnoi") + +load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") + +### Bazel rules for many languages to compile PROTO into gRPC libraries +http_archive( + name = "rules_proto_grpc", + sha256 = "c0d718f4d892c524025504e67a5bfe83360b3a982e654bc71fed7514eb8ac8ad", + strip_prefix = "rules_proto_grpc-4.6.0", + urls = ["https://github.com/rules-proto-grpc/rules_proto_grpc/archive/4.6.0.tar.gz"], +) + +http_archive( + name = "com_google_googleapis", + sha256 = "9fc03150d86501d7da35eefa989d5553bdd77a95cfe4373cdafe8eee92f6bfb1", + strip_prefix = "googleapis-870a5ed7e141b4faf70e2a0858854e9b5bb18612", + urls = ["https://github.com/googleapis/googleapis/archive/870a5ed7e141b4faf70e2a0858854e9b5bb18612.tar.gz"], +) + +load("@com_google_googleapis//:repository_rules.bzl", "switched_rules_by_language") + +switched_rules_by_language( + name = "com_google_googleapis_imports", + cc = True, + go = True, +) + +load( + "@rules_proto_grpc//:repositories.bzl", + "bazel_gazelle", + "io_bazel_rules_go", + "rules_proto_grpc_repos", + "rules_proto_grpc_toolchains", +) + +rules_proto_grpc_toolchains() + +rules_proto_grpc_repos() + +load("@rules_proto//proto:repositories.bzl", "rules_proto_dependencies", "rules_proto_toolchains") + +rules_proto_dependencies() + +rules_proto_toolchains() + +### Golang +io_bazel_rules_go() + +load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies") + +go_rules_dependencies() + +go_register_toolchains(go_version = "1.20") + +# gazelle:repo bazel_gazelle +bazel_gazelle() + +load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies") +load("//:gnoi_deps.bzl", "gnoi_deps") + +# gazelle:repository_macro gnoi_deps.bzl%gnoi_deps +gnoi_deps() + +load("@rules_proto_grpc//go:repositories.bzl", rules_proto_grpc_go_repos = "go_repos") + +rules_proto_grpc_go_repos() + +# Load gazelle_dependencies last, so that the newer version of org_golang_google_grpc is used. +# see https://github.com/rules-proto-grpc/rules_proto_grpc/issues/160 +gazelle_dependencies() + +### C++ +load("@rules_proto_grpc//cpp:repositories.bzl", rules_proto_grpc_cpp_repos = "cpp_repos") + +rules_proto_grpc_cpp_repos() + +load("@com_github_grpc_grpc//bazel:grpc_deps.bzl", "grpc_deps") + +grpc_deps() + +# open-config YANG files +http_archive( + name = "github_openconfig_yang", + build_file_content = """exports_files(glob(["release/models/**/*.yang"]), visibility = ["//visibility:public"])""", + sha256 = "f6b2b6c0ffe0b66881287bcd43241a57583f353cc5cc41cba973601c32232f45", + strip_prefix = "public-bf737a5567ec248456cb528efcd63cab15e8fc69", + urls = [ + "https://github.com/openconfig/public/archive/bf737a5567ec248456cb528efcd63cab15e8fc69.zip", + ], +) + +# YANG files from other standard bodies. +http_archive( + name = "github_yang", + build_file_content = """exports_files(glob(["standard/**/*.yang"]), visibility = ["//visibility:public"])""", + sha256 = "55913058f64a1ec7fe9e6e70d7128f08e66b20c859803b1fb02dbaf7eef2c64d", + strip_prefix = "yang-2fa291d6bdb4b281d4e1b3dfa3254ffa7257d800", + urls = [ + "https://github.com/YangModels/yang/archive/2fa291d6bdb4b281d4e1b3dfa3254ffa7257d800.zip", + ], +) diff --git a/src/sonic-framework/gnoi/bgp/BUILD.bazel b/src/sonic-framework/gnoi/bgp/BUILD.bazel new file mode 100644 index 000000000000..4d746acbec33 --- /dev/null +++ b/src/sonic-framework/gnoi/bgp/BUILD.bazel @@ -0,0 +1,63 @@ +load("@rules_proto//proto:defs.bzl", "proto_library") +load("@io_bazel_rules_go//go:def.bzl", "go_library") +load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library") +load("@com_github_grpc_grpc//bazel:cc_grpc_library.bzl", "cc_grpc_library") +load("//:common.bzl", "use_new_compilers") + +#Copyright 2021 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +package( + default_visibility = ["//visibility:public"], + licenses = ["notice"], +) + +use_new_compilers() + +proto_library( + name = "bgp_proto", + srcs = ["bgp.proto"], + deps = [ + "//types:types_proto", + ], +) + +cc_proto_library( + name = "bgp_cc_proto", + deps = [":bgp_proto"], +) + +cc_grpc_library( + name = "bgp_cc_grpc_proto", + srcs = [":bgp_proto"], + grpc_only = True, + deps = [":bgp_cc_proto"], +) + +go_proto_library( + name = "bgp_go_proto", + compilers = [ + "go_protoc_gen_go", + "go_protoc_gen_go_grpc", + ], + importpath = "github.com/openconfig/gnoi/bgp", + proto = ":bgp_proto", + deps = ["//types"], +) + +go_library( + name = "bgp", + embed = [":bgp_go_proto"], + importpath = "github.com/openconfig/gnoi/bgp", +) diff --git a/src/sonic-framework/gnoi/bgp/bgp.pb.go b/src/sonic-framework/gnoi/bgp/bgp.pb.go new file mode 100644 index 000000000000..11f6683b94e5 --- /dev/null +++ b/src/sonic-framework/gnoi/bgp/bgp.pb.go @@ -0,0 +1,287 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.30.0 +// protoc v3.21.10 +// source: bgp/bgp.proto + +package bgp + +import ( + _ "github.com/openconfig/gnoi/types" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type ClearBGPNeighborRequest_Mode int32 + +const ( + ClearBGPNeighborRequest_SOFT ClearBGPNeighborRequest_Mode = 0 + ClearBGPNeighborRequest_SOFTIN ClearBGPNeighborRequest_Mode = 1 + ClearBGPNeighborRequest_HARD ClearBGPNeighborRequest_Mode = 2 +) + +// Enum value maps for ClearBGPNeighborRequest_Mode. +var ( + ClearBGPNeighborRequest_Mode_name = map[int32]string{ + 0: "SOFT", + 1: "SOFTIN", + 2: "HARD", + } + ClearBGPNeighborRequest_Mode_value = map[string]int32{ + "SOFT": 0, + "SOFTIN": 1, + "HARD": 2, + } +) + +func (x ClearBGPNeighborRequest_Mode) Enum() *ClearBGPNeighborRequest_Mode { + p := new(ClearBGPNeighborRequest_Mode) + *p = x + return p +} + +func (x ClearBGPNeighborRequest_Mode) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (ClearBGPNeighborRequest_Mode) Descriptor() protoreflect.EnumDescriptor { + return file_bgp_bgp_proto_enumTypes[0].Descriptor() +} + +func (ClearBGPNeighborRequest_Mode) Type() protoreflect.EnumType { + return &file_bgp_bgp_proto_enumTypes[0] +} + +func (x ClearBGPNeighborRequest_Mode) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use ClearBGPNeighborRequest_Mode.Descriptor instead. +func (ClearBGPNeighborRequest_Mode) EnumDescriptor() ([]byte, []int) { + return file_bgp_bgp_proto_rawDescGZIP(), []int{0, 0} +} + +type ClearBGPNeighborRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + RoutingInstance string `protobuf:"bytes,2,opt,name=routing_instance,json=routingInstance,proto3" json:"routing_instance,omitempty"` + Mode ClearBGPNeighborRequest_Mode `protobuf:"varint,3,opt,name=mode,proto3,enum=gnoi.bgp.ClearBGPNeighborRequest_Mode" json:"mode,omitempty"` +} + +func (x *ClearBGPNeighborRequest) Reset() { + *x = ClearBGPNeighborRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_bgp_bgp_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ClearBGPNeighborRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ClearBGPNeighborRequest) ProtoMessage() {} + +func (x *ClearBGPNeighborRequest) ProtoReflect() protoreflect.Message { + mi := &file_bgp_bgp_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ClearBGPNeighborRequest.ProtoReflect.Descriptor instead. +func (*ClearBGPNeighborRequest) Descriptor() ([]byte, []int) { + return file_bgp_bgp_proto_rawDescGZIP(), []int{0} +} + +func (x *ClearBGPNeighborRequest) GetAddress() string { + if x != nil { + return x.Address + } + return "" +} + +func (x *ClearBGPNeighborRequest) GetRoutingInstance() string { + if x != nil { + return x.RoutingInstance + } + return "" +} + +func (x *ClearBGPNeighborRequest) GetMode() ClearBGPNeighborRequest_Mode { + if x != nil { + return x.Mode + } + return ClearBGPNeighborRequest_SOFT +} + +type ClearBGPNeighborResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *ClearBGPNeighborResponse) Reset() { + *x = ClearBGPNeighborResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_bgp_bgp_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ClearBGPNeighborResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ClearBGPNeighborResponse) ProtoMessage() {} + +func (x *ClearBGPNeighborResponse) ProtoReflect() protoreflect.Message { + mi := &file_bgp_bgp_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ClearBGPNeighborResponse.ProtoReflect.Descriptor instead. +func (*ClearBGPNeighborResponse) Descriptor() ([]byte, []int) { + return file_bgp_bgp_proto_rawDescGZIP(), []int{1} +} + +var File_bgp_bgp_proto protoreflect.FileDescriptor + +var file_bgp_bgp_proto_rawDesc = []byte{ + 0x0a, 0x0d, 0x62, 0x67, 0x70, 0x2f, 0x62, 0x67, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, + 0x08, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x62, 0x67, 0x70, 0x1a, 0x2c, 0x67, 0x69, 0x74, 0x68, 0x75, + 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, + 0x2f, 0x67, 0x6e, 0x6f, 0x69, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x74, 0x79, 0x70, 0x65, + 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xc2, 0x01, 0x0a, 0x17, 0x43, 0x6c, 0x65, 0x61, + 0x72, 0x42, 0x47, 0x50, 0x4e, 0x65, 0x69, 0x67, 0x68, 0x62, 0x6f, 0x72, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x29, 0x0a, + 0x10, 0x72, 0x6f, 0x75, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x72, 0x6f, 0x75, 0x74, 0x69, 0x6e, 0x67, + 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x3a, 0x0a, 0x04, 0x6d, 0x6f, 0x64, 0x65, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x26, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x62, 0x67, + 0x70, 0x2e, 0x43, 0x6c, 0x65, 0x61, 0x72, 0x42, 0x47, 0x50, 0x4e, 0x65, 0x69, 0x67, 0x68, 0x62, + 0x6f, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x6f, 0x64, 0x65, 0x52, 0x04, + 0x6d, 0x6f, 0x64, 0x65, 0x22, 0x26, 0x0a, 0x04, 0x4d, 0x6f, 0x64, 0x65, 0x12, 0x08, 0x0a, 0x04, + 0x53, 0x4f, 0x46, 0x54, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x53, 0x4f, 0x46, 0x54, 0x49, 0x4e, + 0x10, 0x01, 0x12, 0x08, 0x0a, 0x04, 0x48, 0x41, 0x52, 0x44, 0x10, 0x02, 0x22, 0x1a, 0x0a, 0x18, + 0x43, 0x6c, 0x65, 0x61, 0x72, 0x42, 0x47, 0x50, 0x4e, 0x65, 0x69, 0x67, 0x68, 0x62, 0x6f, 0x72, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0x62, 0x0a, 0x03, 0x42, 0x47, 0x50, 0x12, + 0x5b, 0x0a, 0x10, 0x43, 0x6c, 0x65, 0x61, 0x72, 0x42, 0x47, 0x50, 0x4e, 0x65, 0x69, 0x67, 0x68, + 0x62, 0x6f, 0x72, 0x12, 0x21, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x62, 0x67, 0x70, 0x2e, 0x43, + 0x6c, 0x65, 0x61, 0x72, 0x42, 0x47, 0x50, 0x4e, 0x65, 0x69, 0x67, 0x68, 0x62, 0x6f, 0x72, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x62, 0x67, + 0x70, 0x2e, 0x43, 0x6c, 0x65, 0x61, 0x72, 0x42, 0x47, 0x50, 0x4e, 0x65, 0x69, 0x67, 0x68, 0x62, + 0x6f, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x28, 0xd2, 0x3e, + 0x05, 0x30, 0x2e, 0x31, 0x2e, 0x30, 0x5a, 0x1e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, + 0x6f, 0x6d, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x67, 0x6e, + 0x6f, 0x69, 0x2f, 0x62, 0x67, 0x70, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_bgp_bgp_proto_rawDescOnce sync.Once + file_bgp_bgp_proto_rawDescData = file_bgp_bgp_proto_rawDesc +) + +func file_bgp_bgp_proto_rawDescGZIP() []byte { + file_bgp_bgp_proto_rawDescOnce.Do(func() { + file_bgp_bgp_proto_rawDescData = protoimpl.X.CompressGZIP(file_bgp_bgp_proto_rawDescData) + }) + return file_bgp_bgp_proto_rawDescData +} + +var file_bgp_bgp_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_bgp_bgp_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_bgp_bgp_proto_goTypes = []interface{}{ + (ClearBGPNeighborRequest_Mode)(0), // 0: gnoi.bgp.ClearBGPNeighborRequest.Mode + (*ClearBGPNeighborRequest)(nil), // 1: gnoi.bgp.ClearBGPNeighborRequest + (*ClearBGPNeighborResponse)(nil), // 2: gnoi.bgp.ClearBGPNeighborResponse +} +var file_bgp_bgp_proto_depIdxs = []int32{ + 0, // 0: gnoi.bgp.ClearBGPNeighborRequest.mode:type_name -> gnoi.bgp.ClearBGPNeighborRequest.Mode + 1, // 1: gnoi.bgp.BGP.ClearBGPNeighbor:input_type -> gnoi.bgp.ClearBGPNeighborRequest + 2, // 2: gnoi.bgp.BGP.ClearBGPNeighbor:output_type -> gnoi.bgp.ClearBGPNeighborResponse + 2, // [2:3] is the sub-list for method output_type + 1, // [1:2] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_bgp_bgp_proto_init() } +func file_bgp_bgp_proto_init() { + if File_bgp_bgp_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_bgp_bgp_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ClearBGPNeighborRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_bgp_bgp_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ClearBGPNeighborResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_bgp_bgp_proto_rawDesc, + NumEnums: 1, + NumMessages: 2, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_bgp_bgp_proto_goTypes, + DependencyIndexes: file_bgp_bgp_proto_depIdxs, + EnumInfos: file_bgp_bgp_proto_enumTypes, + MessageInfos: file_bgp_bgp_proto_msgTypes, + }.Build() + File_bgp_bgp_proto = out.File + file_bgp_bgp_proto_rawDesc = nil + file_bgp_bgp_proto_goTypes = nil + file_bgp_bgp_proto_depIdxs = nil +} diff --git a/src/sonic-framework/gnoi/bgp/bgp.proto b/src/sonic-framework/gnoi/bgp/bgp.proto new file mode 100644 index 000000000000..1a197024a59f --- /dev/null +++ b/src/sonic-framework/gnoi/bgp/bgp.proto @@ -0,0 +1,48 @@ +// +// Copyright 2017 Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package gnoi.bgp; + +import "github.com/openconfig/gnoi/types/types.proto"; + +option go_package = "github.com/openconfig/gnoi/bgp"; + +// The current semantic version of the gNOI BGP service. +option (types.gnoi_version) = "0.1.0"; + +service BGP { + // ClearBGPNeighbor clears a BGP session. + rpc ClearBGPNeighbor(ClearBGPNeighborRequest) + returns (ClearBGPNeighborResponse) {} + +} + +message ClearBGPNeighborRequest { + string address = 1; // IPv4 or IPv6 BGP neighbor address to clear. + // Routing instance containing the neighbor. Defaults to the global routing + // table. + string routing_instance = 2; + enum Mode { + SOFT = 0; // Send route-refresh and reapply policy. + SOFTIN = 1; // Re-apply inbound policy on stored Adj-RIB-In. + HARD = 2; // Teardown and restart TCP connection. + } + Mode mode = 3; // Which mode to use for the clear operation. +} + +message ClearBGPNeighborResponse { +} diff --git a/src/sonic-framework/gnoi/bgp/bgp_grpc.pb.go b/src/sonic-framework/gnoi/bgp/bgp_grpc.pb.go new file mode 100755 index 000000000000..f66278c318bb --- /dev/null +++ b/src/sonic-framework/gnoi/bgp/bgp_grpc.pb.go @@ -0,0 +1,105 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.2.0 +// - protoc v3.21.10 +// source: bgp/bgp.proto + +package bgp + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +// BGPClient is the client API for BGP service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type BGPClient interface { + ClearBGPNeighbor(ctx context.Context, in *ClearBGPNeighborRequest, opts ...grpc.CallOption) (*ClearBGPNeighborResponse, error) +} + +type bGPClient struct { + cc grpc.ClientConnInterface +} + +func NewBGPClient(cc grpc.ClientConnInterface) BGPClient { + return &bGPClient{cc} +} + +func (c *bGPClient) ClearBGPNeighbor(ctx context.Context, in *ClearBGPNeighborRequest, opts ...grpc.CallOption) (*ClearBGPNeighborResponse, error) { + out := new(ClearBGPNeighborResponse) + err := c.cc.Invoke(ctx, "/gnoi.bgp.BGP/ClearBGPNeighbor", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// BGPServer is the server API for BGP service. +// All implementations must embed UnimplementedBGPServer +// for forward compatibility +type BGPServer interface { + ClearBGPNeighbor(context.Context, *ClearBGPNeighborRequest) (*ClearBGPNeighborResponse, error) + mustEmbedUnimplementedBGPServer() +} + +// UnimplementedBGPServer must be embedded to have forward compatible implementations. +type UnimplementedBGPServer struct { +} + +func (UnimplementedBGPServer) ClearBGPNeighbor(context.Context, *ClearBGPNeighborRequest) (*ClearBGPNeighborResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ClearBGPNeighbor not implemented") +} +func (UnimplementedBGPServer) mustEmbedUnimplementedBGPServer() {} + +// UnsafeBGPServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to BGPServer will +// result in compilation errors. +type UnsafeBGPServer interface { + mustEmbedUnimplementedBGPServer() +} + +func RegisterBGPServer(s grpc.ServiceRegistrar, srv BGPServer) { + s.RegisterService(&BGP_ServiceDesc, srv) +} + +func _BGP_ClearBGPNeighbor_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ClearBGPNeighborRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(BGPServer).ClearBGPNeighbor(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/gnoi.bgp.BGP/ClearBGPNeighbor", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BGPServer).ClearBGPNeighbor(ctx, req.(*ClearBGPNeighborRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// BGP_ServiceDesc is the grpc.ServiceDesc for BGP service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var BGP_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "gnoi.bgp.BGP", + HandlerType: (*BGPServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "ClearBGPNeighbor", + Handler: _BGP_ClearBGPNeighbor_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "bgp/bgp.proto", +} diff --git a/src/sonic-framework/gnoi/bootconfig/BUILD.bazel b/src/sonic-framework/gnoi/bootconfig/BUILD.bazel new file mode 100644 index 000000000000..76f2105f3db0 --- /dev/null +++ b/src/sonic-framework/gnoi/bootconfig/BUILD.bazel @@ -0,0 +1,74 @@ +load("@rules_proto//proto:defs.bzl", "proto_library") +load("@io_bazel_rules_go//go:def.bzl", "go_library") +load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library") +load("@com_github_grpc_grpc//bazel:cc_grpc_library.bzl", "cc_grpc_library") +load("//:common.bzl", "use_new_compilers") + +#Copyright 2021 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +package( + default_visibility = ["//visibility:public"], + licenses = ["notice"], +) + +use_new_compilers() + +proto_library( + name = "bootconfig_proto", + srcs = ["bootconfig.proto"], + deps = [ + "//types:types_proto", + "@com_github_openconfig_bootz//proto:bootz_proto", + "@com_github_openconfig_gnsi//authz:authz_proto", + "@com_github_openconfig_gnsi//credentialz:credentialz_proto", + "@com_github_openconfig_gnsi//certz:certz_proto", + "@com_github_openconfig_gnsi//pathz:pathz_proto", + ], +) + +cc_proto_library( + name = "bootconfig_cc_proto", + deps = [":bootconfig_proto"], +) + +cc_grpc_library( + name = "bootconfig_cc_grpc_proto", + srcs = [":bootconfig_proto"], + grpc_only = True, + deps = [":bootconfig_cc_proto"], +) + +go_proto_library( + name = "bootconfig_go_proto", + compilers = [ + "go_protoc_gen_go", + "go_protoc_gen_go_grpc", + ], + importpath = "github.com/openconfig/gnoi/bootconfig", + proto = ":bootconfig_proto", + deps = [ + "//types", + "@com_github_openconfig_bootz//proto:bootz_go_proto", + "@com_github_openconfig_gnsi//authz:authz_go_proto", + "@com_github_openconfig_gnsi//certz:certz_go_proto", + "@com_github_openconfig_gnsi//pathz:pathz_go_proto", + ], +) + +go_library( + name = "bootconfig", + embed = [":bootconfig_go_proto"], + importpath = "github.com/openconfig/gnoi/bootconfig", +) diff --git a/src/sonic-framework/gnoi/bootconfig/bootconfig.pb.go b/src/sonic-framework/gnoi/bootconfig/bootconfig.pb.go new file mode 100644 index 000000000000..3706e56eb048 --- /dev/null +++ b/src/sonic-framework/gnoi/bootconfig/bootconfig.pb.go @@ -0,0 +1,426 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.30.0 +// protoc v3.21.10 +// source: bootconfig/bootconfig.proto + +package bootconfig + +import ( + bootz "github.com/openconfig/bootz/proto/bootz" + _ "github.com/openconfig/gnoi/types" + authz "github.com/openconfig/gnsi/authz" + certz "github.com/openconfig/gnsi/certz" + pathz "github.com/openconfig/gnsi/pathz" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type GetBootConfigRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *GetBootConfigRequest) Reset() { + *x = GetBootConfigRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_bootconfig_bootconfig_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetBootConfigRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetBootConfigRequest) ProtoMessage() {} + +func (x *GetBootConfigRequest) ProtoReflect() protoreflect.Message { + mi := &file_bootconfig_bootconfig_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetBootConfigRequest.ProtoReflect.Descriptor instead. +func (*GetBootConfigRequest) Descriptor() ([]byte, []int) { + return file_bootconfig_bootconfig_proto_rawDescGZIP(), []int{0} +} + +type GetBootConfigResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + BootConfig *bootz.BootConfig `protobuf:"bytes,1,opt,name=boot_config,json=bootConfig,proto3" json:"boot_config,omitempty"` +} + +func (x *GetBootConfigResponse) Reset() { + *x = GetBootConfigResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_bootconfig_bootconfig_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetBootConfigResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetBootConfigResponse) ProtoMessage() {} + +func (x *GetBootConfigResponse) ProtoReflect() protoreflect.Message { + mi := &file_bootconfig_bootconfig_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetBootConfigResponse.ProtoReflect.Descriptor instead. +func (*GetBootConfigResponse) Descriptor() ([]byte, []int) { + return file_bootconfig_bootconfig_proto_rawDescGZIP(), []int{1} +} + +func (x *GetBootConfigResponse) GetBootConfig() *bootz.BootConfig { + if x != nil { + return x.BootConfig + } + return nil +} + +type SetBootConfigRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + BootConfig *bootz.BootConfig `protobuf:"bytes,1,opt,name=boot_config,json=bootConfig,proto3" json:"boot_config,omitempty"` + Credentials *bootz.Credentials `protobuf:"bytes,2,opt,name=credentials,proto3" json:"credentials,omitempty"` + Pathz *pathz.UploadRequest `protobuf:"bytes,3,opt,name=pathz,proto3" json:"pathz,omitempty"` + Authz *authz.UploadRequest `protobuf:"bytes,4,opt,name=authz,proto3" json:"authz,omitempty"` + // Deprecated: Marked as deprecated in bootconfig/bootconfig.proto. + Certificates *certz.UploadRequest `protobuf:"bytes,5,opt,name=certificates,proto3" json:"certificates,omitempty"` + Certz *bootz.CertzProfiles `protobuf:"bytes,6,opt,name=certz,proto3" json:"certz,omitempty"` +} + +func (x *SetBootConfigRequest) Reset() { + *x = SetBootConfigRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_bootconfig_bootconfig_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SetBootConfigRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SetBootConfigRequest) ProtoMessage() {} + +func (x *SetBootConfigRequest) ProtoReflect() protoreflect.Message { + mi := &file_bootconfig_bootconfig_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SetBootConfigRequest.ProtoReflect.Descriptor instead. +func (*SetBootConfigRequest) Descriptor() ([]byte, []int) { + return file_bootconfig_bootconfig_proto_rawDescGZIP(), []int{2} +} + +func (x *SetBootConfigRequest) GetBootConfig() *bootz.BootConfig { + if x != nil { + return x.BootConfig + } + return nil +} + +func (x *SetBootConfigRequest) GetCredentials() *bootz.Credentials { + if x != nil { + return x.Credentials + } + return nil +} + +func (x *SetBootConfigRequest) GetPathz() *pathz.UploadRequest { + if x != nil { + return x.Pathz + } + return nil +} + +func (x *SetBootConfigRequest) GetAuthz() *authz.UploadRequest { + if x != nil { + return x.Authz + } + return nil +} + +// Deprecated: Marked as deprecated in bootconfig/bootconfig.proto. +func (x *SetBootConfigRequest) GetCertificates() *certz.UploadRequest { + if x != nil { + return x.Certificates + } + return nil +} + +func (x *SetBootConfigRequest) GetCertz() *bootz.CertzProfiles { + if x != nil { + return x.Certz + } + return nil +} + +type SetBootConfigResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *SetBootConfigResponse) Reset() { + *x = SetBootConfigResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_bootconfig_bootconfig_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SetBootConfigResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SetBootConfigResponse) ProtoMessage() {} + +func (x *SetBootConfigResponse) ProtoReflect() protoreflect.Message { + mi := &file_bootconfig_bootconfig_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SetBootConfigResponse.ProtoReflect.Descriptor instead. +func (*SetBootConfigResponse) Descriptor() ([]byte, []int) { + return file_bootconfig_bootconfig_proto_rawDescGZIP(), []int{3} +} + +var File_bootconfig_bootconfig_proto protoreflect.FileDescriptor + +var file_bootconfig_bootconfig_proto_rawDesc = []byte{ + 0x0a, 0x1b, 0x62, 0x6f, 0x6f, 0x74, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x62, 0x6f, 0x6f, + 0x74, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0f, 0x67, + 0x6e, 0x6f, 0x69, 0x2e, 0x62, 0x6f, 0x6f, 0x74, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x1a, 0x2d, + 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x63, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x62, 0x6f, 0x6f, 0x74, 0x7a, 0x2f, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x2f, 0x62, 0x6f, 0x6f, 0x74, 0x7a, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2c, 0x67, + 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6f, + 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x67, 0x6e, 0x6f, 0x69, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, + 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2c, 0x67, 0x69, 0x74, + 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6f, 0x6e, 0x66, + 0x69, 0x67, 0x2f, 0x67, 0x6e, 0x73, 0x69, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x7a, 0x2f, 0x61, 0x75, + 0x74, 0x68, 0x7a, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2c, 0x67, 0x69, 0x74, 0x68, 0x75, + 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, + 0x2f, 0x67, 0x6e, 0x73, 0x69, 0x2f, 0x63, 0x65, 0x72, 0x74, 0x7a, 0x2f, 0x63, 0x65, 0x72, 0x74, + 0x7a, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2c, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, + 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x67, + 0x6e, 0x73, 0x69, 0x2f, 0x70, 0x61, 0x74, 0x68, 0x7a, 0x2f, 0x70, 0x61, 0x74, 0x68, 0x7a, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x16, 0x0a, 0x14, 0x47, 0x65, 0x74, 0x42, 0x6f, 0x6f, 0x74, + 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x4b, 0x0a, + 0x15, 0x47, 0x65, 0x74, 0x42, 0x6f, 0x6f, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x32, 0x0a, 0x0b, 0x62, 0x6f, 0x6f, 0x74, 0x5f, 0x63, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x62, 0x6f, + 0x6f, 0x74, 0x7a, 0x2e, 0x42, 0x6f, 0x6f, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x0a, + 0x62, 0x6f, 0x6f, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x22, 0xda, 0x02, 0x0a, 0x14, 0x53, + 0x65, 0x74, 0x42, 0x6f, 0x6f, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x32, 0x0a, 0x0b, 0x62, 0x6f, 0x6f, 0x74, 0x5f, 0x63, 0x6f, 0x6e, 0x66, + 0x69, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x62, 0x6f, 0x6f, 0x74, 0x7a, + 0x2e, 0x42, 0x6f, 0x6f, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x0a, 0x62, 0x6f, 0x6f, + 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x34, 0x0a, 0x0b, 0x63, 0x72, 0x65, 0x64, 0x65, + 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x62, + 0x6f, 0x6f, 0x74, 0x7a, 0x2e, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x73, + 0x52, 0x0b, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x73, 0x12, 0x32, 0x0a, + 0x05, 0x70, 0x61, 0x74, 0x68, 0x7a, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, + 0x6e, 0x73, 0x69, 0x2e, 0x70, 0x61, 0x74, 0x68, 0x7a, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x6c, + 0x6f, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x05, 0x70, 0x61, 0x74, 0x68, + 0x7a, 0x12, 0x32, 0x0a, 0x05, 0x61, 0x75, 0x74, 0x68, 0x7a, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1c, 0x2e, 0x67, 0x6e, 0x73, 0x69, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x7a, 0x2e, 0x76, 0x31, + 0x2e, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x05, + 0x61, 0x75, 0x74, 0x68, 0x7a, 0x12, 0x44, 0x0a, 0x0c, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, + 0x63, 0x61, 0x74, 0x65, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6e, + 0x73, 0x69, 0x2e, 0x63, 0x65, 0x72, 0x74, 0x7a, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x6c, 0x6f, + 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x42, 0x02, 0x18, 0x01, 0x52, 0x0c, 0x63, + 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x73, 0x12, 0x2a, 0x0a, 0x05, 0x63, + 0x65, 0x72, 0x74, 0x7a, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x62, 0x6f, 0x6f, + 0x74, 0x7a, 0x2e, 0x43, 0x65, 0x72, 0x74, 0x7a, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x73, + 0x52, 0x05, 0x63, 0x65, 0x72, 0x74, 0x7a, 0x22, 0x17, 0x0a, 0x15, 0x53, 0x65, 0x74, 0x42, 0x6f, + 0x6f, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x32, 0xd0, 0x01, 0x0a, 0x0a, 0x42, 0x6f, 0x6f, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, + 0x60, 0x0a, 0x0d, 0x47, 0x65, 0x74, 0x42, 0x6f, 0x6f, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, + 0x12, 0x25, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x62, 0x6f, 0x6f, 0x74, 0x63, 0x6f, 0x6e, 0x66, + 0x69, 0x67, 0x2e, 0x47, 0x65, 0x74, 0x42, 0x6f, 0x6f, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x62, + 0x6f, 0x6f, 0x74, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x47, 0x65, 0x74, 0x42, 0x6f, 0x6f, + 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x00, 0x12, 0x60, 0x0a, 0x0d, 0x53, 0x65, 0x74, 0x42, 0x6f, 0x6f, 0x74, 0x43, 0x6f, 0x6e, 0x66, + 0x69, 0x67, 0x12, 0x25, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x62, 0x6f, 0x6f, 0x74, 0x63, 0x6f, + 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x53, 0x65, 0x74, 0x42, 0x6f, 0x6f, 0x74, 0x43, 0x6f, 0x6e, 0x66, + 0x69, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x67, 0x6e, 0x6f, 0x69, + 0x2e, 0x62, 0x6f, 0x6f, 0x74, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x53, 0x65, 0x74, 0x42, + 0x6f, 0x6f, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x00, 0x42, 0x2f, 0xd2, 0x3e, 0x05, 0x30, 0x2e, 0x31, 0x2e, 0x30, 0x5a, 0x25, 0x67, + 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6f, + 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x67, 0x6e, 0x6f, 0x69, 0x2f, 0x62, 0x6f, 0x6f, 0x74, 0x63, 0x6f, + 0x6e, 0x66, 0x69, 0x67, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_bootconfig_bootconfig_proto_rawDescOnce sync.Once + file_bootconfig_bootconfig_proto_rawDescData = file_bootconfig_bootconfig_proto_rawDesc +) + +func file_bootconfig_bootconfig_proto_rawDescGZIP() []byte { + file_bootconfig_bootconfig_proto_rawDescOnce.Do(func() { + file_bootconfig_bootconfig_proto_rawDescData = protoimpl.X.CompressGZIP(file_bootconfig_bootconfig_proto_rawDescData) + }) + return file_bootconfig_bootconfig_proto_rawDescData +} + +var file_bootconfig_bootconfig_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_bootconfig_bootconfig_proto_goTypes = []interface{}{ + (*GetBootConfigRequest)(nil), // 0: gnoi.bootconfig.GetBootConfigRequest + (*GetBootConfigResponse)(nil), // 1: gnoi.bootconfig.GetBootConfigResponse + (*SetBootConfigRequest)(nil), // 2: gnoi.bootconfig.SetBootConfigRequest + (*SetBootConfigResponse)(nil), // 3: gnoi.bootconfig.SetBootConfigResponse + (*bootz.BootConfig)(nil), // 4: bootz.BootConfig + (*bootz.Credentials)(nil), // 5: bootz.Credentials + (*pathz.UploadRequest)(nil), // 6: gnsi.pathz.v1.UploadRequest + (*authz.UploadRequest)(nil), // 7: gnsi.authz.v1.UploadRequest + (*certz.UploadRequest)(nil), // 8: gnsi.certz.v1.UploadRequest + (*bootz.CertzProfiles)(nil), // 9: bootz.CertzProfiles +} +var file_bootconfig_bootconfig_proto_depIdxs = []int32{ + 4, // 0: gnoi.bootconfig.GetBootConfigResponse.boot_config:type_name -> bootz.BootConfig + 4, // 1: gnoi.bootconfig.SetBootConfigRequest.boot_config:type_name -> bootz.BootConfig + 5, // 2: gnoi.bootconfig.SetBootConfigRequest.credentials:type_name -> bootz.Credentials + 6, // 3: gnoi.bootconfig.SetBootConfigRequest.pathz:type_name -> gnsi.pathz.v1.UploadRequest + 7, // 4: gnoi.bootconfig.SetBootConfigRequest.authz:type_name -> gnsi.authz.v1.UploadRequest + 8, // 5: gnoi.bootconfig.SetBootConfigRequest.certificates:type_name -> gnsi.certz.v1.UploadRequest + 9, // 6: gnoi.bootconfig.SetBootConfigRequest.certz:type_name -> bootz.CertzProfiles + 0, // 7: gnoi.bootconfig.BootConfig.GetBootConfig:input_type -> gnoi.bootconfig.GetBootConfigRequest + 2, // 8: gnoi.bootconfig.BootConfig.SetBootConfig:input_type -> gnoi.bootconfig.SetBootConfigRequest + 1, // 9: gnoi.bootconfig.BootConfig.GetBootConfig:output_type -> gnoi.bootconfig.GetBootConfigResponse + 3, // 10: gnoi.bootconfig.BootConfig.SetBootConfig:output_type -> gnoi.bootconfig.SetBootConfigResponse + 9, // [9:11] is the sub-list for method output_type + 7, // [7:9] is the sub-list for method input_type + 7, // [7:7] is the sub-list for extension type_name + 7, // [7:7] is the sub-list for extension extendee + 0, // [0:7] is the sub-list for field type_name +} + +func init() { file_bootconfig_bootconfig_proto_init() } +func file_bootconfig_bootconfig_proto_init() { + if File_bootconfig_bootconfig_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_bootconfig_bootconfig_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetBootConfigRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_bootconfig_bootconfig_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetBootConfigResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_bootconfig_bootconfig_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SetBootConfigRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_bootconfig_bootconfig_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SetBootConfigResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_bootconfig_bootconfig_proto_rawDesc, + NumEnums: 0, + NumMessages: 4, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_bootconfig_bootconfig_proto_goTypes, + DependencyIndexes: file_bootconfig_bootconfig_proto_depIdxs, + MessageInfos: file_bootconfig_bootconfig_proto_msgTypes, + }.Build() + File_bootconfig_bootconfig_proto = out.File + file_bootconfig_bootconfig_proto_rawDesc = nil + file_bootconfig_bootconfig_proto_goTypes = nil + file_bootconfig_bootconfig_proto_depIdxs = nil +} diff --git a/src/sonic-framework/gnoi/bootconfig/bootconfig.proto b/src/sonic-framework/gnoi/bootconfig/bootconfig.proto new file mode 100644 index 000000000000..df08ce662be1 --- /dev/null +++ b/src/sonic-framework/gnoi/bootconfig/bootconfig.proto @@ -0,0 +1,63 @@ +// +// Copyright 2024 Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package gnoi.bootconfig; + +import "github.com/openconfig/bootz/proto/bootz.proto"; +import "github.com/openconfig/gnoi/types/types.proto"; +import "github.com/openconfig/gnsi/authz/authz.proto"; +import "github.com/openconfig/gnsi/certz/certz.proto"; +import "github.com/openconfig/gnsi/pathz/pathz.proto"; + +option go_package = "github.com/openconfig/gnoi/bootconfig"; + +// The current semantic version of the gNOI BootConfig service. +option (gnoi.types.gnoi_version) = "0.1.0"; + +// gNOI BootConfig service provides an API to update the boot configuration +// namespace as in the Bootz protocol (https://github.com/openconfig/bootz). +// This API is often used after the Bootz turnup workflow is finished. +service BootConfig { + // GetBootConfig gets the current boot config. + rpc GetBootConfig(GetBootConfigRequest) returns (GetBootConfigResponse) {} + + // SetBootConfig replaces the existing boot config with the new provided one. + rpc SetBootConfig(SetBootConfigRequest) returns (SetBootConfigResponse) {} +} + +// It is safe to assume that gNOI service is hosted on the primary Controller +// Card, and the boot config is synced automatically between primary and +// secondary Controller Cards. Therefore, we don't need to specify the +// Controller Card ID. +message GetBootConfigRequest { +} + +message GetBootConfigResponse { + bootz.BootConfig boot_config = 1; +} + +message SetBootConfigRequest { + bootz.BootConfig boot_config = 1; + bootz.Credentials credentials = 2; + gnsi.pathz.v1.UploadRequest pathz = 3; + gnsi.authz.v1.UploadRequest authz = 4; + gnsi.certz.v1.UploadRequest certificates = 5 [deprecated=true]; + bootz.CertzProfiles certz = 6; +} + +message SetBootConfigResponse { +} diff --git a/src/sonic-framework/gnoi/bootconfig/bootconfig_grpc.pb.go b/src/sonic-framework/gnoi/bootconfig/bootconfig_grpc.pb.go new file mode 100755 index 000000000000..6649cca80dbc --- /dev/null +++ b/src/sonic-framework/gnoi/bootconfig/bootconfig_grpc.pb.go @@ -0,0 +1,141 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.2.0 +// - protoc v3.21.10 +// source: bootconfig/bootconfig.proto + +package bootconfig + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +// BootConfigClient is the client API for BootConfig service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type BootConfigClient interface { + GetBootConfig(ctx context.Context, in *GetBootConfigRequest, opts ...grpc.CallOption) (*GetBootConfigResponse, error) + SetBootConfig(ctx context.Context, in *SetBootConfigRequest, opts ...grpc.CallOption) (*SetBootConfigResponse, error) +} + +type bootConfigClient struct { + cc grpc.ClientConnInterface +} + +func NewBootConfigClient(cc grpc.ClientConnInterface) BootConfigClient { + return &bootConfigClient{cc} +} + +func (c *bootConfigClient) GetBootConfig(ctx context.Context, in *GetBootConfigRequest, opts ...grpc.CallOption) (*GetBootConfigResponse, error) { + out := new(GetBootConfigResponse) + err := c.cc.Invoke(ctx, "/gnoi.bootconfig.BootConfig/GetBootConfig", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *bootConfigClient) SetBootConfig(ctx context.Context, in *SetBootConfigRequest, opts ...grpc.CallOption) (*SetBootConfigResponse, error) { + out := new(SetBootConfigResponse) + err := c.cc.Invoke(ctx, "/gnoi.bootconfig.BootConfig/SetBootConfig", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// BootConfigServer is the server API for BootConfig service. +// All implementations must embed UnimplementedBootConfigServer +// for forward compatibility +type BootConfigServer interface { + GetBootConfig(context.Context, *GetBootConfigRequest) (*GetBootConfigResponse, error) + SetBootConfig(context.Context, *SetBootConfigRequest) (*SetBootConfigResponse, error) + mustEmbedUnimplementedBootConfigServer() +} + +// UnimplementedBootConfigServer must be embedded to have forward compatible implementations. +type UnimplementedBootConfigServer struct { +} + +func (UnimplementedBootConfigServer) GetBootConfig(context.Context, *GetBootConfigRequest) (*GetBootConfigResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetBootConfig not implemented") +} +func (UnimplementedBootConfigServer) SetBootConfig(context.Context, *SetBootConfigRequest) (*SetBootConfigResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SetBootConfig not implemented") +} +func (UnimplementedBootConfigServer) mustEmbedUnimplementedBootConfigServer() {} + +// UnsafeBootConfigServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to BootConfigServer will +// result in compilation errors. +type UnsafeBootConfigServer interface { + mustEmbedUnimplementedBootConfigServer() +} + +func RegisterBootConfigServer(s grpc.ServiceRegistrar, srv BootConfigServer) { + s.RegisterService(&BootConfig_ServiceDesc, srv) +} + +func _BootConfig_GetBootConfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetBootConfigRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(BootConfigServer).GetBootConfig(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/gnoi.bootconfig.BootConfig/GetBootConfig", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BootConfigServer).GetBootConfig(ctx, req.(*GetBootConfigRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _BootConfig_SetBootConfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SetBootConfigRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(BootConfigServer).SetBootConfig(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/gnoi.bootconfig.BootConfig/SetBootConfig", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BootConfigServer).SetBootConfig(ctx, req.(*SetBootConfigRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// BootConfig_ServiceDesc is the grpc.ServiceDesc for BootConfig service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var BootConfig_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "gnoi.bootconfig.BootConfig", + HandlerType: (*BootConfigServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "GetBootConfig", + Handler: _BootConfig_GetBootConfig_Handler, + }, + { + MethodName: "SetBootConfig", + Handler: _BootConfig_SetBootConfig_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "bootconfig/bootconfig.proto", +} diff --git a/src/sonic-framework/gnoi/cert/BUILD.bazel b/src/sonic-framework/gnoi/cert/BUILD.bazel new file mode 100644 index 000000000000..5863db8d17ec --- /dev/null +++ b/src/sonic-framework/gnoi/cert/BUILD.bazel @@ -0,0 +1,61 @@ +load("@rules_proto//proto:defs.bzl", "proto_library") +load("@io_bazel_rules_go//go:def.bzl", "go_library") +load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library") +load("@com_github_grpc_grpc//bazel:cc_grpc_library.bzl", "cc_grpc_library") +load("//:common.bzl", "use_new_compilers") + +#Copyright 2021 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +package( + default_visibility = ["//visibility:public"], + licenses = ["notice"], +) + +use_new_compilers() + +proto_library( + name = "cert_proto", + srcs = ["cert.proto"], + deps = ["//types:types_proto"], +) + +cc_proto_library( + name = "cert_cc_proto", + deps = [":cert_proto"], +) + +cc_grpc_library( + name = "cert_cc_grpc_proto", + srcs = [":cert_proto"], + grpc_only = True, + deps = [":cert_cc_proto"], +) + +go_proto_library( + name = "cert_go_proto", + compilers = [ + "go_protoc_gen_go", + "go_protoc_gen_go_grpc", + ], + importpath = "github.com/openconfig/gnoi/cert", + proto = ":cert_proto", + deps = ["//types"], +) + +go_library( + name = "cert", + embed = [":cert_go_proto"], + importpath = "github.com/openconfig/gnoi/cert", +) diff --git a/src/sonic-framework/gnoi/cert/cert.pb.go b/src/sonic-framework/gnoi/cert/cert.pb.go new file mode 100644 index 000000000000..d1f6e73d4e1e --- /dev/null +++ b/src/sonic-framework/gnoi/cert/cert.pb.go @@ -0,0 +1,2319 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.30.0 +// protoc v3.21.10 +// source: cert/cert.proto + +package cert + +import ( + _ "github.com/openconfig/gnoi/types" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type CertificateType int32 + +const ( + CertificateType_CT_UNKNOWN CertificateType = 0 + CertificateType_CT_X509 CertificateType = 1 +) + +// Enum value maps for CertificateType. +var ( + CertificateType_name = map[int32]string{ + 0: "CT_UNKNOWN", + 1: "CT_X509", + } + CertificateType_value = map[string]int32{ + "CT_UNKNOWN": 0, + "CT_X509": 1, + } +) + +func (x CertificateType) Enum() *CertificateType { + p := new(CertificateType) + *p = x + return p +} + +func (x CertificateType) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (CertificateType) Descriptor() protoreflect.EnumDescriptor { + return file_cert_cert_proto_enumTypes[0].Descriptor() +} + +func (CertificateType) Type() protoreflect.EnumType { + return &file_cert_cert_proto_enumTypes[0] +} + +func (x CertificateType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use CertificateType.Descriptor instead. +func (CertificateType) EnumDescriptor() ([]byte, []int) { + return file_cert_cert_proto_rawDescGZIP(), []int{0} +} + +type KeyType int32 + +const ( + KeyType_KT_UNKNOWN KeyType = 0 + KeyType_KT_RSA KeyType = 1 +) + +// Enum value maps for KeyType. +var ( + KeyType_name = map[int32]string{ + 0: "KT_UNKNOWN", + 1: "KT_RSA", + } + KeyType_value = map[string]int32{ + "KT_UNKNOWN": 0, + "KT_RSA": 1, + } +) + +func (x KeyType) Enum() *KeyType { + p := new(KeyType) + *p = x + return p +} + +func (x KeyType) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (KeyType) Descriptor() protoreflect.EnumDescriptor { + return file_cert_cert_proto_enumTypes[1].Descriptor() +} + +func (KeyType) Type() protoreflect.EnumType { + return &file_cert_cert_proto_enumTypes[1] +} + +func (x KeyType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use KeyType.Descriptor instead. +func (KeyType) EnumDescriptor() ([]byte, []int) { + return file_cert_cert_proto_rawDescGZIP(), []int{1} +} + +type Endpoint_Type int32 + +const ( + Endpoint_EP_UNSPECIFIED Endpoint_Type = 0 + Endpoint_EP_IPSEC_TUNNEL Endpoint_Type = 1 + Endpoint_EP_DAEMON Endpoint_Type = 2 +) + +// Enum value maps for Endpoint_Type. +var ( + Endpoint_Type_name = map[int32]string{ + 0: "EP_UNSPECIFIED", + 1: "EP_IPSEC_TUNNEL", + 2: "EP_DAEMON", + } + Endpoint_Type_value = map[string]int32{ + "EP_UNSPECIFIED": 0, + "EP_IPSEC_TUNNEL": 1, + "EP_DAEMON": 2, + } +) + +func (x Endpoint_Type) Enum() *Endpoint_Type { + p := new(Endpoint_Type) + *p = x + return p +} + +func (x Endpoint_Type) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Endpoint_Type) Descriptor() protoreflect.EnumDescriptor { + return file_cert_cert_proto_enumTypes[2].Descriptor() +} + +func (Endpoint_Type) Type() protoreflect.EnumType { + return &file_cert_cert_proto_enumTypes[2] +} + +func (x Endpoint_Type) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use Endpoint_Type.Descriptor instead. +func (Endpoint_Type) EnumDescriptor() ([]byte, []int) { + return file_cert_cert_proto_rawDescGZIP(), []int{23, 0} +} + +type RotateCertificateRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to RotateRequest: + // + // *RotateCertificateRequest_GenerateCsr + // *RotateCertificateRequest_LoadCertificate + // *RotateCertificateRequest_FinalizeRotation + RotateRequest isRotateCertificateRequest_RotateRequest `protobuf_oneof:"rotate_request"` +} + +func (x *RotateCertificateRequest) Reset() { + *x = RotateCertificateRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_cert_cert_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RotateCertificateRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RotateCertificateRequest) ProtoMessage() {} + +func (x *RotateCertificateRequest) ProtoReflect() protoreflect.Message { + mi := &file_cert_cert_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RotateCertificateRequest.ProtoReflect.Descriptor instead. +func (*RotateCertificateRequest) Descriptor() ([]byte, []int) { + return file_cert_cert_proto_rawDescGZIP(), []int{0} +} + +func (m *RotateCertificateRequest) GetRotateRequest() isRotateCertificateRequest_RotateRequest { + if m != nil { + return m.RotateRequest + } + return nil +} + +func (x *RotateCertificateRequest) GetGenerateCsr() *GenerateCSRRequest { + if x, ok := x.GetRotateRequest().(*RotateCertificateRequest_GenerateCsr); ok { + return x.GenerateCsr + } + return nil +} + +func (x *RotateCertificateRequest) GetLoadCertificate() *LoadCertificateRequest { + if x, ok := x.GetRotateRequest().(*RotateCertificateRequest_LoadCertificate); ok { + return x.LoadCertificate + } + return nil +} + +func (x *RotateCertificateRequest) GetFinalizeRotation() *FinalizeRequest { + if x, ok := x.GetRotateRequest().(*RotateCertificateRequest_FinalizeRotation); ok { + return x.FinalizeRotation + } + return nil +} + +type isRotateCertificateRequest_RotateRequest interface { + isRotateCertificateRequest_RotateRequest() +} + +type RotateCertificateRequest_GenerateCsr struct { + GenerateCsr *GenerateCSRRequest `protobuf:"bytes,1,opt,name=generate_csr,json=generateCsr,proto3,oneof"` +} + +type RotateCertificateRequest_LoadCertificate struct { + LoadCertificate *LoadCertificateRequest `protobuf:"bytes,2,opt,name=load_certificate,json=loadCertificate,proto3,oneof"` +} + +type RotateCertificateRequest_FinalizeRotation struct { + FinalizeRotation *FinalizeRequest `protobuf:"bytes,3,opt,name=finalize_rotation,json=finalizeRotation,proto3,oneof"` +} + +func (*RotateCertificateRequest_GenerateCsr) isRotateCertificateRequest_RotateRequest() {} + +func (*RotateCertificateRequest_LoadCertificate) isRotateCertificateRequest_RotateRequest() {} + +func (*RotateCertificateRequest_FinalizeRotation) isRotateCertificateRequest_RotateRequest() {} + +type RotateCertificateResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to RotateResponse: + // + // *RotateCertificateResponse_GeneratedCsr + // *RotateCertificateResponse_LoadCertificate + RotateResponse isRotateCertificateResponse_RotateResponse `protobuf_oneof:"rotate_response"` +} + +func (x *RotateCertificateResponse) Reset() { + *x = RotateCertificateResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_cert_cert_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RotateCertificateResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RotateCertificateResponse) ProtoMessage() {} + +func (x *RotateCertificateResponse) ProtoReflect() protoreflect.Message { + mi := &file_cert_cert_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RotateCertificateResponse.ProtoReflect.Descriptor instead. +func (*RotateCertificateResponse) Descriptor() ([]byte, []int) { + return file_cert_cert_proto_rawDescGZIP(), []int{1} +} + +func (m *RotateCertificateResponse) GetRotateResponse() isRotateCertificateResponse_RotateResponse { + if m != nil { + return m.RotateResponse + } + return nil +} + +func (x *RotateCertificateResponse) GetGeneratedCsr() *GenerateCSRResponse { + if x, ok := x.GetRotateResponse().(*RotateCertificateResponse_GeneratedCsr); ok { + return x.GeneratedCsr + } + return nil +} + +func (x *RotateCertificateResponse) GetLoadCertificate() *LoadCertificateResponse { + if x, ok := x.GetRotateResponse().(*RotateCertificateResponse_LoadCertificate); ok { + return x.LoadCertificate + } + return nil +} + +type isRotateCertificateResponse_RotateResponse interface { + isRotateCertificateResponse_RotateResponse() +} + +type RotateCertificateResponse_GeneratedCsr struct { + GeneratedCsr *GenerateCSRResponse `protobuf:"bytes,1,opt,name=generated_csr,json=generatedCsr,proto3,oneof"` +} + +type RotateCertificateResponse_LoadCertificate struct { + LoadCertificate *LoadCertificateResponse `protobuf:"bytes,2,opt,name=load_certificate,json=loadCertificate,proto3,oneof"` +} + +func (*RotateCertificateResponse_GeneratedCsr) isRotateCertificateResponse_RotateResponse() {} + +func (*RotateCertificateResponse_LoadCertificate) isRotateCertificateResponse_RotateResponse() {} + +type InstallCertificateRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to InstallRequest: + // + // *InstallCertificateRequest_GenerateCsr + // *InstallCertificateRequest_LoadCertificate + InstallRequest isInstallCertificateRequest_InstallRequest `protobuf_oneof:"install_request"` +} + +func (x *InstallCertificateRequest) Reset() { + *x = InstallCertificateRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_cert_cert_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *InstallCertificateRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*InstallCertificateRequest) ProtoMessage() {} + +func (x *InstallCertificateRequest) ProtoReflect() protoreflect.Message { + mi := &file_cert_cert_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use InstallCertificateRequest.ProtoReflect.Descriptor instead. +func (*InstallCertificateRequest) Descriptor() ([]byte, []int) { + return file_cert_cert_proto_rawDescGZIP(), []int{2} +} + +func (m *InstallCertificateRequest) GetInstallRequest() isInstallCertificateRequest_InstallRequest { + if m != nil { + return m.InstallRequest + } + return nil +} + +func (x *InstallCertificateRequest) GetGenerateCsr() *GenerateCSRRequest { + if x, ok := x.GetInstallRequest().(*InstallCertificateRequest_GenerateCsr); ok { + return x.GenerateCsr + } + return nil +} + +func (x *InstallCertificateRequest) GetLoadCertificate() *LoadCertificateRequest { + if x, ok := x.GetInstallRequest().(*InstallCertificateRequest_LoadCertificate); ok { + return x.LoadCertificate + } + return nil +} + +type isInstallCertificateRequest_InstallRequest interface { + isInstallCertificateRequest_InstallRequest() +} + +type InstallCertificateRequest_GenerateCsr struct { + GenerateCsr *GenerateCSRRequest `protobuf:"bytes,1,opt,name=generate_csr,json=generateCsr,proto3,oneof"` +} + +type InstallCertificateRequest_LoadCertificate struct { + LoadCertificate *LoadCertificateRequest `protobuf:"bytes,2,opt,name=load_certificate,json=loadCertificate,proto3,oneof"` +} + +func (*InstallCertificateRequest_GenerateCsr) isInstallCertificateRequest_InstallRequest() {} + +func (*InstallCertificateRequest_LoadCertificate) isInstallCertificateRequest_InstallRequest() {} + +type InstallCertificateResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to InstallResponse: + // + // *InstallCertificateResponse_GeneratedCsr + // *InstallCertificateResponse_LoadCertificate + InstallResponse isInstallCertificateResponse_InstallResponse `protobuf_oneof:"install_response"` +} + +func (x *InstallCertificateResponse) Reset() { + *x = InstallCertificateResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_cert_cert_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *InstallCertificateResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*InstallCertificateResponse) ProtoMessage() {} + +func (x *InstallCertificateResponse) ProtoReflect() protoreflect.Message { + mi := &file_cert_cert_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use InstallCertificateResponse.ProtoReflect.Descriptor instead. +func (*InstallCertificateResponse) Descriptor() ([]byte, []int) { + return file_cert_cert_proto_rawDescGZIP(), []int{3} +} + +func (m *InstallCertificateResponse) GetInstallResponse() isInstallCertificateResponse_InstallResponse { + if m != nil { + return m.InstallResponse + } + return nil +} + +func (x *InstallCertificateResponse) GetGeneratedCsr() *GenerateCSRResponse { + if x, ok := x.GetInstallResponse().(*InstallCertificateResponse_GeneratedCsr); ok { + return x.GeneratedCsr + } + return nil +} + +func (x *InstallCertificateResponse) GetLoadCertificate() *LoadCertificateResponse { + if x, ok := x.GetInstallResponse().(*InstallCertificateResponse_LoadCertificate); ok { + return x.LoadCertificate + } + return nil +} + +type isInstallCertificateResponse_InstallResponse interface { + isInstallCertificateResponse_InstallResponse() +} + +type InstallCertificateResponse_GeneratedCsr struct { + GeneratedCsr *GenerateCSRResponse `protobuf:"bytes,1,opt,name=generated_csr,json=generatedCsr,proto3,oneof"` +} + +type InstallCertificateResponse_LoadCertificate struct { + LoadCertificate *LoadCertificateResponse `protobuf:"bytes,2,opt,name=load_certificate,json=loadCertificate,proto3,oneof"` +} + +func (*InstallCertificateResponse_GeneratedCsr) isInstallCertificateResponse_InstallResponse() {} + +func (*InstallCertificateResponse_LoadCertificate) isInstallCertificateResponse_InstallResponse() {} + +type GenerateCSRRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CsrParams *CSRParams `protobuf:"bytes,1,opt,name=csr_params,json=csrParams,proto3" json:"csr_params,omitempty"` + CertificateId string `protobuf:"bytes,2,opt,name=certificate_id,json=certificateId,proto3" json:"certificate_id,omitempty"` +} + +func (x *GenerateCSRRequest) Reset() { + *x = GenerateCSRRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_cert_cert_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GenerateCSRRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GenerateCSRRequest) ProtoMessage() {} + +func (x *GenerateCSRRequest) ProtoReflect() protoreflect.Message { + mi := &file_cert_cert_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GenerateCSRRequest.ProtoReflect.Descriptor instead. +func (*GenerateCSRRequest) Descriptor() ([]byte, []int) { + return file_cert_cert_proto_rawDescGZIP(), []int{4} +} + +func (x *GenerateCSRRequest) GetCsrParams() *CSRParams { + if x != nil { + return x.CsrParams + } + return nil +} + +func (x *GenerateCSRRequest) GetCertificateId() string { + if x != nil { + return x.CertificateId + } + return "" +} + +type CSRParams struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Type CertificateType `protobuf:"varint,1,opt,name=type,proto3,enum=gnoi.certificate.CertificateType" json:"type,omitempty"` + MinKeySize uint32 `protobuf:"varint,2,opt,name=min_key_size,json=minKeySize,proto3" json:"min_key_size,omitempty"` + KeyType KeyType `protobuf:"varint,3,opt,name=key_type,json=keyType,proto3,enum=gnoi.certificate.KeyType" json:"key_type,omitempty"` + CommonName string `protobuf:"bytes,4,opt,name=common_name,json=commonName,proto3" json:"common_name,omitempty"` + Country string `protobuf:"bytes,5,opt,name=country,proto3" json:"country,omitempty"` + State string `protobuf:"bytes,6,opt,name=state,proto3" json:"state,omitempty"` + City string `protobuf:"bytes,7,opt,name=city,proto3" json:"city,omitempty"` + Organization string `protobuf:"bytes,8,opt,name=organization,proto3" json:"organization,omitempty"` + OrganizationalUnit string `protobuf:"bytes,9,opt,name=organizational_unit,json=organizationalUnit,proto3" json:"organizational_unit,omitempty"` + IpAddress string `protobuf:"bytes,10,opt,name=ip_address,json=ipAddress,proto3" json:"ip_address,omitempty"` + EmailId string `protobuf:"bytes,11,opt,name=email_id,json=emailId,proto3" json:"email_id,omitempty"` +} + +func (x *CSRParams) Reset() { + *x = CSRParams{} + if protoimpl.UnsafeEnabled { + mi := &file_cert_cert_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CSRParams) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CSRParams) ProtoMessage() {} + +func (x *CSRParams) ProtoReflect() protoreflect.Message { + mi := &file_cert_cert_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CSRParams.ProtoReflect.Descriptor instead. +func (*CSRParams) Descriptor() ([]byte, []int) { + return file_cert_cert_proto_rawDescGZIP(), []int{5} +} + +func (x *CSRParams) GetType() CertificateType { + if x != nil { + return x.Type + } + return CertificateType_CT_UNKNOWN +} + +func (x *CSRParams) GetMinKeySize() uint32 { + if x != nil { + return x.MinKeySize + } + return 0 +} + +func (x *CSRParams) GetKeyType() KeyType { + if x != nil { + return x.KeyType + } + return KeyType_KT_UNKNOWN +} + +func (x *CSRParams) GetCommonName() string { + if x != nil { + return x.CommonName + } + return "" +} + +func (x *CSRParams) GetCountry() string { + if x != nil { + return x.Country + } + return "" +} + +func (x *CSRParams) GetState() string { + if x != nil { + return x.State + } + return "" +} + +func (x *CSRParams) GetCity() string { + if x != nil { + return x.City + } + return "" +} + +func (x *CSRParams) GetOrganization() string { + if x != nil { + return x.Organization + } + return "" +} + +func (x *CSRParams) GetOrganizationalUnit() string { + if x != nil { + return x.OrganizationalUnit + } + return "" +} + +func (x *CSRParams) GetIpAddress() string { + if x != nil { + return x.IpAddress + } + return "" +} + +func (x *CSRParams) GetEmailId() string { + if x != nil { + return x.EmailId + } + return "" +} + +type GenerateCSRResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Csr *CSR `protobuf:"bytes,1,opt,name=csr,proto3" json:"csr,omitempty"` +} + +func (x *GenerateCSRResponse) Reset() { + *x = GenerateCSRResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_cert_cert_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GenerateCSRResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GenerateCSRResponse) ProtoMessage() {} + +func (x *GenerateCSRResponse) ProtoReflect() protoreflect.Message { + mi := &file_cert_cert_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GenerateCSRResponse.ProtoReflect.Descriptor instead. +func (*GenerateCSRResponse) Descriptor() ([]byte, []int) { + return file_cert_cert_proto_rawDescGZIP(), []int{6} +} + +func (x *GenerateCSRResponse) GetCsr() *CSR { + if x != nil { + return x.Csr + } + return nil +} + +type LoadCertificateRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Certificate *Certificate `protobuf:"bytes,1,opt,name=certificate,proto3" json:"certificate,omitempty"` + KeyPair *KeyPair `protobuf:"bytes,2,opt,name=key_pair,json=keyPair,proto3" json:"key_pair,omitempty"` + CertificateId string `protobuf:"bytes,3,opt,name=certificate_id,json=certificateId,proto3" json:"certificate_id,omitempty"` + CaCertificates []*Certificate `protobuf:"bytes,4,rep,name=ca_certificates,json=caCertificates,proto3" json:"ca_certificates,omitempty"` +} + +func (x *LoadCertificateRequest) Reset() { + *x = LoadCertificateRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_cert_cert_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LoadCertificateRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LoadCertificateRequest) ProtoMessage() {} + +func (x *LoadCertificateRequest) ProtoReflect() protoreflect.Message { + mi := &file_cert_cert_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use LoadCertificateRequest.ProtoReflect.Descriptor instead. +func (*LoadCertificateRequest) Descriptor() ([]byte, []int) { + return file_cert_cert_proto_rawDescGZIP(), []int{7} +} + +func (x *LoadCertificateRequest) GetCertificate() *Certificate { + if x != nil { + return x.Certificate + } + return nil +} + +func (x *LoadCertificateRequest) GetKeyPair() *KeyPair { + if x != nil { + return x.KeyPair + } + return nil +} + +func (x *LoadCertificateRequest) GetCertificateId() string { + if x != nil { + return x.CertificateId + } + return "" +} + +func (x *LoadCertificateRequest) GetCaCertificates() []*Certificate { + if x != nil { + return x.CaCertificates + } + return nil +} + +type LoadCertificateResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *LoadCertificateResponse) Reset() { + *x = LoadCertificateResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_cert_cert_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LoadCertificateResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LoadCertificateResponse) ProtoMessage() {} + +func (x *LoadCertificateResponse) ProtoReflect() protoreflect.Message { + mi := &file_cert_cert_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use LoadCertificateResponse.ProtoReflect.Descriptor instead. +func (*LoadCertificateResponse) Descriptor() ([]byte, []int) { + return file_cert_cert_proto_rawDescGZIP(), []int{8} +} + +type LoadCertificateAuthorityBundleRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CaCertificates []*Certificate `protobuf:"bytes,1,rep,name=ca_certificates,json=caCertificates,proto3" json:"ca_certificates,omitempty"` +} + +func (x *LoadCertificateAuthorityBundleRequest) Reset() { + *x = LoadCertificateAuthorityBundleRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_cert_cert_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LoadCertificateAuthorityBundleRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LoadCertificateAuthorityBundleRequest) ProtoMessage() {} + +func (x *LoadCertificateAuthorityBundleRequest) ProtoReflect() protoreflect.Message { + mi := &file_cert_cert_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use LoadCertificateAuthorityBundleRequest.ProtoReflect.Descriptor instead. +func (*LoadCertificateAuthorityBundleRequest) Descriptor() ([]byte, []int) { + return file_cert_cert_proto_rawDescGZIP(), []int{9} +} + +func (x *LoadCertificateAuthorityBundleRequest) GetCaCertificates() []*Certificate { + if x != nil { + return x.CaCertificates + } + return nil +} + +type LoadCertificateAuthorityBundleResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *LoadCertificateAuthorityBundleResponse) Reset() { + *x = LoadCertificateAuthorityBundleResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_cert_cert_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LoadCertificateAuthorityBundleResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LoadCertificateAuthorityBundleResponse) ProtoMessage() {} + +func (x *LoadCertificateAuthorityBundleResponse) ProtoReflect() protoreflect.Message { + mi := &file_cert_cert_proto_msgTypes[10] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use LoadCertificateAuthorityBundleResponse.ProtoReflect.Descriptor instead. +func (*LoadCertificateAuthorityBundleResponse) Descriptor() ([]byte, []int) { + return file_cert_cert_proto_rawDescGZIP(), []int{10} +} + +type FinalizeRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *FinalizeRequest) Reset() { + *x = FinalizeRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_cert_cert_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FinalizeRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FinalizeRequest) ProtoMessage() {} + +func (x *FinalizeRequest) ProtoReflect() protoreflect.Message { + mi := &file_cert_cert_proto_msgTypes[11] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use FinalizeRequest.ProtoReflect.Descriptor instead. +func (*FinalizeRequest) Descriptor() ([]byte, []int) { + return file_cert_cert_proto_rawDescGZIP(), []int{11} +} + +type GetCertificatesRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *GetCertificatesRequest) Reset() { + *x = GetCertificatesRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_cert_cert_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetCertificatesRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetCertificatesRequest) ProtoMessage() {} + +func (x *GetCertificatesRequest) ProtoReflect() protoreflect.Message { + mi := &file_cert_cert_proto_msgTypes[12] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetCertificatesRequest.ProtoReflect.Descriptor instead. +func (*GetCertificatesRequest) Descriptor() ([]byte, []int) { + return file_cert_cert_proto_rawDescGZIP(), []int{12} +} + +type GetCertificatesResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CertificateInfo []*CertificateInfo `protobuf:"bytes,1,rep,name=certificate_info,json=certificateInfo,proto3" json:"certificate_info,omitempty"` +} + +func (x *GetCertificatesResponse) Reset() { + *x = GetCertificatesResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_cert_cert_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetCertificatesResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetCertificatesResponse) ProtoMessage() {} + +func (x *GetCertificatesResponse) ProtoReflect() protoreflect.Message { + mi := &file_cert_cert_proto_msgTypes[13] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetCertificatesResponse.ProtoReflect.Descriptor instead. +func (*GetCertificatesResponse) Descriptor() ([]byte, []int) { + return file_cert_cert_proto_rawDescGZIP(), []int{13} +} + +func (x *GetCertificatesResponse) GetCertificateInfo() []*CertificateInfo { + if x != nil { + return x.CertificateInfo + } + return nil +} + +type CertificateInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CertificateId string `protobuf:"bytes,1,opt,name=certificate_id,json=certificateId,proto3" json:"certificate_id,omitempty"` + Certificate *Certificate `protobuf:"bytes,2,opt,name=certificate,proto3" json:"certificate,omitempty"` + Endpoints []*Endpoint `protobuf:"bytes,3,rep,name=endpoints,proto3" json:"endpoints,omitempty"` + ModificationTime int64 `protobuf:"varint,4,opt,name=modification_time,json=modificationTime,proto3" json:"modification_time,omitempty"` +} + +func (x *CertificateInfo) Reset() { + *x = CertificateInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_cert_cert_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CertificateInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CertificateInfo) ProtoMessage() {} + +func (x *CertificateInfo) ProtoReflect() protoreflect.Message { + mi := &file_cert_cert_proto_msgTypes[14] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CertificateInfo.ProtoReflect.Descriptor instead. +func (*CertificateInfo) Descriptor() ([]byte, []int) { + return file_cert_cert_proto_rawDescGZIP(), []int{14} +} + +func (x *CertificateInfo) GetCertificateId() string { + if x != nil { + return x.CertificateId + } + return "" +} + +func (x *CertificateInfo) GetCertificate() *Certificate { + if x != nil { + return x.Certificate + } + return nil +} + +func (x *CertificateInfo) GetEndpoints() []*Endpoint { + if x != nil { + return x.Endpoints + } + return nil +} + +func (x *CertificateInfo) GetModificationTime() int64 { + if x != nil { + return x.ModificationTime + } + return 0 +} + +type RevokeCertificatesRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CertificateId []string `protobuf:"bytes,1,rep,name=certificate_id,json=certificateId,proto3" json:"certificate_id,omitempty"` +} + +func (x *RevokeCertificatesRequest) Reset() { + *x = RevokeCertificatesRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_cert_cert_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RevokeCertificatesRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RevokeCertificatesRequest) ProtoMessage() {} + +func (x *RevokeCertificatesRequest) ProtoReflect() protoreflect.Message { + mi := &file_cert_cert_proto_msgTypes[15] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RevokeCertificatesRequest.ProtoReflect.Descriptor instead. +func (*RevokeCertificatesRequest) Descriptor() ([]byte, []int) { + return file_cert_cert_proto_rawDescGZIP(), []int{15} +} + +func (x *RevokeCertificatesRequest) GetCertificateId() []string { + if x != nil { + return x.CertificateId + } + return nil +} + +type RevokeCertificatesResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + RevokedCertificateId []string `protobuf:"bytes,1,rep,name=revoked_certificate_id,json=revokedCertificateId,proto3" json:"revoked_certificate_id,omitempty"` + CertificateRevocationError []*CertificateRevocationError `protobuf:"bytes,2,rep,name=certificate_revocation_error,json=certificateRevocationError,proto3" json:"certificate_revocation_error,omitempty"` +} + +func (x *RevokeCertificatesResponse) Reset() { + *x = RevokeCertificatesResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_cert_cert_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RevokeCertificatesResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RevokeCertificatesResponse) ProtoMessage() {} + +func (x *RevokeCertificatesResponse) ProtoReflect() protoreflect.Message { + mi := &file_cert_cert_proto_msgTypes[16] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RevokeCertificatesResponse.ProtoReflect.Descriptor instead. +func (*RevokeCertificatesResponse) Descriptor() ([]byte, []int) { + return file_cert_cert_proto_rawDescGZIP(), []int{16} +} + +func (x *RevokeCertificatesResponse) GetRevokedCertificateId() []string { + if x != nil { + return x.RevokedCertificateId + } + return nil +} + +func (x *RevokeCertificatesResponse) GetCertificateRevocationError() []*CertificateRevocationError { + if x != nil { + return x.CertificateRevocationError + } + return nil +} + +type CertificateRevocationError struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CertificateId string `protobuf:"bytes,1,opt,name=certificate_id,json=certificateId,proto3" json:"certificate_id,omitempty"` + ErrorMessage string `protobuf:"bytes,2,opt,name=error_message,json=errorMessage,proto3" json:"error_message,omitempty"` +} + +func (x *CertificateRevocationError) Reset() { + *x = CertificateRevocationError{} + if protoimpl.UnsafeEnabled { + mi := &file_cert_cert_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CertificateRevocationError) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CertificateRevocationError) ProtoMessage() {} + +func (x *CertificateRevocationError) ProtoReflect() protoreflect.Message { + mi := &file_cert_cert_proto_msgTypes[17] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CertificateRevocationError.ProtoReflect.Descriptor instead. +func (*CertificateRevocationError) Descriptor() ([]byte, []int) { + return file_cert_cert_proto_rawDescGZIP(), []int{17} +} + +func (x *CertificateRevocationError) GetCertificateId() string { + if x != nil { + return x.CertificateId + } + return "" +} + +func (x *CertificateRevocationError) GetErrorMessage() string { + if x != nil { + return x.ErrorMessage + } + return "" +} + +type CanGenerateCSRRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + KeyType KeyType `protobuf:"varint,1,opt,name=key_type,json=keyType,proto3,enum=gnoi.certificate.KeyType" json:"key_type,omitempty"` + CertificateType CertificateType `protobuf:"varint,2,opt,name=certificate_type,json=certificateType,proto3,enum=gnoi.certificate.CertificateType" json:"certificate_type,omitempty"` + KeySize uint32 `protobuf:"varint,3,opt,name=key_size,json=keySize,proto3" json:"key_size,omitempty"` +} + +func (x *CanGenerateCSRRequest) Reset() { + *x = CanGenerateCSRRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_cert_cert_proto_msgTypes[18] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CanGenerateCSRRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CanGenerateCSRRequest) ProtoMessage() {} + +func (x *CanGenerateCSRRequest) ProtoReflect() protoreflect.Message { + mi := &file_cert_cert_proto_msgTypes[18] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CanGenerateCSRRequest.ProtoReflect.Descriptor instead. +func (*CanGenerateCSRRequest) Descriptor() ([]byte, []int) { + return file_cert_cert_proto_rawDescGZIP(), []int{18} +} + +func (x *CanGenerateCSRRequest) GetKeyType() KeyType { + if x != nil { + return x.KeyType + } + return KeyType_KT_UNKNOWN +} + +func (x *CanGenerateCSRRequest) GetCertificateType() CertificateType { + if x != nil { + return x.CertificateType + } + return CertificateType_CT_UNKNOWN +} + +func (x *CanGenerateCSRRequest) GetKeySize() uint32 { + if x != nil { + return x.KeySize + } + return 0 +} + +type CanGenerateCSRResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CanGenerate bool `protobuf:"varint,4,opt,name=can_generate,json=canGenerate,proto3" json:"can_generate,omitempty"` +} + +func (x *CanGenerateCSRResponse) Reset() { + *x = CanGenerateCSRResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_cert_cert_proto_msgTypes[19] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CanGenerateCSRResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CanGenerateCSRResponse) ProtoMessage() {} + +func (x *CanGenerateCSRResponse) ProtoReflect() protoreflect.Message { + mi := &file_cert_cert_proto_msgTypes[19] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CanGenerateCSRResponse.ProtoReflect.Descriptor instead. +func (*CanGenerateCSRResponse) Descriptor() ([]byte, []int) { + return file_cert_cert_proto_rawDescGZIP(), []int{19} +} + +func (x *CanGenerateCSRResponse) GetCanGenerate() bool { + if x != nil { + return x.CanGenerate + } + return false +} + +type Certificate struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Type CertificateType `protobuf:"varint,1,opt,name=type,proto3,enum=gnoi.certificate.CertificateType" json:"type,omitempty"` + Certificate []byte `protobuf:"bytes,2,opt,name=certificate,proto3" json:"certificate,omitempty"` +} + +func (x *Certificate) Reset() { + *x = Certificate{} + if protoimpl.UnsafeEnabled { + mi := &file_cert_cert_proto_msgTypes[20] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Certificate) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Certificate) ProtoMessage() {} + +func (x *Certificate) ProtoReflect() protoreflect.Message { + mi := &file_cert_cert_proto_msgTypes[20] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Certificate.ProtoReflect.Descriptor instead. +func (*Certificate) Descriptor() ([]byte, []int) { + return file_cert_cert_proto_rawDescGZIP(), []int{20} +} + +func (x *Certificate) GetType() CertificateType { + if x != nil { + return x.Type + } + return CertificateType_CT_UNKNOWN +} + +func (x *Certificate) GetCertificate() []byte { + if x != nil { + return x.Certificate + } + return nil +} + +type CSR struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Type CertificateType `protobuf:"varint,1,opt,name=type,proto3,enum=gnoi.certificate.CertificateType" json:"type,omitempty"` + Csr []byte `protobuf:"bytes,2,opt,name=csr,proto3" json:"csr,omitempty"` +} + +func (x *CSR) Reset() { + *x = CSR{} + if protoimpl.UnsafeEnabled { + mi := &file_cert_cert_proto_msgTypes[21] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CSR) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CSR) ProtoMessage() {} + +func (x *CSR) ProtoReflect() protoreflect.Message { + mi := &file_cert_cert_proto_msgTypes[21] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CSR.ProtoReflect.Descriptor instead. +func (*CSR) Descriptor() ([]byte, []int) { + return file_cert_cert_proto_rawDescGZIP(), []int{21} +} + +func (x *CSR) GetType() CertificateType { + if x != nil { + return x.Type + } + return CertificateType_CT_UNKNOWN +} + +func (x *CSR) GetCsr() []byte { + if x != nil { + return x.Csr + } + return nil +} + +type KeyPair struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + PrivateKey []byte `protobuf:"bytes,1,opt,name=private_key,json=privateKey,proto3" json:"private_key,omitempty"` + PublicKey []byte `protobuf:"bytes,2,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"` +} + +func (x *KeyPair) Reset() { + *x = KeyPair{} + if protoimpl.UnsafeEnabled { + mi := &file_cert_cert_proto_msgTypes[22] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *KeyPair) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*KeyPair) ProtoMessage() {} + +func (x *KeyPair) ProtoReflect() protoreflect.Message { + mi := &file_cert_cert_proto_msgTypes[22] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use KeyPair.ProtoReflect.Descriptor instead. +func (*KeyPair) Descriptor() ([]byte, []int) { + return file_cert_cert_proto_rawDescGZIP(), []int{22} +} + +func (x *KeyPair) GetPrivateKey() []byte { + if x != nil { + return x.PrivateKey + } + return nil +} + +func (x *KeyPair) GetPublicKey() []byte { + if x != nil { + return x.PublicKey + } + return nil +} + +type Endpoint struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Type Endpoint_Type `protobuf:"varint,1,opt,name=type,proto3,enum=gnoi.certificate.Endpoint_Type" json:"type,omitempty"` + Endpoint string `protobuf:"bytes,2,opt,name=endpoint,proto3" json:"endpoint,omitempty"` +} + +func (x *Endpoint) Reset() { + *x = Endpoint{} + if protoimpl.UnsafeEnabled { + mi := &file_cert_cert_proto_msgTypes[23] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Endpoint) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Endpoint) ProtoMessage() {} + +func (x *Endpoint) ProtoReflect() protoreflect.Message { + mi := &file_cert_cert_proto_msgTypes[23] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Endpoint.ProtoReflect.Descriptor instead. +func (*Endpoint) Descriptor() ([]byte, []int) { + return file_cert_cert_proto_rawDescGZIP(), []int{23} +} + +func (x *Endpoint) GetType() Endpoint_Type { + if x != nil { + return x.Type + } + return Endpoint_EP_UNSPECIFIED +} + +func (x *Endpoint) GetEndpoint() string { + if x != nil { + return x.Endpoint + } + return "" +} + +var File_cert_cert_proto protoreflect.FileDescriptor + +var file_cert_cert_proto_rawDesc = []byte{ + 0x0a, 0x0f, 0x63, 0x65, 0x72, 0x74, 0x2f, 0x63, 0x65, 0x72, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x12, 0x10, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, + 0x61, 0x74, 0x65, 0x1a, 0x2c, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, + 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x67, 0x6e, 0x6f, 0x69, 0x2f, + 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x22, 0xa0, 0x02, 0x0a, 0x18, 0x52, 0x6f, 0x74, 0x61, 0x74, 0x65, 0x43, 0x65, 0x72, 0x74, + 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x49, + 0x0a, 0x0c, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x5f, 0x63, 0x73, 0x72, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x63, 0x65, 0x72, 0x74, + 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x2e, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, + 0x43, 0x53, 0x52, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x0b, 0x67, 0x65, + 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x43, 0x73, 0x72, 0x12, 0x55, 0x0a, 0x10, 0x6c, 0x6f, 0x61, + 0x64, 0x5f, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x63, 0x65, 0x72, 0x74, 0x69, + 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x2e, 0x4c, 0x6f, 0x61, 0x64, 0x43, 0x65, 0x72, 0x74, 0x69, + 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, + 0x0f, 0x6c, 0x6f, 0x61, 0x64, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, + 0x12, 0x50, 0x0a, 0x11, 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x5f, 0x72, 0x6f, 0x74, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x67, 0x6e, + 0x6f, 0x69, 0x2e, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x2e, 0x46, + 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, + 0x52, 0x10, 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x52, 0x6f, 0x74, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x42, 0x10, 0x0a, 0x0e, 0x72, 0x6f, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x72, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x22, 0xd4, 0x01, 0x0a, 0x19, 0x52, 0x6f, 0x74, 0x61, 0x74, 0x65, 0x43, + 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x4c, 0x0a, 0x0d, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x5f, + 0x63, 0x73, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x67, 0x6e, 0x6f, 0x69, + 0x2e, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x2e, 0x47, 0x65, 0x6e, + 0x65, 0x72, 0x61, 0x74, 0x65, 0x43, 0x53, 0x52, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x48, 0x00, 0x52, 0x0c, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x43, 0x73, 0x72, + 0x12, 0x56, 0x0a, 0x10, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, + 0x63, 0x61, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x67, 0x6e, 0x6f, + 0x69, 0x2e, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x2e, 0x4c, 0x6f, + 0x61, 0x64, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x00, 0x52, 0x0f, 0x6c, 0x6f, 0x61, 0x64, 0x43, 0x65, 0x72, + 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x42, 0x11, 0x0a, 0x0f, 0x72, 0x6f, 0x74, 0x61, + 0x74, 0x65, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xd0, 0x01, 0x0a, 0x19, + 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, + 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x49, 0x0a, 0x0c, 0x67, 0x65, 0x6e, + 0x65, 0x72, 0x61, 0x74, 0x65, 0x5f, 0x63, 0x73, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x24, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, + 0x74, 0x65, 0x2e, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x43, 0x53, 0x52, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x0b, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, + 0x65, 0x43, 0x73, 0x72, 0x12, 0x55, 0x0a, 0x10, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x63, 0x65, 0x72, + 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, + 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, + 0x65, 0x2e, 0x4c, 0x6f, 0x61, 0x64, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, + 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x0f, 0x6c, 0x6f, 0x61, 0x64, + 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x42, 0x11, 0x0a, 0x0f, 0x69, + 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0xd6, + 0x01, 0x0a, 0x1a, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, + 0x69, 0x63, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4c, 0x0a, + 0x0d, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x63, 0x73, 0x72, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x63, 0x65, 0x72, 0x74, + 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x2e, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, + 0x43, 0x53, 0x52, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x00, 0x52, 0x0c, 0x67, + 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x43, 0x73, 0x72, 0x12, 0x56, 0x0a, 0x10, 0x6c, + 0x6f, 0x61, 0x64, 0x5f, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x63, 0x65, 0x72, + 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x2e, 0x4c, 0x6f, 0x61, 0x64, 0x43, 0x65, 0x72, + 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x48, 0x00, 0x52, 0x0f, 0x6c, 0x6f, 0x61, 0x64, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, + 0x61, 0x74, 0x65, 0x42, 0x12, 0x0a, 0x10, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x5f, 0x72, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x77, 0x0a, 0x12, 0x47, 0x65, 0x6e, 0x65, 0x72, + 0x61, 0x74, 0x65, 0x43, 0x53, 0x52, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3a, 0x0a, + 0x0a, 0x63, 0x73, 0x72, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, + 0x63, 0x61, 0x74, 0x65, 0x2e, 0x43, 0x53, 0x52, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x09, + 0x63, 0x73, 0x72, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x25, 0x0a, 0x0e, 0x63, 0x65, 0x72, + 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0d, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x49, 0x64, + 0x22, 0x8e, 0x03, 0x0a, 0x09, 0x43, 0x53, 0x52, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x35, + 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x21, 0x2e, 0x67, + 0x6e, 0x6f, 0x69, 0x2e, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x2e, + 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x54, 0x79, 0x70, 0x65, 0x52, + 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x20, 0x0a, 0x0c, 0x6d, 0x69, 0x6e, 0x5f, 0x6b, 0x65, 0x79, + 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0a, 0x6d, 0x69, 0x6e, + 0x4b, 0x65, 0x79, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x34, 0x0a, 0x08, 0x6b, 0x65, 0x79, 0x5f, 0x74, + 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x19, 0x2e, 0x67, 0x6e, 0x6f, 0x69, + 0x2e, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x2e, 0x4b, 0x65, 0x79, + 0x54, 0x79, 0x70, 0x65, 0x52, 0x07, 0x6b, 0x65, 0x79, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1f, 0x0a, + 0x0b, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x18, + 0x0a, 0x07, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x07, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, + 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x12, + 0x0a, 0x04, 0x63, 0x69, 0x74, 0x79, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x69, + 0x74, 0x79, 0x12, 0x22, 0x0a, 0x0c, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, + 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2f, 0x0a, 0x13, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, + 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x18, 0x09, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x12, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x61, 0x6c, 0x55, 0x6e, 0x69, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x70, 0x5f, 0x61, 0x64, + 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x69, 0x70, 0x41, + 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x19, 0x0a, 0x08, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x5f, + 0x69, 0x64, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x49, + 0x64, 0x22, 0x3e, 0x0a, 0x13, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x43, 0x53, 0x52, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x27, 0x0a, 0x03, 0x63, 0x73, 0x72, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x63, 0x65, 0x72, + 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x2e, 0x43, 0x53, 0x52, 0x52, 0x03, 0x63, 0x73, + 0x72, 0x22, 0xfe, 0x01, 0x0a, 0x16, 0x4c, 0x6f, 0x61, 0x64, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, + 0x69, 0x63, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3f, 0x0a, 0x0b, + 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1d, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, + 0x63, 0x61, 0x74, 0x65, 0x2e, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, + 0x52, 0x0b, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x12, 0x34, 0x0a, + 0x08, 0x6b, 0x65, 0x79, 0x5f, 0x70, 0x61, 0x69, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x19, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, + 0x74, 0x65, 0x2e, 0x4b, 0x65, 0x79, 0x50, 0x61, 0x69, 0x72, 0x52, 0x07, 0x6b, 0x65, 0x79, 0x50, + 0x61, 0x69, 0x72, 0x12, 0x25, 0x0a, 0x0e, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, + 0x74, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x63, 0x65, 0x72, + 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x49, 0x64, 0x12, 0x46, 0x0a, 0x0f, 0x63, 0x61, + 0x5f, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x73, 0x18, 0x04, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x63, 0x65, 0x72, 0x74, 0x69, + 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x2e, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, + 0x74, 0x65, 0x52, 0x0e, 0x63, 0x61, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, + 0x65, 0x73, 0x22, 0x19, 0x0a, 0x17, 0x4c, 0x6f, 0x61, 0x64, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, + 0x69, 0x63, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x6f, 0x0a, + 0x25, 0x4c, 0x6f, 0x61, 0x64, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, + 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x46, 0x0a, 0x0f, 0x63, 0x61, 0x5f, 0x63, 0x65, 0x72, + 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x1d, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, + 0x74, 0x65, 0x2e, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x52, 0x0e, + 0x63, 0x61, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x73, 0x22, 0x28, + 0x0a, 0x26, 0x4c, 0x6f, 0x61, 0x64, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, + 0x65, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x11, 0x0a, 0x0f, 0x46, 0x69, 0x6e, 0x61, + 0x6c, 0x69, 0x7a, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x18, 0x0a, 0x16, 0x47, + 0x65, 0x74, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x73, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x67, 0x0a, 0x17, 0x47, 0x65, 0x74, 0x43, 0x65, 0x72, 0x74, + 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x4c, 0x0a, 0x10, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x5f, + 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x67, 0x6e, 0x6f, + 0x69, 0x2e, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x2e, 0x43, 0x65, + 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x0f, 0x63, + 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x22, 0xe0, + 0x01, 0x0a, 0x0f, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x49, 0x6e, + 0x66, 0x6f, 0x12, 0x25, 0x0a, 0x0e, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, + 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x63, 0x65, 0x72, 0x74, + 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x49, 0x64, 0x12, 0x3f, 0x0a, 0x0b, 0x63, 0x65, 0x72, + 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, + 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, + 0x65, 0x2e, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x52, 0x0b, 0x63, + 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x12, 0x38, 0x0a, 0x09, 0x65, 0x6e, + 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, + 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, + 0x2e, 0x45, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x09, 0x65, 0x6e, 0x64, 0x70, 0x6f, + 0x69, 0x6e, 0x74, 0x73, 0x12, 0x2b, 0x0a, 0x11, 0x6d, 0x6f, 0x64, 0x69, 0x66, 0x69, 0x63, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x10, 0x6d, 0x6f, 0x64, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x69, 0x6d, + 0x65, 0x22, 0x42, 0x0a, 0x19, 0x52, 0x65, 0x76, 0x6f, 0x6b, 0x65, 0x43, 0x65, 0x72, 0x74, 0x69, + 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x25, + 0x0a, 0x0e, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x5f, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0d, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, + 0x61, 0x74, 0x65, 0x49, 0x64, 0x22, 0xc2, 0x01, 0x0a, 0x1a, 0x52, 0x65, 0x76, 0x6f, 0x6b, 0x65, + 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x34, 0x0a, 0x16, 0x72, 0x65, 0x76, 0x6f, 0x6b, 0x65, 0x64, 0x5f, + 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x03, 0x28, 0x09, 0x52, 0x14, 0x72, 0x65, 0x76, 0x6f, 0x6b, 0x65, 0x64, 0x43, 0x65, 0x72, + 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x49, 0x64, 0x12, 0x6e, 0x0a, 0x1c, 0x63, 0x65, + 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x5f, 0x72, 0x65, 0x76, 0x6f, 0x63, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x2c, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, + 0x61, 0x74, 0x65, 0x2e, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x52, + 0x65, 0x76, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x1a, + 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x52, 0x65, 0x76, 0x6f, 0x63, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x22, 0x68, 0x0a, 0x1a, 0x43, 0x65, + 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x52, 0x65, 0x76, 0x6f, 0x63, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x25, 0x0a, 0x0e, 0x63, 0x65, 0x72, 0x74, + 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0d, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x49, 0x64, 0x12, + 0x23, 0x0a, 0x0d, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x4d, 0x65, 0x73, + 0x73, 0x61, 0x67, 0x65, 0x22, 0xb6, 0x01, 0x0a, 0x15, 0x43, 0x61, 0x6e, 0x47, 0x65, 0x6e, 0x65, + 0x72, 0x61, 0x74, 0x65, 0x43, 0x53, 0x52, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x34, + 0x0a, 0x08, 0x6b, 0x65, 0x79, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, + 0x32, 0x19, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, + 0x61, 0x74, 0x65, 0x2e, 0x4b, 0x65, 0x79, 0x54, 0x79, 0x70, 0x65, 0x52, 0x07, 0x6b, 0x65, 0x79, + 0x54, 0x79, 0x70, 0x65, 0x12, 0x4c, 0x0a, 0x10, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, + 0x61, 0x74, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x21, + 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, + 0x65, 0x2e, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x54, 0x79, 0x70, + 0x65, 0x52, 0x0f, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x54, 0x79, + 0x70, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x6b, 0x65, 0x79, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, 0x6b, 0x65, 0x79, 0x53, 0x69, 0x7a, 0x65, 0x22, 0x3b, 0x0a, + 0x16, 0x43, 0x61, 0x6e, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x43, 0x53, 0x52, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x61, 0x6e, 0x5f, 0x67, + 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x63, + 0x61, 0x6e, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x22, 0x66, 0x0a, 0x0b, 0x43, 0x65, + 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x12, 0x35, 0x0a, 0x04, 0x74, 0x79, 0x70, + 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x21, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x63, + 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x2e, 0x43, 0x65, 0x72, 0x74, 0x69, + 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, + 0x12, 0x20, 0x0a, 0x0b, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, + 0x74, 0x65, 0x22, 0x4e, 0x0a, 0x03, 0x43, 0x53, 0x52, 0x12, 0x35, 0x0a, 0x04, 0x74, 0x79, 0x70, + 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x21, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x63, + 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x2e, 0x43, 0x65, 0x72, 0x74, 0x69, + 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, + 0x12, 0x10, 0x0a, 0x03, 0x63, 0x73, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, 0x63, + 0x73, 0x72, 0x22, 0x49, 0x0a, 0x07, 0x4b, 0x65, 0x79, 0x50, 0x61, 0x69, 0x72, 0x12, 0x1f, 0x0a, + 0x0b, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0c, 0x52, 0x0a, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x12, 0x1d, + 0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0c, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x22, 0x9b, 0x01, + 0x0a, 0x08, 0x45, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x33, 0x0a, 0x04, 0x74, 0x79, + 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1f, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, + 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x2e, 0x45, 0x6e, 0x64, 0x70, + 0x6f, 0x69, 0x6e, 0x74, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, + 0x1a, 0x0a, 0x08, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x08, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x22, 0x3e, 0x0a, 0x04, 0x54, + 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x0e, 0x45, 0x50, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, + 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x13, 0x0a, 0x0f, 0x45, 0x50, 0x5f, 0x49, 0x50, + 0x53, 0x45, 0x43, 0x5f, 0x54, 0x55, 0x4e, 0x4e, 0x45, 0x4c, 0x10, 0x01, 0x12, 0x0d, 0x0a, 0x09, + 0x45, 0x50, 0x5f, 0x44, 0x41, 0x45, 0x4d, 0x4f, 0x4e, 0x10, 0x02, 0x2a, 0x2e, 0x0a, 0x0f, 0x43, + 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0e, + 0x0a, 0x0a, 0x43, 0x54, 0x5f, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x0b, + 0x0a, 0x07, 0x43, 0x54, 0x5f, 0x58, 0x35, 0x30, 0x39, 0x10, 0x01, 0x2a, 0x25, 0x0a, 0x07, 0x4b, + 0x65, 0x79, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0e, 0x0a, 0x0a, 0x4b, 0x54, 0x5f, 0x55, 0x4e, 0x4b, + 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x4b, 0x54, 0x5f, 0x52, 0x53, 0x41, + 0x10, 0x01, 0x32, 0xa8, 0x07, 0x0a, 0x15, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, + 0x74, 0x65, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x6a, 0x0a, 0x06, + 0x52, 0x6f, 0x74, 0x61, 0x74, 0x65, 0x12, 0x2a, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x63, 0x65, + 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x2e, 0x52, 0x6f, 0x74, 0x61, 0x74, 0x65, + 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, + 0x69, 0x63, 0x61, 0x74, 0x65, 0x2e, 0x52, 0x6f, 0x74, 0x61, 0x74, 0x65, 0x43, 0x65, 0x72, 0x74, + 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x03, 0x88, 0x02, 0x01, 0x28, 0x01, 0x30, 0x01, 0x12, 0x6d, 0x0a, 0x07, 0x49, 0x6e, 0x73, 0x74, + 0x61, 0x6c, 0x6c, 0x12, 0x2b, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x63, 0x65, 0x72, 0x74, 0x69, + 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x2e, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x43, 0x65, + 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x2c, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, + 0x61, 0x74, 0x65, 0x2e, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x43, 0x65, 0x72, 0x74, 0x69, + 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, + 0x88, 0x02, 0x01, 0x28, 0x01, 0x30, 0x01, 0x12, 0x5f, 0x0a, 0x0b, 0x47, 0x65, 0x6e, 0x65, 0x72, + 0x61, 0x74, 0x65, 0x43, 0x53, 0x52, 0x12, 0x24, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x63, 0x65, + 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x2e, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, + 0x74, 0x65, 0x43, 0x53, 0x52, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x67, + 0x6e, 0x6f, 0x69, 0x2e, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x2e, + 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x43, 0x53, 0x52, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x03, 0x88, 0x02, 0x01, 0x12, 0x6b, 0x0a, 0x0f, 0x4c, 0x6f, 0x61, 0x64, + 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x12, 0x28, 0x2e, 0x67, 0x6e, + 0x6f, 0x69, 0x2e, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x2e, 0x4c, + 0x6f, 0x61, 0x64, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x63, 0x65, 0x72, + 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x2e, 0x4c, 0x6f, 0x61, 0x64, 0x43, 0x65, 0x72, + 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x03, 0x88, 0x02, 0x01, 0x12, 0x98, 0x01, 0x0a, 0x1e, 0x4c, 0x6f, 0x61, 0x64, 0x43, 0x65, + 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, + 0x74, 0x79, 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x12, 0x37, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, + 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x2e, 0x4c, 0x6f, 0x61, 0x64, + 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x41, 0x75, 0x74, 0x68, 0x6f, + 0x72, 0x69, 0x74, 0x79, 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x38, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, + 0x63, 0x61, 0x74, 0x65, 0x2e, 0x4c, 0x6f, 0x61, 0x64, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, + 0x63, 0x61, 0x74, 0x65, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x42, 0x75, 0x6e, + 0x64, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, 0x88, 0x02, 0x01, + 0x12, 0x6b, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, + 0x74, 0x65, 0x73, 0x12, 0x28, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x63, 0x65, 0x72, 0x74, 0x69, + 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, + 0x69, 0x63, 0x61, 0x74, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x29, 0x2e, + 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, + 0x2e, 0x47, 0x65, 0x74, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x73, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, 0x88, 0x02, 0x01, 0x12, 0x74, 0x0a, + 0x12, 0x52, 0x65, 0x76, 0x6f, 0x6b, 0x65, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, + 0x74, 0x65, 0x73, 0x12, 0x2b, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x63, 0x65, 0x72, 0x74, 0x69, + 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x2e, 0x52, 0x65, 0x76, 0x6f, 0x6b, 0x65, 0x43, 0x65, 0x72, + 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x2c, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, + 0x61, 0x74, 0x65, 0x2e, 0x52, 0x65, 0x76, 0x6f, 0x6b, 0x65, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, + 0x69, 0x63, 0x61, 0x74, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, + 0x88, 0x02, 0x01, 0x12, 0x68, 0x0a, 0x0e, 0x43, 0x61, 0x6e, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, + 0x74, 0x65, 0x43, 0x53, 0x52, 0x12, 0x27, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x63, 0x65, 0x72, + 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x2e, 0x43, 0x61, 0x6e, 0x47, 0x65, 0x6e, 0x65, + 0x72, 0x61, 0x74, 0x65, 0x43, 0x53, 0x52, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, + 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, + 0x65, 0x2e, 0x43, 0x61, 0x6e, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x43, 0x53, 0x52, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, 0x88, 0x02, 0x01, 0x42, 0x29, 0xd2, + 0x3e, 0x05, 0x30, 0x2e, 0x32, 0x2e, 0x30, 0x5a, 0x1f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, + 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x67, + 0x6e, 0x6f, 0x69, 0x2f, 0x63, 0x65, 0x72, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_cert_cert_proto_rawDescOnce sync.Once + file_cert_cert_proto_rawDescData = file_cert_cert_proto_rawDesc +) + +func file_cert_cert_proto_rawDescGZIP() []byte { + file_cert_cert_proto_rawDescOnce.Do(func() { + file_cert_cert_proto_rawDescData = protoimpl.X.CompressGZIP(file_cert_cert_proto_rawDescData) + }) + return file_cert_cert_proto_rawDescData +} + +var file_cert_cert_proto_enumTypes = make([]protoimpl.EnumInfo, 3) +var file_cert_cert_proto_msgTypes = make([]protoimpl.MessageInfo, 24) +var file_cert_cert_proto_goTypes = []interface{}{ + (CertificateType)(0), // 0: gnoi.certificate.CertificateType + (KeyType)(0), // 1: gnoi.certificate.KeyType + (Endpoint_Type)(0), // 2: gnoi.certificate.Endpoint.Type + (*RotateCertificateRequest)(nil), // 3: gnoi.certificate.RotateCertificateRequest + (*RotateCertificateResponse)(nil), // 4: gnoi.certificate.RotateCertificateResponse + (*InstallCertificateRequest)(nil), // 5: gnoi.certificate.InstallCertificateRequest + (*InstallCertificateResponse)(nil), // 6: gnoi.certificate.InstallCertificateResponse + (*GenerateCSRRequest)(nil), // 7: gnoi.certificate.GenerateCSRRequest + (*CSRParams)(nil), // 8: gnoi.certificate.CSRParams + (*GenerateCSRResponse)(nil), // 9: gnoi.certificate.GenerateCSRResponse + (*LoadCertificateRequest)(nil), // 10: gnoi.certificate.LoadCertificateRequest + (*LoadCertificateResponse)(nil), // 11: gnoi.certificate.LoadCertificateResponse + (*LoadCertificateAuthorityBundleRequest)(nil), // 12: gnoi.certificate.LoadCertificateAuthorityBundleRequest + (*LoadCertificateAuthorityBundleResponse)(nil), // 13: gnoi.certificate.LoadCertificateAuthorityBundleResponse + (*FinalizeRequest)(nil), // 14: gnoi.certificate.FinalizeRequest + (*GetCertificatesRequest)(nil), // 15: gnoi.certificate.GetCertificatesRequest + (*GetCertificatesResponse)(nil), // 16: gnoi.certificate.GetCertificatesResponse + (*CertificateInfo)(nil), // 17: gnoi.certificate.CertificateInfo + (*RevokeCertificatesRequest)(nil), // 18: gnoi.certificate.RevokeCertificatesRequest + (*RevokeCertificatesResponse)(nil), // 19: gnoi.certificate.RevokeCertificatesResponse + (*CertificateRevocationError)(nil), // 20: gnoi.certificate.CertificateRevocationError + (*CanGenerateCSRRequest)(nil), // 21: gnoi.certificate.CanGenerateCSRRequest + (*CanGenerateCSRResponse)(nil), // 22: gnoi.certificate.CanGenerateCSRResponse + (*Certificate)(nil), // 23: gnoi.certificate.Certificate + (*CSR)(nil), // 24: gnoi.certificate.CSR + (*KeyPair)(nil), // 25: gnoi.certificate.KeyPair + (*Endpoint)(nil), // 26: gnoi.certificate.Endpoint +} +var file_cert_cert_proto_depIdxs = []int32{ + 7, // 0: gnoi.certificate.RotateCertificateRequest.generate_csr:type_name -> gnoi.certificate.GenerateCSRRequest + 10, // 1: gnoi.certificate.RotateCertificateRequest.load_certificate:type_name -> gnoi.certificate.LoadCertificateRequest + 14, // 2: gnoi.certificate.RotateCertificateRequest.finalize_rotation:type_name -> gnoi.certificate.FinalizeRequest + 9, // 3: gnoi.certificate.RotateCertificateResponse.generated_csr:type_name -> gnoi.certificate.GenerateCSRResponse + 11, // 4: gnoi.certificate.RotateCertificateResponse.load_certificate:type_name -> gnoi.certificate.LoadCertificateResponse + 7, // 5: gnoi.certificate.InstallCertificateRequest.generate_csr:type_name -> gnoi.certificate.GenerateCSRRequest + 10, // 6: gnoi.certificate.InstallCertificateRequest.load_certificate:type_name -> gnoi.certificate.LoadCertificateRequest + 9, // 7: gnoi.certificate.InstallCertificateResponse.generated_csr:type_name -> gnoi.certificate.GenerateCSRResponse + 11, // 8: gnoi.certificate.InstallCertificateResponse.load_certificate:type_name -> gnoi.certificate.LoadCertificateResponse + 8, // 9: gnoi.certificate.GenerateCSRRequest.csr_params:type_name -> gnoi.certificate.CSRParams + 0, // 10: gnoi.certificate.CSRParams.type:type_name -> gnoi.certificate.CertificateType + 1, // 11: gnoi.certificate.CSRParams.key_type:type_name -> gnoi.certificate.KeyType + 24, // 12: gnoi.certificate.GenerateCSRResponse.csr:type_name -> gnoi.certificate.CSR + 23, // 13: gnoi.certificate.LoadCertificateRequest.certificate:type_name -> gnoi.certificate.Certificate + 25, // 14: gnoi.certificate.LoadCertificateRequest.key_pair:type_name -> gnoi.certificate.KeyPair + 23, // 15: gnoi.certificate.LoadCertificateRequest.ca_certificates:type_name -> gnoi.certificate.Certificate + 23, // 16: gnoi.certificate.LoadCertificateAuthorityBundleRequest.ca_certificates:type_name -> gnoi.certificate.Certificate + 17, // 17: gnoi.certificate.GetCertificatesResponse.certificate_info:type_name -> gnoi.certificate.CertificateInfo + 23, // 18: gnoi.certificate.CertificateInfo.certificate:type_name -> gnoi.certificate.Certificate + 26, // 19: gnoi.certificate.CertificateInfo.endpoints:type_name -> gnoi.certificate.Endpoint + 20, // 20: gnoi.certificate.RevokeCertificatesResponse.certificate_revocation_error:type_name -> gnoi.certificate.CertificateRevocationError + 1, // 21: gnoi.certificate.CanGenerateCSRRequest.key_type:type_name -> gnoi.certificate.KeyType + 0, // 22: gnoi.certificate.CanGenerateCSRRequest.certificate_type:type_name -> gnoi.certificate.CertificateType + 0, // 23: gnoi.certificate.Certificate.type:type_name -> gnoi.certificate.CertificateType + 0, // 24: gnoi.certificate.CSR.type:type_name -> gnoi.certificate.CertificateType + 2, // 25: gnoi.certificate.Endpoint.type:type_name -> gnoi.certificate.Endpoint.Type + 3, // 26: gnoi.certificate.CertificateManagement.Rotate:input_type -> gnoi.certificate.RotateCertificateRequest + 5, // 27: gnoi.certificate.CertificateManagement.Install:input_type -> gnoi.certificate.InstallCertificateRequest + 7, // 28: gnoi.certificate.CertificateManagement.GenerateCSR:input_type -> gnoi.certificate.GenerateCSRRequest + 10, // 29: gnoi.certificate.CertificateManagement.LoadCertificate:input_type -> gnoi.certificate.LoadCertificateRequest + 12, // 30: gnoi.certificate.CertificateManagement.LoadCertificateAuthorityBundle:input_type -> gnoi.certificate.LoadCertificateAuthorityBundleRequest + 15, // 31: gnoi.certificate.CertificateManagement.GetCertificates:input_type -> gnoi.certificate.GetCertificatesRequest + 18, // 32: gnoi.certificate.CertificateManagement.RevokeCertificates:input_type -> gnoi.certificate.RevokeCertificatesRequest + 21, // 33: gnoi.certificate.CertificateManagement.CanGenerateCSR:input_type -> gnoi.certificate.CanGenerateCSRRequest + 4, // 34: gnoi.certificate.CertificateManagement.Rotate:output_type -> gnoi.certificate.RotateCertificateResponse + 6, // 35: gnoi.certificate.CertificateManagement.Install:output_type -> gnoi.certificate.InstallCertificateResponse + 9, // 36: gnoi.certificate.CertificateManagement.GenerateCSR:output_type -> gnoi.certificate.GenerateCSRResponse + 11, // 37: gnoi.certificate.CertificateManagement.LoadCertificate:output_type -> gnoi.certificate.LoadCertificateResponse + 13, // 38: gnoi.certificate.CertificateManagement.LoadCertificateAuthorityBundle:output_type -> gnoi.certificate.LoadCertificateAuthorityBundleResponse + 16, // 39: gnoi.certificate.CertificateManagement.GetCertificates:output_type -> gnoi.certificate.GetCertificatesResponse + 19, // 40: gnoi.certificate.CertificateManagement.RevokeCertificates:output_type -> gnoi.certificate.RevokeCertificatesResponse + 22, // 41: gnoi.certificate.CertificateManagement.CanGenerateCSR:output_type -> gnoi.certificate.CanGenerateCSRResponse + 34, // [34:42] is the sub-list for method output_type + 26, // [26:34] is the sub-list for method input_type + 26, // [26:26] is the sub-list for extension type_name + 26, // [26:26] is the sub-list for extension extendee + 0, // [0:26] is the sub-list for field type_name +} + +func init() { file_cert_cert_proto_init() } +func file_cert_cert_proto_init() { + if File_cert_cert_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_cert_cert_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RotateCertificateRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cert_cert_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RotateCertificateResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cert_cert_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*InstallCertificateRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cert_cert_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*InstallCertificateResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cert_cert_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GenerateCSRRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cert_cert_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CSRParams); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cert_cert_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GenerateCSRResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cert_cert_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LoadCertificateRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cert_cert_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LoadCertificateResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cert_cert_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LoadCertificateAuthorityBundleRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cert_cert_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LoadCertificateAuthorityBundleResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cert_cert_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FinalizeRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cert_cert_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetCertificatesRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cert_cert_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetCertificatesResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cert_cert_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CertificateInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cert_cert_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RevokeCertificatesRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cert_cert_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RevokeCertificatesResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cert_cert_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CertificateRevocationError); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cert_cert_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CanGenerateCSRRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cert_cert_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CanGenerateCSRResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cert_cert_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Certificate); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cert_cert_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CSR); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cert_cert_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*KeyPair); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cert_cert_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Endpoint); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_cert_cert_proto_msgTypes[0].OneofWrappers = []interface{}{ + (*RotateCertificateRequest_GenerateCsr)(nil), + (*RotateCertificateRequest_LoadCertificate)(nil), + (*RotateCertificateRequest_FinalizeRotation)(nil), + } + file_cert_cert_proto_msgTypes[1].OneofWrappers = []interface{}{ + (*RotateCertificateResponse_GeneratedCsr)(nil), + (*RotateCertificateResponse_LoadCertificate)(nil), + } + file_cert_cert_proto_msgTypes[2].OneofWrappers = []interface{}{ + (*InstallCertificateRequest_GenerateCsr)(nil), + (*InstallCertificateRequest_LoadCertificate)(nil), + } + file_cert_cert_proto_msgTypes[3].OneofWrappers = []interface{}{ + (*InstallCertificateResponse_GeneratedCsr)(nil), + (*InstallCertificateResponse_LoadCertificate)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_cert_cert_proto_rawDesc, + NumEnums: 3, + NumMessages: 24, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_cert_cert_proto_goTypes, + DependencyIndexes: file_cert_cert_proto_depIdxs, + EnumInfos: file_cert_cert_proto_enumTypes, + MessageInfos: file_cert_cert_proto_msgTypes, + }.Build() + File_cert_cert_proto = out.File + file_cert_cert_proto_rawDesc = nil + file_cert_cert_proto_goTypes = nil + file_cert_cert_proto_depIdxs = nil +} diff --git a/src/sonic-framework/gnoi/cert/cert.proto b/src/sonic-framework/gnoi/cert/cert.proto new file mode 100644 index 000000000000..3249d3a07b63 --- /dev/null +++ b/src/sonic-framework/gnoi/cert/cert.proto @@ -0,0 +1,466 @@ +// +// Copyright 2017 Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// DEPRECATION NOTICE: This API will be removed as it has been replaced via +// gNSI Certz service. This will be removed in the v1 release of the gNOI API. +// +// This file defines the gNOI API to be used for certificate installation and +// rotation. +syntax = "proto3"; + +package gnoi.certificate; + +import "github.com/openconfig/gnoi/types/types.proto"; + +option go_package = "github.com/openconfig/gnoi/cert"; + +option (types.gnoi_version) = "0.2.0"; + +// The Certificate Management Service exported by targets. +// +// The service primarily exports two main RPCs, Install & Rotate which are used +// for installation of a new certificate, and rotation of an existing +// certificate on a target, along with a few management related RPCs. +// +// In addition, the actions from the Install and Rotate RPCs are made available +// as separate RPCs. These use the same request/response protos. +service CertificateManagement { + + // Rotate will replace an existing Certificate on the target by creating a + // new CSR request and placing the new Certificate based on the CSR on the + // target. If the stream is broken or any steps in the process fail the + // target must rollback to the original Certificate. + // + // The following describes the sequence of messages that must be exchanged + // in the Rotate() RPC. + // + // Sequence of expected messages: + // Case 1: When Target generates the CSR. + // + // Step 1: Start the stream + // Client <---- Rotate() RPC stream begin ------> Target + // + // Step 2: CSR + // Client -----> GenerateCSRRequest----> Target + // Client <----- GenerateCSRResponse <--- Target + // + // Step 3: Certificate Signing + // Client gets the certificate signed by the CA. + // + // Step 4: Send Certificate to Target. + // Client --> LoadCertificateRequest ----> Target + // Client <-- LoadCertificateResponse <--- Target + // + // Step 5: Test/Validation by the client. + // This step should be to create a new connection to the target using + // The new certificate and validate that the certificate works. + // Once verfied, the client will then proceed to finalize the rotation. + // If the new connection cannot be completed the client will cancel the + // RPC thereby forcing the target to rollback the certificate. + // + // Step 6: Final commit. + // Client ---> FinalizeRequest ----> Target + // + // + // Case 2: When Client generates the CSR. + // Step 1: Start the stream + // Client <---- Rotate() RPC stream begin ----> Target + // + // Step 2: CSR + // Client generates its own certificate. + // + // Step 3: Certificate Signing + // Client gets the certificate signed by the CA. + // + // Step 4: Send Certificate to Target. + // Client ---> LoadCertificateRequest ----> Target + // Client <--- LoadCertificateResponse <--- Target + // + // Step 5: Test/Validation by the client. + // + // Step 6: Final commit. + // Client ---> FinalizeRequest ----> Target + rpc Rotate(stream RotateCertificateRequest) + returns (stream RotateCertificateResponse) { + option deprecated = true; + }; + + // Install will put a new Certificate on the target by creating a new CSR + // request and placing the new Certificate based on the CSR on the target.The + // new Certificate will be associated with a new Certificate Id on the target. + // If the target has a pre existing Certificate with the given Certificate Id, + // the operation should fail. + // If the stream is broken or any steps in the process fail the target must + // revert any changes in state. + // + // The following describes the sequence of messages that must be exchanged + // in the Install() RPC. + // + // Sequence of expected messages: + // Case 1: When Target generates the CSR-------------------------: + // + // Step 1: Start the stream + // Client <---- Install() RPC stream begin ------> Target + // + // Step 2: CSR + // Client -----> GenerateCSRRequest() ----> Target + // Client <---- GenerateCSRResponse() <---- Target + // + // Step 3: Certificate Signing + // Client gets the certificate signed by the CA. + // + // Step 4: Send Certificate to Target. + // Client -> LoadCertificateRequest() ----> Target + // Client <- LoadCertificateResponse() <--- Target + // + // Case 2: When Client generates the CSR-------------------------: + // Step 1: Start the stream + // Client <---- Install() RPC stream begin ------> Target + // + // Step 2: CSR + // Client generates its own certificate. + // + // Step 3: Certificate Signing + // Client gets the certificate signed by the CA. + // + // Step 4: Send Certificate to Target. + // Client -> LoadCertificateRequest() ----> Target + // Client <- LoadCertificateResponse() <--- Target + // + rpc Install(stream InstallCertificateRequest) + returns (stream InstallCertificateResponse) { + option deprecated = true; + }; + + // When credentials are generated on the device, generates a keypair and + // returns the Certificate Signing Request (CSR). The CSR has the public key, + // which when signed by the CA, becomes the Certificate. + rpc GenerateCSR(GenerateCSRRequest) returns (GenerateCSRResponse) { + option deprecated = true; + }; + + // Loads a certificate signed by a Certificate Authority (CA). + rpc LoadCertificate(LoadCertificateRequest) + returns (LoadCertificateResponse) { + option deprecated = true; + }; + + // Loads a bundle of CA certificates. + rpc LoadCertificateAuthorityBundle(LoadCertificateAuthorityBundleRequest) + returns (LoadCertificateAuthorityBundleResponse) { + option deprecated = true; + }; + + // An RPC to get the certificates on the target. + rpc GetCertificates(GetCertificatesRequest) + returns (GetCertificatesResponse) { + option deprecated = true; + }; + + // An RPC to revoke specific certificates. + // If a certificate is not present on the target, the request should silently + // succeed. Revoking a certificate should render the existing certificate + // unusable by any endpoints. + rpc RevokeCertificates(RevokeCertificatesRequest) + returns (RevokeCertificatesResponse) { + option deprecated = true; + }; + + // An RPC to ask a target if it can generate a Certificate. + rpc CanGenerateCSR(CanGenerateCSRRequest) returns (CanGenerateCSRResponse) { + option deprecated = true; + }; +} + +// Request messages to rotate existing certificates on the target. +message RotateCertificateRequest { + // Request Messages. + oneof rotate_request { + GenerateCSRRequest generate_csr = 1; + LoadCertificateRequest load_certificate = 2; + FinalizeRequest finalize_rotation = 3; + } +} + +// Response Messages from the target. +message RotateCertificateResponse { + // Response messages. + oneof rotate_response { + GenerateCSRResponse generated_csr = 1; + LoadCertificateResponse load_certificate = 2; + } +} + +// Request messages to install new certificates on the target. +message InstallCertificateRequest { + // Request Messages. + oneof install_request { + GenerateCSRRequest generate_csr = 1; + LoadCertificateRequest load_certificate = 2; + } +} + +// Response Messages from the target for the InstallCertificateRequest. +message InstallCertificateResponse { + // Response messages. + oneof install_response { + GenerateCSRResponse generated_csr = 1; + LoadCertificateResponse load_certificate = 2; + } +} + +// Request to generate the CSR. +// When this request is made for rotating an existing certificate as part of the +// Rotate() RPC, then the target must ensure that the "certificate_id" is +// already created and exists on the target. If the Certificate Rotation +// proceeds to load the certificate, it must associate the new certificate with +// the previously created "certificate_id". +// +// When this request is made for installing a completely new certificate as part +// of the Install() RPC , then the target must ensure that the "certificate_id" +// is completely new and no entities on the target are should be bound to this +// certificate_id. If any existing certificate matches the certificate_id, then +// this request should fail. +// +// If there is another ongoing Rotate/Install RPC with the same certificate_id, +// the GenerateCSRRequest should fail. +message GenerateCSRRequest { + // Parameters for creating a CSR. + CSRParams csr_params = 1; + // The certificate id with which this CSR will be associated. The target + // configuration should bind an entity which wants to use a certificate to + // the certificate_id it should use. + string certificate_id = 2; +} + +// Parameters to be used when generating a Certificate Signing Request. +message CSRParams { + // The type of certificate which will be associated for this CSR. + CertificateType type = 1; + + // Minimum size of the key to be used by the target when generating a + // public/private key pair. + uint32 min_key_size = 2; + + // If provided, the target must use the provided key type. If the target + // cannot use the algorithm specified in the key_type, it should cancel the + // stream with an Unimplemented error. + KeyType key_type = 3; + + // --- common set of parameters applicable for any type of certificate --- // + string common_name = 4; // e.g "device.corp.google.com" + string country = 5; // e.g "US" + string state = 6; // e.g "CA" + string city = 7; // e.g "Mountain View" + string organization = 8; // e.g "Google" + string organizational_unit = 9; // e.g "Security" + string ip_address = 10; + string email_id = 11; + + // TODO(lokagarw): Define a way to add any other parameters/extensions to be + // used for generating the CSR depending upon the type of certificate being + // requested. +} + +// GenerateCSRResponse contains the CSR associated with the Certificate ID +// supplied in the GenerateCSRRequest. When a Certificate is subsequently +// installed on the target in the same streaming RPC session, it must be +// associated to that Certificate ID. +// +// An Unimplemented error will be returned if the target cannot generate a CSR +// as per the request. In this case, the caller must generate its own key pair. +message GenerateCSRResponse { + CSR csr = 1; +} + +// LoadCertificateRequest instructs the target to store the given certificate. +// +// Case 1: Target Generated CSR and Key Pair. +// If the target generated the CSR (and the public/private key pair) during the +// GenerateCSR request, then the target must associate the certificate with the +// certificate ID specified in the preceding GenerateCSR request. +// +// Case 2: Externally Generated Key Pair. +// If the target can not generate a CSR, then the public/private key pair is +// generated externally. In this case provide the target with the key pair, +// and the certificate_id to be associated with the new certificate. +// +// If there is another ongoing Rotate/Install RPC with the same certificate_id, +// the LoadCertificateRequest must fail. +message LoadCertificateRequest { + // The certificate to be Loaded on the target. + Certificate certificate = 1; + + // The key pair to be used with the certificate. This is provided in the event + // that the target cannot generate a CSR (and the corresponding public/private + // keys). + KeyPair key_pair = 2; + + // Certificate Id of the above certificate. This is to be provided only when + // there is an externally generated key pair. + string certificate_id = 3; + + // Optional bundle of CA certificates. When not empty, the provided + // certificates should squash the existing bundle. This field provides a + // simplified means to provision a CA bundle that can be used to validate + // other peer's certificates. + // To improve performance in the Target, certificates can be ordered. + // Groups of chained certificates should be last, where within, the root + // certificate is the last one. E.g.: + // CertA, CertB, CertB-Root, CertC, CertC-Intermediate, CertC-Root + repeated Certificate ca_certificates = 4; +} + +// Response from target after Loading a Certificate. +// If the target could not load the certificate, it must end the RPC stream with +// a suitable RPC error about why the Certificate was not loaded. +message LoadCertificateResponse { +} + +// Bundle of CA certificates. Same as LoadCertificateRequest::ca_certificates. +message LoadCertificateAuthorityBundleRequest { + // Squashes the existing certificate bundle. + // To improve performance in the Target, certificates can be ordered. + // Groups of chained certificates should be last, where within, the root + // certificate is the last one. E.g.: + // CertA, CertB, CertB-Root, CertC, CertC-Intermediate, CertC-Root + repeated Certificate ca_certificates = 1; +} + +// Response from target after Loading a certificate authority bundle. +// If the target could not load the certificates, it must end the RPC stream +// with a suitable RPC error about why the Certificate was not loaded. +message LoadCertificateAuthorityBundleResponse { +} + +// A Finalize message is sent to the target to confirm the Rotation of +// the certificate and that the certificate should not be rolled back when +// the RPC concludes. The certificate must be rolled back if the target returns +// an error after receiving a Finalize message. +message FinalizeRequest { +} + +// The request to query all the certificates on the target. +message GetCertificatesRequest { +} + +// Response from the target about the certificates that exist on the target what +// what is using them. +message GetCertificatesResponse { + repeated CertificateInfo certificate_info = 1; +} + +message CertificateInfo { + string certificate_id = 1; + Certificate certificate = 2; + + // List of endpoints using this certificate. + repeated Endpoint endpoints = 3; + + // System modification time when the certificate was installed/rotated in + // nanoseconds since epoch. + int64 modification_time = 4; +} + +message RevokeCertificatesRequest { + // Certificates to revoke. + repeated string certificate_id = 1; +} + +message RevokeCertificatesResponse { + // List of certificates successfully revoked. + repeated string revoked_certificate_id = 1; + + // List of errors why certain certificates could not be revoked. + repeated CertificateRevocationError certificate_revocation_error = 2; +} + +// An error message indicating why a certificate id could not be revoked. +message CertificateRevocationError { + string certificate_id = 1; + string error_message = 2; +} + +// A request to ask the target if it can generate key pairs. +message CanGenerateCSRRequest { + KeyType key_type = 1; + CertificateType certificate_type = 2; + uint32 key_size = 3; +} + +// Response from the target about whether it can generate a CSR with the given +// parameters. +message CanGenerateCSRResponse { + bool can_generate = 4; +} + +// Types of certificates. +enum CertificateType { + // 1 - 500 for public use. + // 501 onwards for private use. + CT_UNKNOWN = 0; + CT_X509 = 1; +} + +// A certificate. +message Certificate { + // Type of certificate. + CertificateType type = 1; + + // Actual certificate. + // The exact encoding depends upon the type of certificate. + // for X509, this should be a PEM encoded Certificate. + bytes certificate = 2; +} + +// A Certificate Signing Request. +message CSR { + // Type of certificate. + CertificateType type = 1; + + // Bytes representing the CSR. + // The exact encoding depends upon the type of certificate requested. + // for X509: This should be the PEM encoded CSR. + bytes csr = 2; +} + +// A message representing a pair of public/private keys. +message KeyPair { + bytes private_key = 1; + bytes public_key = 2; +} + +// Algorithm to be used for generation the key pair. +enum KeyType { + // 1 - 500, for known types. + // 501 and onwards for private use. + KT_UNKNOWN = 0; + KT_RSA = 1; +} + +// An endpoint represents an entity on the target which can use a certificate. +message Endpoint { + // Type of endpoint that can use a cert. This list is to be extended based on + // conversation with vendors. + enum Type { + EP_UNSPECIFIED = 0; + EP_IPSEC_TUNNEL = 1; + EP_DAEMON = 2; + } + Type type = 1; + + // Human readable identifier for an endpoint. + string endpoint = 2; +} diff --git a/src/sonic-framework/gnoi/cert/cert_grpc.pb.go b/src/sonic-framework/gnoi/cert/cert_grpc.pb.go new file mode 100755 index 000000000000..a72031b3fecb --- /dev/null +++ b/src/sonic-framework/gnoi/cert/cert_grpc.pb.go @@ -0,0 +1,446 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.2.0 +// - protoc v3.21.10 +// source: cert/cert.proto + +package cert + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +// CertificateManagementClient is the client API for CertificateManagement service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type CertificateManagementClient interface { + // Deprecated: Do not use. + Rotate(ctx context.Context, opts ...grpc.CallOption) (CertificateManagement_RotateClient, error) + // Deprecated: Do not use. + Install(ctx context.Context, opts ...grpc.CallOption) (CertificateManagement_InstallClient, error) + // Deprecated: Do not use. + GenerateCSR(ctx context.Context, in *GenerateCSRRequest, opts ...grpc.CallOption) (*GenerateCSRResponse, error) + // Deprecated: Do not use. + LoadCertificate(ctx context.Context, in *LoadCertificateRequest, opts ...grpc.CallOption) (*LoadCertificateResponse, error) + // Deprecated: Do not use. + LoadCertificateAuthorityBundle(ctx context.Context, in *LoadCertificateAuthorityBundleRequest, opts ...grpc.CallOption) (*LoadCertificateAuthorityBundleResponse, error) + // Deprecated: Do not use. + GetCertificates(ctx context.Context, in *GetCertificatesRequest, opts ...grpc.CallOption) (*GetCertificatesResponse, error) + // Deprecated: Do not use. + RevokeCertificates(ctx context.Context, in *RevokeCertificatesRequest, opts ...grpc.CallOption) (*RevokeCertificatesResponse, error) + // Deprecated: Do not use. + CanGenerateCSR(ctx context.Context, in *CanGenerateCSRRequest, opts ...grpc.CallOption) (*CanGenerateCSRResponse, error) +} + +type certificateManagementClient struct { + cc grpc.ClientConnInterface +} + +func NewCertificateManagementClient(cc grpc.ClientConnInterface) CertificateManagementClient { + return &certificateManagementClient{cc} +} + +// Deprecated: Do not use. +func (c *certificateManagementClient) Rotate(ctx context.Context, opts ...grpc.CallOption) (CertificateManagement_RotateClient, error) { + stream, err := c.cc.NewStream(ctx, &CertificateManagement_ServiceDesc.Streams[0], "/gnoi.certificate.CertificateManagement/Rotate", opts...) + if err != nil { + return nil, err + } + x := &certificateManagementRotateClient{stream} + return x, nil +} + +type CertificateManagement_RotateClient interface { + Send(*RotateCertificateRequest) error + Recv() (*RotateCertificateResponse, error) + grpc.ClientStream +} + +type certificateManagementRotateClient struct { + grpc.ClientStream +} + +func (x *certificateManagementRotateClient) Send(m *RotateCertificateRequest) error { + return x.ClientStream.SendMsg(m) +} + +func (x *certificateManagementRotateClient) Recv() (*RotateCertificateResponse, error) { + m := new(RotateCertificateResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +// Deprecated: Do not use. +func (c *certificateManagementClient) Install(ctx context.Context, opts ...grpc.CallOption) (CertificateManagement_InstallClient, error) { + stream, err := c.cc.NewStream(ctx, &CertificateManagement_ServiceDesc.Streams[1], "/gnoi.certificate.CertificateManagement/Install", opts...) + if err != nil { + return nil, err + } + x := &certificateManagementInstallClient{stream} + return x, nil +} + +type CertificateManagement_InstallClient interface { + Send(*InstallCertificateRequest) error + Recv() (*InstallCertificateResponse, error) + grpc.ClientStream +} + +type certificateManagementInstallClient struct { + grpc.ClientStream +} + +func (x *certificateManagementInstallClient) Send(m *InstallCertificateRequest) error { + return x.ClientStream.SendMsg(m) +} + +func (x *certificateManagementInstallClient) Recv() (*InstallCertificateResponse, error) { + m := new(InstallCertificateResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +// Deprecated: Do not use. +func (c *certificateManagementClient) GenerateCSR(ctx context.Context, in *GenerateCSRRequest, opts ...grpc.CallOption) (*GenerateCSRResponse, error) { + out := new(GenerateCSRResponse) + err := c.cc.Invoke(ctx, "/gnoi.certificate.CertificateManagement/GenerateCSR", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Deprecated: Do not use. +func (c *certificateManagementClient) LoadCertificate(ctx context.Context, in *LoadCertificateRequest, opts ...grpc.CallOption) (*LoadCertificateResponse, error) { + out := new(LoadCertificateResponse) + err := c.cc.Invoke(ctx, "/gnoi.certificate.CertificateManagement/LoadCertificate", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Deprecated: Do not use. +func (c *certificateManagementClient) LoadCertificateAuthorityBundle(ctx context.Context, in *LoadCertificateAuthorityBundleRequest, opts ...grpc.CallOption) (*LoadCertificateAuthorityBundleResponse, error) { + out := new(LoadCertificateAuthorityBundleResponse) + err := c.cc.Invoke(ctx, "/gnoi.certificate.CertificateManagement/LoadCertificateAuthorityBundle", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Deprecated: Do not use. +func (c *certificateManagementClient) GetCertificates(ctx context.Context, in *GetCertificatesRequest, opts ...grpc.CallOption) (*GetCertificatesResponse, error) { + out := new(GetCertificatesResponse) + err := c.cc.Invoke(ctx, "/gnoi.certificate.CertificateManagement/GetCertificates", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Deprecated: Do not use. +func (c *certificateManagementClient) RevokeCertificates(ctx context.Context, in *RevokeCertificatesRequest, opts ...grpc.CallOption) (*RevokeCertificatesResponse, error) { + out := new(RevokeCertificatesResponse) + err := c.cc.Invoke(ctx, "/gnoi.certificate.CertificateManagement/RevokeCertificates", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Deprecated: Do not use. +func (c *certificateManagementClient) CanGenerateCSR(ctx context.Context, in *CanGenerateCSRRequest, opts ...grpc.CallOption) (*CanGenerateCSRResponse, error) { + out := new(CanGenerateCSRResponse) + err := c.cc.Invoke(ctx, "/gnoi.certificate.CertificateManagement/CanGenerateCSR", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// CertificateManagementServer is the server API for CertificateManagement service. +// All implementations must embed UnimplementedCertificateManagementServer +// for forward compatibility +type CertificateManagementServer interface { + // Deprecated: Do not use. + Rotate(CertificateManagement_RotateServer) error + // Deprecated: Do not use. + Install(CertificateManagement_InstallServer) error + // Deprecated: Do not use. + GenerateCSR(context.Context, *GenerateCSRRequest) (*GenerateCSRResponse, error) + // Deprecated: Do not use. + LoadCertificate(context.Context, *LoadCertificateRequest) (*LoadCertificateResponse, error) + // Deprecated: Do not use. + LoadCertificateAuthorityBundle(context.Context, *LoadCertificateAuthorityBundleRequest) (*LoadCertificateAuthorityBundleResponse, error) + // Deprecated: Do not use. + GetCertificates(context.Context, *GetCertificatesRequest) (*GetCertificatesResponse, error) + // Deprecated: Do not use. + RevokeCertificates(context.Context, *RevokeCertificatesRequest) (*RevokeCertificatesResponse, error) + // Deprecated: Do not use. + CanGenerateCSR(context.Context, *CanGenerateCSRRequest) (*CanGenerateCSRResponse, error) + mustEmbedUnimplementedCertificateManagementServer() +} + +// UnimplementedCertificateManagementServer must be embedded to have forward compatible implementations. +type UnimplementedCertificateManagementServer struct { +} + +func (UnimplementedCertificateManagementServer) Rotate(CertificateManagement_RotateServer) error { + return status.Errorf(codes.Unimplemented, "method Rotate not implemented") +} +func (UnimplementedCertificateManagementServer) Install(CertificateManagement_InstallServer) error { + return status.Errorf(codes.Unimplemented, "method Install not implemented") +} +func (UnimplementedCertificateManagementServer) GenerateCSR(context.Context, *GenerateCSRRequest) (*GenerateCSRResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GenerateCSR not implemented") +} +func (UnimplementedCertificateManagementServer) LoadCertificate(context.Context, *LoadCertificateRequest) (*LoadCertificateResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method LoadCertificate not implemented") +} +func (UnimplementedCertificateManagementServer) LoadCertificateAuthorityBundle(context.Context, *LoadCertificateAuthorityBundleRequest) (*LoadCertificateAuthorityBundleResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method LoadCertificateAuthorityBundle not implemented") +} +func (UnimplementedCertificateManagementServer) GetCertificates(context.Context, *GetCertificatesRequest) (*GetCertificatesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetCertificates not implemented") +} +func (UnimplementedCertificateManagementServer) RevokeCertificates(context.Context, *RevokeCertificatesRequest) (*RevokeCertificatesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method RevokeCertificates not implemented") +} +func (UnimplementedCertificateManagementServer) CanGenerateCSR(context.Context, *CanGenerateCSRRequest) (*CanGenerateCSRResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CanGenerateCSR not implemented") +} +func (UnimplementedCertificateManagementServer) mustEmbedUnimplementedCertificateManagementServer() {} + +// UnsafeCertificateManagementServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to CertificateManagementServer will +// result in compilation errors. +type UnsafeCertificateManagementServer interface { + mustEmbedUnimplementedCertificateManagementServer() +} + +func RegisterCertificateManagementServer(s grpc.ServiceRegistrar, srv CertificateManagementServer) { + s.RegisterService(&CertificateManagement_ServiceDesc, srv) +} + +func _CertificateManagement_Rotate_Handler(srv interface{}, stream grpc.ServerStream) error { + return srv.(CertificateManagementServer).Rotate(&certificateManagementRotateServer{stream}) +} + +type CertificateManagement_RotateServer interface { + Send(*RotateCertificateResponse) error + Recv() (*RotateCertificateRequest, error) + grpc.ServerStream +} + +type certificateManagementRotateServer struct { + grpc.ServerStream +} + +func (x *certificateManagementRotateServer) Send(m *RotateCertificateResponse) error { + return x.ServerStream.SendMsg(m) +} + +func (x *certificateManagementRotateServer) Recv() (*RotateCertificateRequest, error) { + m := new(RotateCertificateRequest) + if err := x.ServerStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func _CertificateManagement_Install_Handler(srv interface{}, stream grpc.ServerStream) error { + return srv.(CertificateManagementServer).Install(&certificateManagementInstallServer{stream}) +} + +type CertificateManagement_InstallServer interface { + Send(*InstallCertificateResponse) error + Recv() (*InstallCertificateRequest, error) + grpc.ServerStream +} + +type certificateManagementInstallServer struct { + grpc.ServerStream +} + +func (x *certificateManagementInstallServer) Send(m *InstallCertificateResponse) error { + return x.ServerStream.SendMsg(m) +} + +func (x *certificateManagementInstallServer) Recv() (*InstallCertificateRequest, error) { + m := new(InstallCertificateRequest) + if err := x.ServerStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func _CertificateManagement_GenerateCSR_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GenerateCSRRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(CertificateManagementServer).GenerateCSR(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/gnoi.certificate.CertificateManagement/GenerateCSR", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(CertificateManagementServer).GenerateCSR(ctx, req.(*GenerateCSRRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _CertificateManagement_LoadCertificate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(LoadCertificateRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(CertificateManagementServer).LoadCertificate(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/gnoi.certificate.CertificateManagement/LoadCertificate", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(CertificateManagementServer).LoadCertificate(ctx, req.(*LoadCertificateRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _CertificateManagement_LoadCertificateAuthorityBundle_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(LoadCertificateAuthorityBundleRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(CertificateManagementServer).LoadCertificateAuthorityBundle(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/gnoi.certificate.CertificateManagement/LoadCertificateAuthorityBundle", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(CertificateManagementServer).LoadCertificateAuthorityBundle(ctx, req.(*LoadCertificateAuthorityBundleRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _CertificateManagement_GetCertificates_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetCertificatesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(CertificateManagementServer).GetCertificates(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/gnoi.certificate.CertificateManagement/GetCertificates", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(CertificateManagementServer).GetCertificates(ctx, req.(*GetCertificatesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _CertificateManagement_RevokeCertificates_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(RevokeCertificatesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(CertificateManagementServer).RevokeCertificates(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/gnoi.certificate.CertificateManagement/RevokeCertificates", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(CertificateManagementServer).RevokeCertificates(ctx, req.(*RevokeCertificatesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _CertificateManagement_CanGenerateCSR_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CanGenerateCSRRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(CertificateManagementServer).CanGenerateCSR(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/gnoi.certificate.CertificateManagement/CanGenerateCSR", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(CertificateManagementServer).CanGenerateCSR(ctx, req.(*CanGenerateCSRRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// CertificateManagement_ServiceDesc is the grpc.ServiceDesc for CertificateManagement service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var CertificateManagement_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "gnoi.certificate.CertificateManagement", + HandlerType: (*CertificateManagementServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "GenerateCSR", + Handler: _CertificateManagement_GenerateCSR_Handler, + }, + { + MethodName: "LoadCertificate", + Handler: _CertificateManagement_LoadCertificate_Handler, + }, + { + MethodName: "LoadCertificateAuthorityBundle", + Handler: _CertificateManagement_LoadCertificateAuthorityBundle_Handler, + }, + { + MethodName: "GetCertificates", + Handler: _CertificateManagement_GetCertificates_Handler, + }, + { + MethodName: "RevokeCertificates", + Handler: _CertificateManagement_RevokeCertificates_Handler, + }, + { + MethodName: "CanGenerateCSR", + Handler: _CertificateManagement_CanGenerateCSR_Handler, + }, + }, + Streams: []grpc.StreamDesc{ + { + StreamName: "Rotate", + Handler: _CertificateManagement_Rotate_Handler, + ServerStreams: true, + ClientStreams: true, + }, + { + StreamName: "Install", + Handler: _CertificateManagement_Install_Handler, + ServerStreams: true, + ClientStreams: true, + }, + }, + Metadata: "cert/cert.proto", +} diff --git a/src/sonic-framework/gnoi/common.bzl b/src/sonic-framework/gnoi/common.bzl new file mode 100644 index 000000000000..b40ec14a1382 --- /dev/null +++ b/src/sonic-framework/gnoi/common.bzl @@ -0,0 +1,29 @@ +load("@io_bazel_rules_go//proto:compiler.bzl", "go_proto_compiler") +load("@io_bazel_rules_go//proto/wkt:well_known_types.bzl", "PROTO_RUNTIME_DEPS", "WELL_KNOWN_TYPES_APIV2") + +def use_new_compilers(): + go_proto_compiler( + name = "go_protoc_gen_go", + options = [ + "paths=source_relative", + ], + plugin = "@org_golang_google_protobuf//cmd/protoc-gen-go", + suffix = ".pb.go", + visibility = ["//visibility:public"], + deps = PROTO_RUNTIME_DEPS + WELL_KNOWN_TYPES_APIV2, + ) + go_proto_compiler( + name = "go_protoc_gen_go_grpc", + options = [ + "paths=source_relative", + ], + plugin = "@org_golang_google_grpc_cmd_protoc_gen_go_grpc//:protoc-gen-go-grpc", + suffix = "_grpc.pb.go", + visibility = ["//visibility:public"], + deps = PROTO_RUNTIME_DEPS + [ + "@org_golang_google_grpc//:go_default_library", + "@org_golang_google_grpc//codes:go_default_library", + "@org_golang_google_grpc//status:go_default_library", + ], + ) + diff --git a/src/sonic-framework/gnoi/common/BUILD.bazel b/src/sonic-framework/gnoi/common/BUILD.bazel new file mode 100644 index 000000000000..13e56a8f8943 --- /dev/null +++ b/src/sonic-framework/gnoi/common/BUILD.bazel @@ -0,0 +1,55 @@ +load("@rules_proto//proto:defs.bzl", "proto_library") +load("@io_bazel_rules_go//go:def.bzl", "go_library") +load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library") +load("@com_github_grpc_grpc//bazel:cc_grpc_library.bzl", "cc_grpc_library") +load("//:common.bzl", "use_new_compilers") + +# Copyright 2021 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +package( + default_visibility = ["//visibility:public"], + licenses = ["notice"], +) + +use_new_compilers() + +proto_library( + name = "common_proto", + srcs = ["common.proto"], + import_prefix = "github.com/openconfig/gnoi", + deps = ["//types:types_proto"], +) + +cc_proto_library( + name = "common_cc_proto", + deps = [":common_proto"], +) + +go_proto_library( + name = "common_go_proto", + compilers = [ + "go_protoc_gen_go", + "go_protoc_gen_go_grpc", + ], + importpath = "github.com/openconfig/gnoi/common", + proto = ":common_proto", + deps = ["//types"], +) + +go_library( + name = "common", + embed = [":common_go_proto"], + importpath = "github.com/openconfig/gnoi/common", +) diff --git a/src/sonic-framework/gnoi/common/common.pb.go b/src/sonic-framework/gnoi/common/common.pb.go new file mode 100644 index 000000000000..76daf84fca81 --- /dev/null +++ b/src/sonic-framework/gnoi/common/common.pb.go @@ -0,0 +1,259 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.30.0 +// protoc v3.21.10 +// source: github.com/openconfig/gnoi/common/common.proto + +package common + +import ( + types "github.com/openconfig/gnoi/types" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type RemoteDownload_Protocol int32 + +const ( + RemoteDownload_UNKNOWN RemoteDownload_Protocol = 0 + RemoteDownload_SFTP RemoteDownload_Protocol = 1 + RemoteDownload_HTTP RemoteDownload_Protocol = 2 + RemoteDownload_HTTPS RemoteDownload_Protocol = 3 + RemoteDownload_SCP RemoteDownload_Protocol = 4 +) + +// Enum value maps for RemoteDownload_Protocol. +var ( + RemoteDownload_Protocol_name = map[int32]string{ + 0: "UNKNOWN", + 1: "SFTP", + 2: "HTTP", + 3: "HTTPS", + 4: "SCP", + } + RemoteDownload_Protocol_value = map[string]int32{ + "UNKNOWN": 0, + "SFTP": 1, + "HTTP": 2, + "HTTPS": 3, + "SCP": 4, + } +) + +func (x RemoteDownload_Protocol) Enum() *RemoteDownload_Protocol { + p := new(RemoteDownload_Protocol) + *p = x + return p +} + +func (x RemoteDownload_Protocol) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (RemoteDownload_Protocol) Descriptor() protoreflect.EnumDescriptor { + return file_github_com_openconfig_gnoi_common_common_proto_enumTypes[0].Descriptor() +} + +func (RemoteDownload_Protocol) Type() protoreflect.EnumType { + return &file_github_com_openconfig_gnoi_common_common_proto_enumTypes[0] +} + +func (x RemoteDownload_Protocol) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use RemoteDownload_Protocol.Descriptor instead. +func (RemoteDownload_Protocol) EnumDescriptor() ([]byte, []int) { + return file_github_com_openconfig_gnoi_common_common_proto_rawDescGZIP(), []int{0, 0} +} + +type RemoteDownload struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Path string `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"` + Protocol RemoteDownload_Protocol `protobuf:"varint,2,opt,name=protocol,proto3,enum=gnoi.common.RemoteDownload_Protocol" json:"protocol,omitempty"` + Credentials *types.Credentials `protobuf:"bytes,3,opt,name=credentials,proto3" json:"credentials,omitempty"` + SourceAddress string `protobuf:"bytes,4,opt,name=source_address,json=sourceAddress,proto3" json:"source_address,omitempty"` + SourceVrf string `protobuf:"bytes,5,opt,name=source_vrf,json=sourceVrf,proto3" json:"source_vrf,omitempty"` +} + +func (x *RemoteDownload) Reset() { + *x = RemoteDownload{} + if protoimpl.UnsafeEnabled { + mi := &file_github_com_openconfig_gnoi_common_common_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RemoteDownload) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RemoteDownload) ProtoMessage() {} + +func (x *RemoteDownload) ProtoReflect() protoreflect.Message { + mi := &file_github_com_openconfig_gnoi_common_common_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RemoteDownload.ProtoReflect.Descriptor instead. +func (*RemoteDownload) Descriptor() ([]byte, []int) { + return file_github_com_openconfig_gnoi_common_common_proto_rawDescGZIP(), []int{0} +} + +func (x *RemoteDownload) GetPath() string { + if x != nil { + return x.Path + } + return "" +} + +func (x *RemoteDownload) GetProtocol() RemoteDownload_Protocol { + if x != nil { + return x.Protocol + } + return RemoteDownload_UNKNOWN +} + +func (x *RemoteDownload) GetCredentials() *types.Credentials { + if x != nil { + return x.Credentials + } + return nil +} + +func (x *RemoteDownload) GetSourceAddress() string { + if x != nil { + return x.SourceAddress + } + return "" +} + +func (x *RemoteDownload) GetSourceVrf() string { + if x != nil { + return x.SourceVrf + } + return "" +} + +var File_github_com_openconfig_gnoi_common_common_proto protoreflect.FileDescriptor + +var file_github_com_openconfig_gnoi_common_common_proto_rawDesc = []byte{ + 0x0a, 0x2e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x70, 0x65, + 0x6e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x67, 0x6e, 0x6f, 0x69, 0x2f, 0x63, 0x6f, 0x6d, + 0x6d, 0x6f, 0x6e, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x12, 0x0b, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x1a, 0x2c, 0x67, + 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6f, + 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x67, 0x6e, 0x6f, 0x69, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, + 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xa8, 0x02, 0x0a, 0x0e, + 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x12, + 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, + 0x74, 0x68, 0x12, 0x40, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0e, 0x32, 0x24, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, + 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, + 0x64, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x63, 0x6f, 0x6c, 0x12, 0x39, 0x0a, 0x0b, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, + 0x61, 0x6c, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x6e, 0x6f, 0x69, + 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, + 0x6c, 0x73, 0x52, 0x0b, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x73, 0x12, + 0x25, 0x0a, 0x0e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, + 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x41, + 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x5f, 0x76, 0x72, 0x66, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x56, 0x72, 0x66, 0x22, 0x3f, 0x0a, 0x08, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, + 0x6c, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x08, + 0x0a, 0x04, 0x53, 0x46, 0x54, 0x50, 0x10, 0x01, 0x12, 0x08, 0x0a, 0x04, 0x48, 0x54, 0x54, 0x50, + 0x10, 0x02, 0x12, 0x09, 0x0a, 0x05, 0x48, 0x54, 0x54, 0x50, 0x53, 0x10, 0x03, 0x12, 0x07, 0x0a, + 0x03, 0x53, 0x43, 0x50, 0x10, 0x04, 0x42, 0x23, 0x5a, 0x21, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, + 0x67, 0x6e, 0x6f, 0x69, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x33, +} + +var ( + file_github_com_openconfig_gnoi_common_common_proto_rawDescOnce sync.Once + file_github_com_openconfig_gnoi_common_common_proto_rawDescData = file_github_com_openconfig_gnoi_common_common_proto_rawDesc +) + +func file_github_com_openconfig_gnoi_common_common_proto_rawDescGZIP() []byte { + file_github_com_openconfig_gnoi_common_common_proto_rawDescOnce.Do(func() { + file_github_com_openconfig_gnoi_common_common_proto_rawDescData = protoimpl.X.CompressGZIP(file_github_com_openconfig_gnoi_common_common_proto_rawDescData) + }) + return file_github_com_openconfig_gnoi_common_common_proto_rawDescData +} + +var file_github_com_openconfig_gnoi_common_common_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_github_com_openconfig_gnoi_common_common_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_github_com_openconfig_gnoi_common_common_proto_goTypes = []interface{}{ + (RemoteDownload_Protocol)(0), // 0: gnoi.common.RemoteDownload.Protocol + (*RemoteDownload)(nil), // 1: gnoi.common.RemoteDownload + (*types.Credentials)(nil), // 2: gnoi.types.Credentials +} +var file_github_com_openconfig_gnoi_common_common_proto_depIdxs = []int32{ + 0, // 0: gnoi.common.RemoteDownload.protocol:type_name -> gnoi.common.RemoteDownload.Protocol + 2, // 1: gnoi.common.RemoteDownload.credentials:type_name -> gnoi.types.Credentials + 2, // [2:2] is the sub-list for method output_type + 2, // [2:2] is the sub-list for method input_type + 2, // [2:2] is the sub-list for extension type_name + 2, // [2:2] is the sub-list for extension extendee + 0, // [0:2] is the sub-list for field type_name +} + +func init() { file_github_com_openconfig_gnoi_common_common_proto_init() } +func file_github_com_openconfig_gnoi_common_common_proto_init() { + if File_github_com_openconfig_gnoi_common_common_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_github_com_openconfig_gnoi_common_common_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RemoteDownload); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_github_com_openconfig_gnoi_common_common_proto_rawDesc, + NumEnums: 1, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_github_com_openconfig_gnoi_common_common_proto_goTypes, + DependencyIndexes: file_github_com_openconfig_gnoi_common_common_proto_depIdxs, + EnumInfos: file_github_com_openconfig_gnoi_common_common_proto_enumTypes, + MessageInfos: file_github_com_openconfig_gnoi_common_common_proto_msgTypes, + }.Build() + File_github_com_openconfig_gnoi_common_common_proto = out.File + file_github_com_openconfig_gnoi_common_common_proto_rawDesc = nil + file_github_com_openconfig_gnoi_common_common_proto_goTypes = nil + file_github_com_openconfig_gnoi_common_common_proto_depIdxs = nil +} diff --git a/src/sonic-framework/gnoi/common/common.proto b/src/sonic-framework/gnoi/common/common.proto new file mode 100644 index 000000000000..35a88c69711f --- /dev/null +++ b/src/sonic-framework/gnoi/common/common.proto @@ -0,0 +1,53 @@ +// +// Copyright 2018 Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +syntax = "proto3"; + +package gnoi.common; + +//import "github.com/openconfig/gnoi/types/types.proto"; +import "types/types.proto"; + +option go_package = "github.com/openconfig/gnoi/common"; + +// RemoteDownload defines the details for a device to initiate a file transfer +// from or to a remote location. +message RemoteDownload { + // The path information containing where to download the data from or to. + // For HTTP(S), this will be the URL (i.e. foo.com/file.tbz2). + // For SFTP and SCP, this will be the address:/path/to/file + // (i.e. host.foo.com:/bar/baz). + string path = 1; + + enum Protocol { + UNKNOWN = 0; + SFTP = 1; + HTTP = 2; + HTTPS = 3; + SCP = 4; + } + Protocol protocol = 2; + + types.Credentials credentials = 3; + + // Optional source address used to initiate connections from the device. + // It can be either an IPv4 address or an IPv6 address, depending on the + // connection's destination address. + string source_address = 4; + + // Optional source vrf used to initiate connections from the device. + string source_vrf = 5; +} diff --git a/src/sonic-framework/gnoi/containerz/BUILD.bazel b/src/sonic-framework/gnoi/containerz/BUILD.bazel new file mode 100644 index 000000000000..557125bb22a0 --- /dev/null +++ b/src/sonic-framework/gnoi/containerz/BUILD.bazel @@ -0,0 +1,70 @@ +load("@rules_proto//proto:defs.bzl", "proto_library") +load("@io_bazel_rules_go//go:def.bzl", "go_library") +load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library") +load("@com_github_grpc_grpc//bazel:cc_grpc_library.bzl", "cc_grpc_library") +load("//:common.bzl", "use_new_compilers") + +#Copyright 2021 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +package( + default_visibility = ["//visibility:public"], + licenses = ["notice"], +) + +use_new_compilers() + +proto_library( + name = "containerz_proto", + srcs = ["containerz.proto"], + deps = [ + "//common:common_proto", + "//types:types_proto", + "@com_google_protobuf//:timestamp_proto", + "@go_googleapis//google/rpc:status_proto", + ], +) + +cc_proto_library( + name = "containerz_cc_proto", + deps = [":containerz_proto"], +) + +cc_grpc_library( + name = "containerz_cc_grpc_proto", + srcs = [":containerz_proto"], + grpc_only = True, + deps = [":containerz_cc_proto"], +) + +go_proto_library( + name = "containerz_go_proto", + compilers = [ + "go_protoc_gen_go", + "go_protoc_gen_go_grpc", + ], + importpath = "github.com/openconfig/gnoi/containerz", + proto = ":containerz_proto", + deps = [ + "//common", + "//types", + "@go_googleapis//google/rpc:status_go_proto", + ], +) + +go_library( + name = "containerz", + embed = [":containerz_go_proto"], + importpath = "github.com/openconfig/gnoi/containerz", +) diff --git a/src/sonic-framework/gnoi/containerz/README.md b/src/sonic-framework/gnoi/containerz/README.md new file mode 100644 index 000000000000..fe994b53f4e5 --- /dev/null +++ b/src/sonic-framework/gnoi/containerz/README.md @@ -0,0 +1,40 @@ +# gNOI `Containerz` +**Contributors**: alshabib@google.com, robjs@google.com, +morrowc@google.com +**Last Updated**: 2024-05-06 + +## Background Documentation + +* [gNOI Repository](https://github.com/openconfig/gnoi) +* [gNOI `Containerz` service](https://github.com/openconfig/gnoi/tree/master/containerz) +* [gNOI `Containerz` Reference Implementation](https://github.com/openconfig/containerz) +* [gNOI `Containerz` Motivation and Design](https://github.com/openconfig/containerz/blob/master/doc/motivation.md) + +## Use Case and Purpose + +The purpose of `Containerz` is to allow container operations over gRPC. +`Containerz` is intended to abstract the underlying container runtime system +(e.g. docker, kubernetes, etc.) thereby ensuring a common operational model +irrespective of the underlying architecture. + +Recent advances (including the availability of g* APIs) in vendor network +operating systems enable custom code to be executed on network devices as docker +containers. Running software as containers on network devices requires new +infrastructure to manage the container’s lifecycle. While this infrastructure +largely exists in the compute world, it is currently not available for network +devices. Furthermore, it is not immediately evident that the same approach as +the compute world for managing containers is desirable given this new context +where we do not want to enable arbitrary code execution but rather only +sanctioned applications. + +Currently, the common approach for transferring a container to a device is via +proprietary or CLI methods. This process is not appropriate for production since +under no circumstances should an operator log into a device to make changes, it +is also inconvenient when testing in the lab as the entire manual process is +complex and error prone. + +Finally, utilising gRPC for container operations allows for reuse of the same +security infrastructure as gNMI, gRIBI, and other gNOI services. Without +`Containerz` each container runtime would need to either implement or be +configured with the appropriate security method. + diff --git a/src/sonic-framework/gnoi/containerz/containerz.pb.go b/src/sonic-framework/gnoi/containerz/containerz.pb.go new file mode 100644 index 000000000000..634337649f8f --- /dev/null +++ b/src/sonic-framework/gnoi/containerz/containerz.pb.go @@ -0,0 +1,4278 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.30.0 +// protoc v3.21.10 +// source: containerz/containerz.proto + +package containerz + +import ( + common "github.com/openconfig/gnoi/common" + _ "github.com/openconfig/gnoi/types" + status "google.golang.org/genproto/googleapis/rpc/status" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type Driver int32 + +const ( + Driver_DS_UNSPECIFIED Driver = 0 + Driver_DS_LOCAL Driver = 1 +) + +// Enum value maps for Driver. +var ( + Driver_name = map[int32]string{ + 0: "DS_UNSPECIFIED", + 1: "DS_LOCAL", + } + Driver_value = map[string]int32{ + "DS_UNSPECIFIED": 0, + "DS_LOCAL": 1, + } +) + +func (x Driver) Enum() *Driver { + p := new(Driver) + *p = x + return p +} + +func (x Driver) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Driver) Descriptor() protoreflect.EnumDescriptor { + return file_containerz_containerz_proto_enumTypes[0].Descriptor() +} + +func (Driver) Type() protoreflect.EnumType { + return &file_containerz_containerz_proto_enumTypes[0] +} + +func (x Driver) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use Driver.Descriptor instead. +func (Driver) EnumDescriptor() ([]byte, []int) { + return file_containerz_containerz_proto_rawDescGZIP(), []int{0} +} + +type RemoveImageResponse_Code int32 + +const ( + RemoveImageResponse_UNSPECIFIED RemoveImageResponse_Code = 0 + RemoveImageResponse_UNKNOWN RemoveImageResponse_Code = 1 + RemoveImageResponse_NOT_FOUND RemoveImageResponse_Code = 2 + RemoveImageResponse_RUNNING RemoveImageResponse_Code = 3 + RemoveImageResponse_SUCCESS RemoveImageResponse_Code = 4 +) + +// Enum value maps for RemoveImageResponse_Code. +var ( + RemoveImageResponse_Code_name = map[int32]string{ + 0: "UNSPECIFIED", + 1: "UNKNOWN", + 2: "NOT_FOUND", + 3: "RUNNING", + 4: "SUCCESS", + } + RemoveImageResponse_Code_value = map[string]int32{ + "UNSPECIFIED": 0, + "UNKNOWN": 1, + "NOT_FOUND": 2, + "RUNNING": 3, + "SUCCESS": 4, + } +) + +func (x RemoveImageResponse_Code) Enum() *RemoveImageResponse_Code { + p := new(RemoveImageResponse_Code) + *p = x + return p +} + +func (x RemoveImageResponse_Code) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (RemoveImageResponse_Code) Descriptor() protoreflect.EnumDescriptor { + return file_containerz_containerz_proto_enumTypes[1].Descriptor() +} + +func (RemoveImageResponse_Code) Type() protoreflect.EnumType { + return &file_containerz_containerz_proto_enumTypes[1] +} + +func (x RemoveImageResponse_Code) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use RemoveImageResponse_Code.Descriptor instead. +func (RemoveImageResponse_Code) EnumDescriptor() ([]byte, []int) { + return file_containerz_containerz_proto_rawDescGZIP(), []int{8, 0} +} + +type RemoveContainerResponse_Code int32 + +const ( + RemoveContainerResponse_UNSPECIFIED RemoveContainerResponse_Code = 0 + RemoveContainerResponse_NOT_FOUND RemoveContainerResponse_Code = 1 + RemoveContainerResponse_RUNNING RemoveContainerResponse_Code = 2 + RemoveContainerResponse_SUCCESS RemoveContainerResponse_Code = 3 +) + +// Enum value maps for RemoveContainerResponse_Code. +var ( + RemoveContainerResponse_Code_name = map[int32]string{ + 0: "UNSPECIFIED", + 1: "NOT_FOUND", + 2: "RUNNING", + 3: "SUCCESS", + } + RemoveContainerResponse_Code_value = map[string]int32{ + "UNSPECIFIED": 0, + "NOT_FOUND": 1, + "RUNNING": 2, + "SUCCESS": 3, + } +) + +func (x RemoveContainerResponse_Code) Enum() *RemoveContainerResponse_Code { + p := new(RemoveContainerResponse_Code) + *p = x + return p +} + +func (x RemoveContainerResponse_Code) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (RemoveContainerResponse_Code) Descriptor() protoreflect.EnumDescriptor { + return file_containerz_containerz_proto_enumTypes[2].Descriptor() +} + +func (RemoveContainerResponse_Code) Type() protoreflect.EnumType { + return &file_containerz_containerz_proto_enumTypes[2] +} + +func (x RemoveContainerResponse_Code) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use RemoveContainerResponse_Code.Descriptor instead. +func (RemoveContainerResponse_Code) EnumDescriptor() ([]byte, []int) { + return file_containerz_containerz_proto_rawDescGZIP(), []int{10, 0} +} + +type ListContainerResponse_Status int32 + +const ( + ListContainerResponse_UNSPECIFIED ListContainerResponse_Status = 0 + ListContainerResponse_STOPPED ListContainerResponse_Status = 1 + ListContainerResponse_RUNNING ListContainerResponse_Status = 2 + ListContainerResponse_PRESENT ListContainerResponse_Status = 3 + ListContainerResponse_NOT_FOUND ListContainerResponse_Status = 4 +) + +// Enum value maps for ListContainerResponse_Status. +var ( + ListContainerResponse_Status_name = map[int32]string{ + 0: "UNSPECIFIED", + 1: "STOPPED", + 2: "RUNNING", + 3: "PRESENT", + 4: "NOT_FOUND", + } + ListContainerResponse_Status_value = map[string]int32{ + "UNSPECIFIED": 0, + "STOPPED": 1, + "RUNNING": 2, + "PRESENT": 3, + "NOT_FOUND": 4, + } +) + +func (x ListContainerResponse_Status) Enum() *ListContainerResponse_Status { + p := new(ListContainerResponse_Status) + *p = x + return p +} + +func (x ListContainerResponse_Status) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (ListContainerResponse_Status) Descriptor() protoreflect.EnumDescriptor { + return file_containerz_containerz_proto_enumTypes[3].Descriptor() +} + +func (ListContainerResponse_Status) Type() protoreflect.EnumType { + return &file_containerz_containerz_proto_enumTypes[3] +} + +func (x ListContainerResponse_Status) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use ListContainerResponse_Status.Descriptor instead. +func (ListContainerResponse_Status) EnumDescriptor() ([]byte, []int) { + return file_containerz_containerz_proto_rawDescGZIP(), []int{14, 0} +} + +type StartContainerRequest_Restart_Policy int32 + +const ( + StartContainerRequest_Restart_NONE StartContainerRequest_Restart_Policy = 0 + StartContainerRequest_Restart_ALWAYS StartContainerRequest_Restart_Policy = 1 + StartContainerRequest_Restart_UNLESS_STOPPED StartContainerRequest_Restart_Policy = 2 + StartContainerRequest_Restart_ON_FAILURE StartContainerRequest_Restart_Policy = 3 +) + +// Enum value maps for StartContainerRequest_Restart_Policy. +var ( + StartContainerRequest_Restart_Policy_name = map[int32]string{ + 0: "NONE", + 1: "ALWAYS", + 2: "UNLESS_STOPPED", + 3: "ON_FAILURE", + } + StartContainerRequest_Restart_Policy_value = map[string]int32{ + "NONE": 0, + "ALWAYS": 1, + "UNLESS_STOPPED": 2, + "ON_FAILURE": 3, + } +) + +func (x StartContainerRequest_Restart_Policy) Enum() *StartContainerRequest_Restart_Policy { + p := new(StartContainerRequest_Restart_Policy) + *p = x + return p +} + +func (x StartContainerRequest_Restart_Policy) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (StartContainerRequest_Restart_Policy) Descriptor() protoreflect.EnumDescriptor { + return file_containerz_containerz_proto_enumTypes[4].Descriptor() +} + +func (StartContainerRequest_Restart_Policy) Type() protoreflect.EnumType { + return &file_containerz_containerz_proto_enumTypes[4] +} + +func (x StartContainerRequest_Restart_Policy) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use StartContainerRequest_Restart_Policy.Descriptor instead. +func (StartContainerRequest_Restart_Policy) EnumDescriptor() ([]byte, []int) { + return file_containerz_containerz_proto_rawDescGZIP(), []int{16, 3, 0} +} + +type StartError_Code int32 + +const ( + StartError_UNSPECIFIED StartError_Code = 0 + StartError_UNKNOWN StartError_Code = 1 + StartError_NOT_FOUND StartError_Code = 2 + StartError_PORT_USED StartError_Code = 3 +) + +// Enum value maps for StartError_Code. +var ( + StartError_Code_name = map[int32]string{ + 0: "UNSPECIFIED", + 1: "UNKNOWN", + 2: "NOT_FOUND", + 3: "PORT_USED", + } + StartError_Code_value = map[string]int32{ + "UNSPECIFIED": 0, + "UNKNOWN": 1, + "NOT_FOUND": 2, + "PORT_USED": 3, + } +) + +func (x StartError_Code) Enum() *StartError_Code { + p := new(StartError_Code) + *p = x + return p +} + +func (x StartError_Code) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (StartError_Code) Descriptor() protoreflect.EnumDescriptor { + return file_containerz_containerz_proto_enumTypes[5].Descriptor() +} + +func (StartError_Code) Type() protoreflect.EnumType { + return &file_containerz_containerz_proto_enumTypes[5] +} + +func (x StartError_Code) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use StartError_Code.Descriptor instead. +func (StartError_Code) EnumDescriptor() ([]byte, []int) { + return file_containerz_containerz_proto_rawDescGZIP(), []int{19, 0} +} + +type StopContainerResponse_Code int32 + +const ( + StopContainerResponse_UNSPECIFIED StopContainerResponse_Code = 0 + StopContainerResponse_BUSY StopContainerResponse_Code = 1 + StopContainerResponse_NOT_FOUND StopContainerResponse_Code = 2 + StopContainerResponse_SUCCESS StopContainerResponse_Code = 3 +) + +// Enum value maps for StopContainerResponse_Code. +var ( + StopContainerResponse_Code_name = map[int32]string{ + 0: "UNSPECIFIED", + 1: "BUSY", + 2: "NOT_FOUND", + 3: "SUCCESS", + } + StopContainerResponse_Code_value = map[string]int32{ + "UNSPECIFIED": 0, + "BUSY": 1, + "NOT_FOUND": 2, + "SUCCESS": 3, + } +) + +func (x StopContainerResponse_Code) Enum() *StopContainerResponse_Code { + p := new(StopContainerResponse_Code) + *p = x + return p +} + +func (x StopContainerResponse_Code) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (StopContainerResponse_Code) Descriptor() protoreflect.EnumDescriptor { + return file_containerz_containerz_proto_enumTypes[6].Descriptor() +} + +func (StopContainerResponse_Code) Type() protoreflect.EnumType { + return &file_containerz_containerz_proto_enumTypes[6] +} + +func (x StopContainerResponse_Code) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use StopContainerResponse_Code.Descriptor instead. +func (StopContainerResponse_Code) EnumDescriptor() ([]byte, []int) { + return file_containerz_containerz_proto_rawDescGZIP(), []int{21, 0} +} + +type UpdateError_Code int32 + +const ( + UpdateError_UNSPECIFIED UpdateError_Code = 0 + UpdateError_NOT_FOUND UpdateError_Code = 1 + UpdateError_PORT_USED UpdateError_Code = 2 + UpdateError_NOT_RUNNING UpdateError_Code = 3 + UpdateError_NOT_UPDATED UpdateError_Code = 4 + UpdateError_FAILURE UpdateError_Code = 5 +) + +// Enum value maps for UpdateError_Code. +var ( + UpdateError_Code_name = map[int32]string{ + 0: "UNSPECIFIED", + 1: "NOT_FOUND", + 2: "PORT_USED", + 3: "NOT_RUNNING", + 4: "NOT_UPDATED", + 5: "FAILURE", + } + UpdateError_Code_value = map[string]int32{ + "UNSPECIFIED": 0, + "NOT_FOUND": 1, + "PORT_USED": 2, + "NOT_RUNNING": 3, + "NOT_UPDATED": 4, + "FAILURE": 5, + } +) + +func (x UpdateError_Code) Enum() *UpdateError_Code { + p := new(UpdateError_Code) + *p = x + return p +} + +func (x UpdateError_Code) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (UpdateError_Code) Descriptor() protoreflect.EnumDescriptor { + return file_containerz_containerz_proto_enumTypes[7].Descriptor() +} + +func (UpdateError_Code) Type() protoreflect.EnumType { + return &file_containerz_containerz_proto_enumTypes[7] +} + +func (x UpdateError_Code) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use UpdateError_Code.Descriptor instead. +func (UpdateError_Code) EnumDescriptor() ([]byte, []int) { + return file_containerz_containerz_proto_rawDescGZIP(), []int{25, 0} +} + +type LocalDriverOptions_Type int32 + +const ( + LocalDriverOptions_TYPE_UNSPECIFIED LocalDriverOptions_Type = 0 + LocalDriverOptions_TYPE_NONE LocalDriverOptions_Type = 1 +) + +// Enum value maps for LocalDriverOptions_Type. +var ( + LocalDriverOptions_Type_name = map[int32]string{ + 0: "TYPE_UNSPECIFIED", + 1: "TYPE_NONE", + } + LocalDriverOptions_Type_value = map[string]int32{ + "TYPE_UNSPECIFIED": 0, + "TYPE_NONE": 1, + } +) + +func (x LocalDriverOptions_Type) Enum() *LocalDriverOptions_Type { + p := new(LocalDriverOptions_Type) + *p = x + return p +} + +func (x LocalDriverOptions_Type) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (LocalDriverOptions_Type) Descriptor() protoreflect.EnumDescriptor { + return file_containerz_containerz_proto_enumTypes[8].Descriptor() +} + +func (LocalDriverOptions_Type) Type() protoreflect.EnumType { + return &file_containerz_containerz_proto_enumTypes[8] +} + +func (x LocalDriverOptions_Type) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use LocalDriverOptions_Type.Descriptor instead. +func (LocalDriverOptions_Type) EnumDescriptor() ([]byte, []int) { + return file_containerz_containerz_proto_rawDescGZIP(), []int{28, 0} +} + +type DeployRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Request: + // + // *DeployRequest_ImageTransfer + // *DeployRequest_Content + // *DeployRequest_ImageTransferEnd + Request isDeployRequest_Request `protobuf_oneof:"request"` +} + +func (x *DeployRequest) Reset() { + *x = DeployRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_containerz_containerz_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeployRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeployRequest) ProtoMessage() {} + +func (x *DeployRequest) ProtoReflect() protoreflect.Message { + mi := &file_containerz_containerz_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeployRequest.ProtoReflect.Descriptor instead. +func (*DeployRequest) Descriptor() ([]byte, []int) { + return file_containerz_containerz_proto_rawDescGZIP(), []int{0} +} + +func (m *DeployRequest) GetRequest() isDeployRequest_Request { + if m != nil { + return m.Request + } + return nil +} + +func (x *DeployRequest) GetImageTransfer() *ImageTransfer { + if x, ok := x.GetRequest().(*DeployRequest_ImageTransfer); ok { + return x.ImageTransfer + } + return nil +} + +func (x *DeployRequest) GetContent() []byte { + if x, ok := x.GetRequest().(*DeployRequest_Content); ok { + return x.Content + } + return nil +} + +func (x *DeployRequest) GetImageTransferEnd() *ImageTransferEnd { + if x, ok := x.GetRequest().(*DeployRequest_ImageTransferEnd); ok { + return x.ImageTransferEnd + } + return nil +} + +type isDeployRequest_Request interface { + isDeployRequest_Request() +} + +type DeployRequest_ImageTransfer struct { + ImageTransfer *ImageTransfer `protobuf:"bytes,1,opt,name=image_transfer,json=imageTransfer,proto3,oneof"` +} + +type DeployRequest_Content struct { + Content []byte `protobuf:"bytes,2,opt,name=content,proto3,oneof"` +} + +type DeployRequest_ImageTransferEnd struct { + ImageTransferEnd *ImageTransferEnd `protobuf:"bytes,3,opt,name=image_transfer_end,json=imageTransferEnd,proto3,oneof"` +} + +func (*DeployRequest_ImageTransfer) isDeployRequest_Request() {} + +func (*DeployRequest_Content) isDeployRequest_Request() {} + +func (*DeployRequest_ImageTransferEnd) isDeployRequest_Request() {} + +type ImageTransfer struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Tag string `protobuf:"bytes,2,opt,name=tag,proto3" json:"tag,omitempty"` + ImageSize uint64 `protobuf:"varint,3,opt,name=image_size,json=imageSize,proto3" json:"image_size,omitempty"` + RemoteDownload *common.RemoteDownload `protobuf:"bytes,4,opt,name=remote_download,json=remoteDownload,proto3" json:"remote_download,omitempty"` +} + +func (x *ImageTransfer) Reset() { + *x = ImageTransfer{} + if protoimpl.UnsafeEnabled { + mi := &file_containerz_containerz_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ImageTransfer) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ImageTransfer) ProtoMessage() {} + +func (x *ImageTransfer) ProtoReflect() protoreflect.Message { + mi := &file_containerz_containerz_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ImageTransfer.ProtoReflect.Descriptor instead. +func (*ImageTransfer) Descriptor() ([]byte, []int) { + return file_containerz_containerz_proto_rawDescGZIP(), []int{1} +} + +func (x *ImageTransfer) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *ImageTransfer) GetTag() string { + if x != nil { + return x.Tag + } + return "" +} + +func (x *ImageTransfer) GetImageSize() uint64 { + if x != nil { + return x.ImageSize + } + return 0 +} + +func (x *ImageTransfer) GetRemoteDownload() *common.RemoteDownload { + if x != nil { + return x.RemoteDownload + } + return nil +} + +type ImageTransferEnd struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *ImageTransferEnd) Reset() { + *x = ImageTransferEnd{} + if protoimpl.UnsafeEnabled { + mi := &file_containerz_containerz_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ImageTransferEnd) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ImageTransferEnd) ProtoMessage() {} + +func (x *ImageTransferEnd) ProtoReflect() protoreflect.Message { + mi := &file_containerz_containerz_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ImageTransferEnd.ProtoReflect.Descriptor instead. +func (*ImageTransferEnd) Descriptor() ([]byte, []int) { + return file_containerz_containerz_proto_rawDescGZIP(), []int{2} +} + +type DeployResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Response: + // + // *DeployResponse_ImageTransferReady + // *DeployResponse_ImageTransferProgress + // *DeployResponse_ImageTransferSuccess + // *DeployResponse_ImageTransferError + Response isDeployResponse_Response `protobuf_oneof:"response"` +} + +func (x *DeployResponse) Reset() { + *x = DeployResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_containerz_containerz_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeployResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeployResponse) ProtoMessage() {} + +func (x *DeployResponse) ProtoReflect() protoreflect.Message { + mi := &file_containerz_containerz_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeployResponse.ProtoReflect.Descriptor instead. +func (*DeployResponse) Descriptor() ([]byte, []int) { + return file_containerz_containerz_proto_rawDescGZIP(), []int{3} +} + +func (m *DeployResponse) GetResponse() isDeployResponse_Response { + if m != nil { + return m.Response + } + return nil +} + +func (x *DeployResponse) GetImageTransferReady() *ImageTransferReady { + if x, ok := x.GetResponse().(*DeployResponse_ImageTransferReady); ok { + return x.ImageTransferReady + } + return nil +} + +func (x *DeployResponse) GetImageTransferProgress() *ImageTransferProgress { + if x, ok := x.GetResponse().(*DeployResponse_ImageTransferProgress); ok { + return x.ImageTransferProgress + } + return nil +} + +func (x *DeployResponse) GetImageTransferSuccess() *ImageTransferSuccess { + if x, ok := x.GetResponse().(*DeployResponse_ImageTransferSuccess); ok { + return x.ImageTransferSuccess + } + return nil +} + +func (x *DeployResponse) GetImageTransferError() *status.Status { + if x, ok := x.GetResponse().(*DeployResponse_ImageTransferError); ok { + return x.ImageTransferError + } + return nil +} + +type isDeployResponse_Response interface { + isDeployResponse_Response() +} + +type DeployResponse_ImageTransferReady struct { + ImageTransferReady *ImageTransferReady `protobuf:"bytes,1,opt,name=image_transfer_ready,json=imageTransferReady,proto3,oneof"` +} + +type DeployResponse_ImageTransferProgress struct { + ImageTransferProgress *ImageTransferProgress `protobuf:"bytes,2,opt,name=image_transfer_progress,json=imageTransferProgress,proto3,oneof"` +} + +type DeployResponse_ImageTransferSuccess struct { + ImageTransferSuccess *ImageTransferSuccess `protobuf:"bytes,3,opt,name=image_transfer_success,json=imageTransferSuccess,proto3,oneof"` +} + +type DeployResponse_ImageTransferError struct { + ImageTransferError *status.Status `protobuf:"bytes,4,opt,name=image_transfer_error,json=imageTransferError,proto3,oneof"` +} + +func (*DeployResponse_ImageTransferReady) isDeployResponse_Response() {} + +func (*DeployResponse_ImageTransferProgress) isDeployResponse_Response() {} + +func (*DeployResponse_ImageTransferSuccess) isDeployResponse_Response() {} + +func (*DeployResponse_ImageTransferError) isDeployResponse_Response() {} + +type ImageTransferReady struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ChunkSize int32 `protobuf:"varint,1,opt,name=chunk_size,json=chunkSize,proto3" json:"chunk_size,omitempty"` +} + +func (x *ImageTransferReady) Reset() { + *x = ImageTransferReady{} + if protoimpl.UnsafeEnabled { + mi := &file_containerz_containerz_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ImageTransferReady) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ImageTransferReady) ProtoMessage() {} + +func (x *ImageTransferReady) ProtoReflect() protoreflect.Message { + mi := &file_containerz_containerz_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ImageTransferReady.ProtoReflect.Descriptor instead. +func (*ImageTransferReady) Descriptor() ([]byte, []int) { + return file_containerz_containerz_proto_rawDescGZIP(), []int{4} +} + +func (x *ImageTransferReady) GetChunkSize() int32 { + if x != nil { + return x.ChunkSize + } + return 0 +} + +type ImageTransferProgress struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + BytesReceived uint64 `protobuf:"varint,1,opt,name=bytes_received,json=bytesReceived,proto3" json:"bytes_received,omitempty"` +} + +func (x *ImageTransferProgress) Reset() { + *x = ImageTransferProgress{} + if protoimpl.UnsafeEnabled { + mi := &file_containerz_containerz_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ImageTransferProgress) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ImageTransferProgress) ProtoMessage() {} + +func (x *ImageTransferProgress) ProtoReflect() protoreflect.Message { + mi := &file_containerz_containerz_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ImageTransferProgress.ProtoReflect.Descriptor instead. +func (*ImageTransferProgress) Descriptor() ([]byte, []int) { + return file_containerz_containerz_proto_rawDescGZIP(), []int{5} +} + +func (x *ImageTransferProgress) GetBytesReceived() uint64 { + if x != nil { + return x.BytesReceived + } + return 0 +} + +type ImageTransferSuccess struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Tag string `protobuf:"bytes,2,opt,name=tag,proto3" json:"tag,omitempty"` + ImageSize uint64 `protobuf:"varint,3,opt,name=image_size,json=imageSize,proto3" json:"image_size,omitempty"` +} + +func (x *ImageTransferSuccess) Reset() { + *x = ImageTransferSuccess{} + if protoimpl.UnsafeEnabled { + mi := &file_containerz_containerz_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ImageTransferSuccess) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ImageTransferSuccess) ProtoMessage() {} + +func (x *ImageTransferSuccess) ProtoReflect() protoreflect.Message { + mi := &file_containerz_containerz_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ImageTransferSuccess.ProtoReflect.Descriptor instead. +func (*ImageTransferSuccess) Descriptor() ([]byte, []int) { + return file_containerz_containerz_proto_rawDescGZIP(), []int{6} +} + +func (x *ImageTransferSuccess) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *ImageTransferSuccess) GetTag() string { + if x != nil { + return x.Tag + } + return "" +} + +func (x *ImageTransferSuccess) GetImageSize() uint64 { + if x != nil { + return x.ImageSize + } + return 0 +} + +type RemoveImageRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Tag string `protobuf:"bytes,2,opt,name=tag,proto3" json:"tag,omitempty"` + Force bool `protobuf:"varint,3,opt,name=force,proto3" json:"force,omitempty"` +} + +func (x *RemoveImageRequest) Reset() { + *x = RemoveImageRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_containerz_containerz_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RemoveImageRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RemoveImageRequest) ProtoMessage() {} + +func (x *RemoveImageRequest) ProtoReflect() protoreflect.Message { + mi := &file_containerz_containerz_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RemoveImageRequest.ProtoReflect.Descriptor instead. +func (*RemoveImageRequest) Descriptor() ([]byte, []int) { + return file_containerz_containerz_proto_rawDescGZIP(), []int{7} +} + +func (x *RemoveImageRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *RemoveImageRequest) GetTag() string { + if x != nil { + return x.Tag + } + return "" +} + +func (x *RemoveImageRequest) GetForce() bool { + if x != nil { + return x.Force + } + return false +} + +type RemoveImageResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Code RemoveImageResponse_Code `protobuf:"varint,1,opt,name=code,proto3,enum=gnoi.containerz.RemoveImageResponse_Code" json:"code,omitempty"` + Detail string `protobuf:"bytes,2,opt,name=detail,proto3" json:"detail,omitempty"` +} + +func (x *RemoveImageResponse) Reset() { + *x = RemoveImageResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_containerz_containerz_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RemoveImageResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RemoveImageResponse) ProtoMessage() {} + +func (x *RemoveImageResponse) ProtoReflect() protoreflect.Message { + mi := &file_containerz_containerz_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RemoveImageResponse.ProtoReflect.Descriptor instead. +func (*RemoveImageResponse) Descriptor() ([]byte, []int) { + return file_containerz_containerz_proto_rawDescGZIP(), []int{8} +} + +func (x *RemoveImageResponse) GetCode() RemoveImageResponse_Code { + if x != nil { + return x.Code + } + return RemoveImageResponse_UNSPECIFIED +} + +func (x *RemoveImageResponse) GetDetail() string { + if x != nil { + return x.Detail + } + return "" +} + +type RemoveContainerRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Tag string `protobuf:"bytes,2,opt,name=tag,proto3" json:"tag,omitempty"` + Force bool `protobuf:"varint,3,opt,name=force,proto3" json:"force,omitempty"` +} + +func (x *RemoveContainerRequest) Reset() { + *x = RemoveContainerRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_containerz_containerz_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RemoveContainerRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RemoveContainerRequest) ProtoMessage() {} + +func (x *RemoveContainerRequest) ProtoReflect() protoreflect.Message { + mi := &file_containerz_containerz_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RemoveContainerRequest.ProtoReflect.Descriptor instead. +func (*RemoveContainerRequest) Descriptor() ([]byte, []int) { + return file_containerz_containerz_proto_rawDescGZIP(), []int{9} +} + +func (x *RemoveContainerRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *RemoveContainerRequest) GetTag() string { + if x != nil { + return x.Tag + } + return "" +} + +func (x *RemoveContainerRequest) GetForce() bool { + if x != nil { + return x.Force + } + return false +} + +type RemoveContainerResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Code RemoveContainerResponse_Code `protobuf:"varint,1,opt,name=code,proto3,enum=gnoi.containerz.RemoveContainerResponse_Code" json:"code,omitempty"` + Detail string `protobuf:"bytes,2,opt,name=detail,proto3" json:"detail,omitempty"` +} + +func (x *RemoveContainerResponse) Reset() { + *x = RemoveContainerResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_containerz_containerz_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RemoveContainerResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RemoveContainerResponse) ProtoMessage() {} + +func (x *RemoveContainerResponse) ProtoReflect() protoreflect.Message { + mi := &file_containerz_containerz_proto_msgTypes[10] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RemoveContainerResponse.ProtoReflect.Descriptor instead. +func (*RemoveContainerResponse) Descriptor() ([]byte, []int) { + return file_containerz_containerz_proto_rawDescGZIP(), []int{10} +} + +func (x *RemoveContainerResponse) GetCode() RemoveContainerResponse_Code { + if x != nil { + return x.Code + } + return RemoveContainerResponse_UNSPECIFIED +} + +func (x *RemoveContainerResponse) GetDetail() string { + if x != nil { + return x.Detail + } + return "" +} + +type ListImageRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Limit int32 `protobuf:"varint,1,opt,name=limit,proto3" json:"limit,omitempty"` + Filter []*ListImageRequest_Filter `protobuf:"bytes,3,rep,name=filter,proto3" json:"filter,omitempty"` +} + +func (x *ListImageRequest) Reset() { + *x = ListImageRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_containerz_containerz_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListImageRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListImageRequest) ProtoMessage() {} + +func (x *ListImageRequest) ProtoReflect() protoreflect.Message { + mi := &file_containerz_containerz_proto_msgTypes[11] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListImageRequest.ProtoReflect.Descriptor instead. +func (*ListImageRequest) Descriptor() ([]byte, []int) { + return file_containerz_containerz_proto_rawDescGZIP(), []int{11} +} + +func (x *ListImageRequest) GetLimit() int32 { + if x != nil { + return x.Limit + } + return 0 +} + +func (x *ListImageRequest) GetFilter() []*ListImageRequest_Filter { + if x != nil { + return x.Filter + } + return nil +} + +type ListImageResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + ImageName string `protobuf:"bytes,2,opt,name=image_name,json=imageName,proto3" json:"image_name,omitempty"` + Tag string `protobuf:"bytes,3,opt,name=tag,proto3" json:"tag,omitempty"` +} + +func (x *ListImageResponse) Reset() { + *x = ListImageResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_containerz_containerz_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListImageResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListImageResponse) ProtoMessage() {} + +func (x *ListImageResponse) ProtoReflect() protoreflect.Message { + mi := &file_containerz_containerz_proto_msgTypes[12] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListImageResponse.ProtoReflect.Descriptor instead. +func (*ListImageResponse) Descriptor() ([]byte, []int) { + return file_containerz_containerz_proto_rawDescGZIP(), []int{12} +} + +func (x *ListImageResponse) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *ListImageResponse) GetImageName() string { + if x != nil { + return x.ImageName + } + return "" +} + +func (x *ListImageResponse) GetTag() string { + if x != nil { + return x.Tag + } + return "" +} + +type ListContainerRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + All bool `protobuf:"varint,1,opt,name=all,proto3" json:"all,omitempty"` + Limit int32 `protobuf:"varint,2,opt,name=limit,proto3" json:"limit,omitempty"` + Filter []*ListContainerRequest_Filter `protobuf:"bytes,3,rep,name=filter,proto3" json:"filter,omitempty"` +} + +func (x *ListContainerRequest) Reset() { + *x = ListContainerRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_containerz_containerz_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListContainerRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListContainerRequest) ProtoMessage() {} + +func (x *ListContainerRequest) ProtoReflect() protoreflect.Message { + mi := &file_containerz_containerz_proto_msgTypes[13] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListContainerRequest.ProtoReflect.Descriptor instead. +func (*ListContainerRequest) Descriptor() ([]byte, []int) { + return file_containerz_containerz_proto_rawDescGZIP(), []int{13} +} + +func (x *ListContainerRequest) GetAll() bool { + if x != nil { + return x.All + } + return false +} + +func (x *ListContainerRequest) GetLimit() int32 { + if x != nil { + return x.Limit + } + return 0 +} + +func (x *ListContainerRequest) GetFilter() []*ListContainerRequest_Filter { + if x != nil { + return x.Filter + } + return nil +} + +type ListContainerResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + ImageName string `protobuf:"bytes,3,opt,name=image_name,json=imageName,proto3" json:"image_name,omitempty"` + Status ListContainerResponse_Status `protobuf:"varint,4,opt,name=status,proto3,enum=gnoi.containerz.ListContainerResponse_Status" json:"status,omitempty"` +} + +func (x *ListContainerResponse) Reset() { + *x = ListContainerResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_containerz_containerz_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListContainerResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListContainerResponse) ProtoMessage() {} + +func (x *ListContainerResponse) ProtoReflect() protoreflect.Message { + mi := &file_containerz_containerz_proto_msgTypes[14] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListContainerResponse.ProtoReflect.Descriptor instead. +func (*ListContainerResponse) Descriptor() ([]byte, []int) { + return file_containerz_containerz_proto_rawDescGZIP(), []int{14} +} + +func (x *ListContainerResponse) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *ListContainerResponse) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *ListContainerResponse) GetImageName() string { + if x != nil { + return x.ImageName + } + return "" +} + +func (x *ListContainerResponse) GetStatus() ListContainerResponse_Status { + if x != nil { + return x.Status + } + return ListContainerResponse_UNSPECIFIED +} + +type Volume struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + MountPoint string `protobuf:"bytes,2,opt,name=mount_point,json=mountPoint,proto3" json:"mount_point,omitempty"` + ReadOnly bool `protobuf:"varint,3,opt,name=read_only,json=readOnly,proto3" json:"read_only,omitempty"` +} + +func (x *Volume) Reset() { + *x = Volume{} + if protoimpl.UnsafeEnabled { + mi := &file_containerz_containerz_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Volume) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Volume) ProtoMessage() {} + +func (x *Volume) ProtoReflect() protoreflect.Message { + mi := &file_containerz_containerz_proto_msgTypes[15] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Volume.ProtoReflect.Descriptor instead. +func (*Volume) Descriptor() ([]byte, []int) { + return file_containerz_containerz_proto_rawDescGZIP(), []int{15} +} + +func (x *Volume) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *Volume) GetMountPoint() string { + if x != nil { + return x.MountPoint + } + return "" +} + +func (x *Volume) GetReadOnly() bool { + if x != nil { + return x.ReadOnly + } + return false +} + +type StartContainerRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ImageName string `protobuf:"bytes,1,opt,name=image_name,json=imageName,proto3" json:"image_name,omitempty"` + Tag string `protobuf:"bytes,2,opt,name=tag,proto3" json:"tag,omitempty"` + Cmd string `protobuf:"bytes,3,opt,name=cmd,proto3" json:"cmd,omitempty"` + InstanceName string `protobuf:"bytes,4,opt,name=instance_name,json=instanceName,proto3" json:"instance_name,omitempty"` + Ports []*StartContainerRequest_Port `protobuf:"bytes,5,rep,name=ports,proto3" json:"ports,omitempty"` + Environment map[string]string `protobuf:"bytes,6,rep,name=environment,proto3" json:"environment,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + Volumes []*Volume `protobuf:"bytes,7,rep,name=volumes,proto3" json:"volumes,omitempty"` + Network string `protobuf:"bytes,8,opt,name=network,proto3" json:"network,omitempty"` + Cap *StartContainerRequest_Capabilities `protobuf:"bytes,9,opt,name=cap,proto3" json:"cap,omitempty"` + Restart *StartContainerRequest_Restart `protobuf:"bytes,10,opt,name=restart,proto3" json:"restart,omitempty"` + RunAs *StartContainerRequest_RunAs `protobuf:"bytes,11,opt,name=run_as,json=runAs,proto3" json:"run_as,omitempty"` +} + +func (x *StartContainerRequest) Reset() { + *x = StartContainerRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_containerz_containerz_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StartContainerRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StartContainerRequest) ProtoMessage() {} + +func (x *StartContainerRequest) ProtoReflect() protoreflect.Message { + mi := &file_containerz_containerz_proto_msgTypes[16] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use StartContainerRequest.ProtoReflect.Descriptor instead. +func (*StartContainerRequest) Descriptor() ([]byte, []int) { + return file_containerz_containerz_proto_rawDescGZIP(), []int{16} +} + +func (x *StartContainerRequest) GetImageName() string { + if x != nil { + return x.ImageName + } + return "" +} + +func (x *StartContainerRequest) GetTag() string { + if x != nil { + return x.Tag + } + return "" +} + +func (x *StartContainerRequest) GetCmd() string { + if x != nil { + return x.Cmd + } + return "" +} + +func (x *StartContainerRequest) GetInstanceName() string { + if x != nil { + return x.InstanceName + } + return "" +} + +func (x *StartContainerRequest) GetPorts() []*StartContainerRequest_Port { + if x != nil { + return x.Ports + } + return nil +} + +func (x *StartContainerRequest) GetEnvironment() map[string]string { + if x != nil { + return x.Environment + } + return nil +} + +func (x *StartContainerRequest) GetVolumes() []*Volume { + if x != nil { + return x.Volumes + } + return nil +} + +func (x *StartContainerRequest) GetNetwork() string { + if x != nil { + return x.Network + } + return "" +} + +func (x *StartContainerRequest) GetCap() *StartContainerRequest_Capabilities { + if x != nil { + return x.Cap + } + return nil +} + +func (x *StartContainerRequest) GetRestart() *StartContainerRequest_Restart { + if x != nil { + return x.Restart + } + return nil +} + +func (x *StartContainerRequest) GetRunAs() *StartContainerRequest_RunAs { + if x != nil { + return x.RunAs + } + return nil +} + +type StartContainerResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Response: + // + // *StartContainerResponse_StartOk + // *StartContainerResponse_StartError + Response isStartContainerResponse_Response `protobuf_oneof:"response"` +} + +func (x *StartContainerResponse) Reset() { + *x = StartContainerResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_containerz_containerz_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StartContainerResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StartContainerResponse) ProtoMessage() {} + +func (x *StartContainerResponse) ProtoReflect() protoreflect.Message { + mi := &file_containerz_containerz_proto_msgTypes[17] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use StartContainerResponse.ProtoReflect.Descriptor instead. +func (*StartContainerResponse) Descriptor() ([]byte, []int) { + return file_containerz_containerz_proto_rawDescGZIP(), []int{17} +} + +func (m *StartContainerResponse) GetResponse() isStartContainerResponse_Response { + if m != nil { + return m.Response + } + return nil +} + +func (x *StartContainerResponse) GetStartOk() *StartOK { + if x, ok := x.GetResponse().(*StartContainerResponse_StartOk); ok { + return x.StartOk + } + return nil +} + +func (x *StartContainerResponse) GetStartError() *StartError { + if x, ok := x.GetResponse().(*StartContainerResponse_StartError); ok { + return x.StartError + } + return nil +} + +type isStartContainerResponse_Response interface { + isStartContainerResponse_Response() +} + +type StartContainerResponse_StartOk struct { + StartOk *StartOK `protobuf:"bytes,1,opt,name=start_ok,json=startOk,proto3,oneof"` +} + +type StartContainerResponse_StartError struct { + StartError *StartError `protobuf:"bytes,2,opt,name=start_error,json=startError,proto3,oneof"` +} + +func (*StartContainerResponse_StartOk) isStartContainerResponse_Response() {} + +func (*StartContainerResponse_StartError) isStartContainerResponse_Response() {} + +type StartOK struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + InstanceName string `protobuf:"bytes,1,opt,name=instance_name,json=instanceName,proto3" json:"instance_name,omitempty"` +} + +func (x *StartOK) Reset() { + *x = StartOK{} + if protoimpl.UnsafeEnabled { + mi := &file_containerz_containerz_proto_msgTypes[18] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StartOK) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StartOK) ProtoMessage() {} + +func (x *StartOK) ProtoReflect() protoreflect.Message { + mi := &file_containerz_containerz_proto_msgTypes[18] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use StartOK.ProtoReflect.Descriptor instead. +func (*StartOK) Descriptor() ([]byte, []int) { + return file_containerz_containerz_proto_rawDescGZIP(), []int{18} +} + +func (x *StartOK) GetInstanceName() string { + if x != nil { + return x.InstanceName + } + return "" +} + +type StartError struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ErrorCode StartError_Code `protobuf:"varint,1,opt,name=error_code,json=errorCode,proto3,enum=gnoi.containerz.StartError_Code" json:"error_code,omitempty"` + Details string `protobuf:"bytes,2,opt,name=details,proto3" json:"details,omitempty"` +} + +func (x *StartError) Reset() { + *x = StartError{} + if protoimpl.UnsafeEnabled { + mi := &file_containerz_containerz_proto_msgTypes[19] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StartError) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StartError) ProtoMessage() {} + +func (x *StartError) ProtoReflect() protoreflect.Message { + mi := &file_containerz_containerz_proto_msgTypes[19] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use StartError.ProtoReflect.Descriptor instead. +func (*StartError) Descriptor() ([]byte, []int) { + return file_containerz_containerz_proto_rawDescGZIP(), []int{19} +} + +func (x *StartError) GetErrorCode() StartError_Code { + if x != nil { + return x.ErrorCode + } + return StartError_UNSPECIFIED +} + +func (x *StartError) GetDetails() string { + if x != nil { + return x.Details + } + return "" +} + +type StopContainerRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + InstanceName string `protobuf:"bytes,1,opt,name=instance_name,json=instanceName,proto3" json:"instance_name,omitempty"` + Force bool `protobuf:"varint,2,opt,name=force,proto3" json:"force,omitempty"` + Restart bool `protobuf:"varint,3,opt,name=restart,proto3" json:"restart,omitempty"` +} + +func (x *StopContainerRequest) Reset() { + *x = StopContainerRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_containerz_containerz_proto_msgTypes[20] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StopContainerRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StopContainerRequest) ProtoMessage() {} + +func (x *StopContainerRequest) ProtoReflect() protoreflect.Message { + mi := &file_containerz_containerz_proto_msgTypes[20] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use StopContainerRequest.ProtoReflect.Descriptor instead. +func (*StopContainerRequest) Descriptor() ([]byte, []int) { + return file_containerz_containerz_proto_rawDescGZIP(), []int{20} +} + +func (x *StopContainerRequest) GetInstanceName() string { + if x != nil { + return x.InstanceName + } + return "" +} + +func (x *StopContainerRequest) GetForce() bool { + if x != nil { + return x.Force + } + return false +} + +func (x *StopContainerRequest) GetRestart() bool { + if x != nil { + return x.Restart + } + return false +} + +type StopContainerResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Code StopContainerResponse_Code `protobuf:"varint,1,opt,name=code,proto3,enum=gnoi.containerz.StopContainerResponse_Code" json:"code,omitempty"` + Details string `protobuf:"bytes,2,opt,name=details,proto3" json:"details,omitempty"` +} + +func (x *StopContainerResponse) Reset() { + *x = StopContainerResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_containerz_containerz_proto_msgTypes[21] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StopContainerResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StopContainerResponse) ProtoMessage() {} + +func (x *StopContainerResponse) ProtoReflect() protoreflect.Message { + mi := &file_containerz_containerz_proto_msgTypes[21] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use StopContainerResponse.ProtoReflect.Descriptor instead. +func (*StopContainerResponse) Descriptor() ([]byte, []int) { + return file_containerz_containerz_proto_rawDescGZIP(), []int{21} +} + +func (x *StopContainerResponse) GetCode() StopContainerResponse_Code { + if x != nil { + return x.Code + } + return StopContainerResponse_UNSPECIFIED +} + +func (x *StopContainerResponse) GetDetails() string { + if x != nil { + return x.Details + } + return "" +} + +type UpdateContainerRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + InstanceName string `protobuf:"bytes,1,opt,name=instance_name,json=instanceName,proto3" json:"instance_name,omitempty"` + ImageName string `protobuf:"bytes,2,opt,name=image_name,json=imageName,proto3" json:"image_name,omitempty"` + ImageTag string `protobuf:"bytes,3,opt,name=image_tag,json=imageTag,proto3" json:"image_tag,omitempty"` + Params *StartContainerRequest `protobuf:"bytes,4,opt,name=params,proto3" json:"params,omitempty"` + Async bool `protobuf:"varint,5,opt,name=async,proto3" json:"async,omitempty"` +} + +func (x *UpdateContainerRequest) Reset() { + *x = UpdateContainerRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_containerz_containerz_proto_msgTypes[22] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateContainerRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateContainerRequest) ProtoMessage() {} + +func (x *UpdateContainerRequest) ProtoReflect() protoreflect.Message { + mi := &file_containerz_containerz_proto_msgTypes[22] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpdateContainerRequest.ProtoReflect.Descriptor instead. +func (*UpdateContainerRequest) Descriptor() ([]byte, []int) { + return file_containerz_containerz_proto_rawDescGZIP(), []int{22} +} + +func (x *UpdateContainerRequest) GetInstanceName() string { + if x != nil { + return x.InstanceName + } + return "" +} + +func (x *UpdateContainerRequest) GetImageName() string { + if x != nil { + return x.ImageName + } + return "" +} + +func (x *UpdateContainerRequest) GetImageTag() string { + if x != nil { + return x.ImageTag + } + return "" +} + +func (x *UpdateContainerRequest) GetParams() *StartContainerRequest { + if x != nil { + return x.Params + } + return nil +} + +func (x *UpdateContainerRequest) GetAsync() bool { + if x != nil { + return x.Async + } + return false +} + +type UpdateContainerResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Response: + // + // *UpdateContainerResponse_UpdateOk + // *UpdateContainerResponse_UpdateError + Response isUpdateContainerResponse_Response `protobuf_oneof:"response"` +} + +func (x *UpdateContainerResponse) Reset() { + *x = UpdateContainerResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_containerz_containerz_proto_msgTypes[23] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateContainerResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateContainerResponse) ProtoMessage() {} + +func (x *UpdateContainerResponse) ProtoReflect() protoreflect.Message { + mi := &file_containerz_containerz_proto_msgTypes[23] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpdateContainerResponse.ProtoReflect.Descriptor instead. +func (*UpdateContainerResponse) Descriptor() ([]byte, []int) { + return file_containerz_containerz_proto_rawDescGZIP(), []int{23} +} + +func (m *UpdateContainerResponse) GetResponse() isUpdateContainerResponse_Response { + if m != nil { + return m.Response + } + return nil +} + +func (x *UpdateContainerResponse) GetUpdateOk() *UpdateOK { + if x, ok := x.GetResponse().(*UpdateContainerResponse_UpdateOk); ok { + return x.UpdateOk + } + return nil +} + +func (x *UpdateContainerResponse) GetUpdateError() *UpdateError { + if x, ok := x.GetResponse().(*UpdateContainerResponse_UpdateError); ok { + return x.UpdateError + } + return nil +} + +type isUpdateContainerResponse_Response interface { + isUpdateContainerResponse_Response() +} + +type UpdateContainerResponse_UpdateOk struct { + UpdateOk *UpdateOK `protobuf:"bytes,1,opt,name=update_ok,json=updateOk,proto3,oneof"` +} + +type UpdateContainerResponse_UpdateError struct { + UpdateError *UpdateError `protobuf:"bytes,2,opt,name=update_error,json=updateError,proto3,oneof"` +} + +func (*UpdateContainerResponse_UpdateOk) isUpdateContainerResponse_Response() {} + +func (*UpdateContainerResponse_UpdateError) isUpdateContainerResponse_Response() {} + +type UpdateOK struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + InstanceName string `protobuf:"bytes,1,opt,name=instance_name,json=instanceName,proto3" json:"instance_name,omitempty"` + IsAsync bool `protobuf:"varint,2,opt,name=is_async,json=isAsync,proto3" json:"is_async,omitempty"` +} + +func (x *UpdateOK) Reset() { + *x = UpdateOK{} + if protoimpl.UnsafeEnabled { + mi := &file_containerz_containerz_proto_msgTypes[24] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateOK) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateOK) ProtoMessage() {} + +func (x *UpdateOK) ProtoReflect() protoreflect.Message { + mi := &file_containerz_containerz_proto_msgTypes[24] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpdateOK.ProtoReflect.Descriptor instead. +func (*UpdateOK) Descriptor() ([]byte, []int) { + return file_containerz_containerz_proto_rawDescGZIP(), []int{24} +} + +func (x *UpdateOK) GetInstanceName() string { + if x != nil { + return x.InstanceName + } + return "" +} + +func (x *UpdateOK) GetIsAsync() bool { + if x != nil { + return x.IsAsync + } + return false +} + +type UpdateError struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ErrorCode UpdateError_Code `protobuf:"varint,1,opt,name=error_code,json=errorCode,proto3,enum=gnoi.containerz.UpdateError_Code" json:"error_code,omitempty"` + Details string `protobuf:"bytes,2,opt,name=details,proto3" json:"details,omitempty"` +} + +func (x *UpdateError) Reset() { + *x = UpdateError{} + if protoimpl.UnsafeEnabled { + mi := &file_containerz_containerz_proto_msgTypes[25] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateError) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateError) ProtoMessage() {} + +func (x *UpdateError) ProtoReflect() protoreflect.Message { + mi := &file_containerz_containerz_proto_msgTypes[25] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpdateError.ProtoReflect.Descriptor instead. +func (*UpdateError) Descriptor() ([]byte, []int) { + return file_containerz_containerz_proto_rawDescGZIP(), []int{25} +} + +func (x *UpdateError) GetErrorCode() UpdateError_Code { + if x != nil { + return x.ErrorCode + } + return UpdateError_UNSPECIFIED +} + +func (x *UpdateError) GetDetails() string { + if x != nil { + return x.Details + } + return "" +} + +type LogRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + InstanceName string `protobuf:"bytes,1,opt,name=instance_name,json=instanceName,proto3" json:"instance_name,omitempty"` + Follow bool `protobuf:"varint,2,opt,name=follow,proto3" json:"follow,omitempty"` +} + +func (x *LogRequest) Reset() { + *x = LogRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_containerz_containerz_proto_msgTypes[26] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LogRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LogRequest) ProtoMessage() {} + +func (x *LogRequest) ProtoReflect() protoreflect.Message { + mi := &file_containerz_containerz_proto_msgTypes[26] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use LogRequest.ProtoReflect.Descriptor instead. +func (*LogRequest) Descriptor() ([]byte, []int) { + return file_containerz_containerz_proto_rawDescGZIP(), []int{26} +} + +func (x *LogRequest) GetInstanceName() string { + if x != nil { + return x.InstanceName + } + return "" +} + +func (x *LogRequest) GetFollow() bool { + if x != nil { + return x.Follow + } + return false +} + +type LogResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Msg string `protobuf:"bytes,1,opt,name=msg,proto3" json:"msg,omitempty"` +} + +func (x *LogResponse) Reset() { + *x = LogResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_containerz_containerz_proto_msgTypes[27] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LogResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LogResponse) ProtoMessage() {} + +func (x *LogResponse) ProtoReflect() protoreflect.Message { + mi := &file_containerz_containerz_proto_msgTypes[27] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use LogResponse.ProtoReflect.Descriptor instead. +func (*LogResponse) Descriptor() ([]byte, []int) { + return file_containerz_containerz_proto_rawDescGZIP(), []int{27} +} + +func (x *LogResponse) GetMsg() string { + if x != nil { + return x.Msg + } + return "" +} + +type LocalDriverOptions struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Type LocalDriverOptions_Type `protobuf:"varint,1,opt,name=type,proto3,enum=gnoi.containerz.LocalDriverOptions_Type" json:"type,omitempty"` + Options []string `protobuf:"bytes,2,rep,name=options,proto3" json:"options,omitempty"` + Mountpoint string `protobuf:"bytes,3,opt,name=mountpoint,proto3" json:"mountpoint,omitempty"` +} + +func (x *LocalDriverOptions) Reset() { + *x = LocalDriverOptions{} + if protoimpl.UnsafeEnabled { + mi := &file_containerz_containerz_proto_msgTypes[28] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LocalDriverOptions) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LocalDriverOptions) ProtoMessage() {} + +func (x *LocalDriverOptions) ProtoReflect() protoreflect.Message { + mi := &file_containerz_containerz_proto_msgTypes[28] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use LocalDriverOptions.ProtoReflect.Descriptor instead. +func (*LocalDriverOptions) Descriptor() ([]byte, []int) { + return file_containerz_containerz_proto_rawDescGZIP(), []int{28} +} + +func (x *LocalDriverOptions) GetType() LocalDriverOptions_Type { + if x != nil { + return x.Type + } + return LocalDriverOptions_TYPE_UNSPECIFIED +} + +func (x *LocalDriverOptions) GetOptions() []string { + if x != nil { + return x.Options + } + return nil +} + +func (x *LocalDriverOptions) GetMountpoint() string { + if x != nil { + return x.Mountpoint + } + return "" +} + +type CreateVolumeRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Driver Driver `protobuf:"varint,2,opt,name=driver,proto3,enum=gnoi.containerz.Driver" json:"driver,omitempty"` + // Types that are assignable to Options: + // + // *CreateVolumeRequest_LocalMountOptions + Options isCreateVolumeRequest_Options `protobuf_oneof:"options"` + Labels map[string]string `protobuf:"bytes,4,rep,name=labels,proto3" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +func (x *CreateVolumeRequest) Reset() { + *x = CreateVolumeRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_containerz_containerz_proto_msgTypes[29] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateVolumeRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateVolumeRequest) ProtoMessage() {} + +func (x *CreateVolumeRequest) ProtoReflect() protoreflect.Message { + mi := &file_containerz_containerz_proto_msgTypes[29] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateVolumeRequest.ProtoReflect.Descriptor instead. +func (*CreateVolumeRequest) Descriptor() ([]byte, []int) { + return file_containerz_containerz_proto_rawDescGZIP(), []int{29} +} + +func (x *CreateVolumeRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *CreateVolumeRequest) GetDriver() Driver { + if x != nil { + return x.Driver + } + return Driver_DS_UNSPECIFIED +} + +func (m *CreateVolumeRequest) GetOptions() isCreateVolumeRequest_Options { + if m != nil { + return m.Options + } + return nil +} + +func (x *CreateVolumeRequest) GetLocalMountOptions() *LocalDriverOptions { + if x, ok := x.GetOptions().(*CreateVolumeRequest_LocalMountOptions); ok { + return x.LocalMountOptions + } + return nil +} + +func (x *CreateVolumeRequest) GetLabels() map[string]string { + if x != nil { + return x.Labels + } + return nil +} + +type isCreateVolumeRequest_Options interface { + isCreateVolumeRequest_Options() +} + +type CreateVolumeRequest_LocalMountOptions struct { + LocalMountOptions *LocalDriverOptions `protobuf:"bytes,3,opt,name=local_mount_options,json=localMountOptions,proto3,oneof"` +} + +func (*CreateVolumeRequest_LocalMountOptions) isCreateVolumeRequest_Options() {} + +type CreateVolumeResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` +} + +func (x *CreateVolumeResponse) Reset() { + *x = CreateVolumeResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_containerz_containerz_proto_msgTypes[30] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateVolumeResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateVolumeResponse) ProtoMessage() {} + +func (x *CreateVolumeResponse) ProtoReflect() protoreflect.Message { + mi := &file_containerz_containerz_proto_msgTypes[30] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateVolumeResponse.ProtoReflect.Descriptor instead. +func (*CreateVolumeResponse) Descriptor() ([]byte, []int) { + return file_containerz_containerz_proto_rawDescGZIP(), []int{30} +} + +func (x *CreateVolumeResponse) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +type RemoveVolumeRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Force bool `protobuf:"varint,2,opt,name=force,proto3" json:"force,omitempty"` +} + +func (x *RemoveVolumeRequest) Reset() { + *x = RemoveVolumeRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_containerz_containerz_proto_msgTypes[31] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RemoveVolumeRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RemoveVolumeRequest) ProtoMessage() {} + +func (x *RemoveVolumeRequest) ProtoReflect() protoreflect.Message { + mi := &file_containerz_containerz_proto_msgTypes[31] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RemoveVolumeRequest.ProtoReflect.Descriptor instead. +func (*RemoveVolumeRequest) Descriptor() ([]byte, []int) { + return file_containerz_containerz_proto_rawDescGZIP(), []int{31} +} + +func (x *RemoveVolumeRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *RemoveVolumeRequest) GetForce() bool { + if x != nil { + return x.Force + } + return false +} + +type RemoveVolumeResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *RemoveVolumeResponse) Reset() { + *x = RemoveVolumeResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_containerz_containerz_proto_msgTypes[32] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RemoveVolumeResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RemoveVolumeResponse) ProtoMessage() {} + +func (x *RemoveVolumeResponse) ProtoReflect() protoreflect.Message { + mi := &file_containerz_containerz_proto_msgTypes[32] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RemoveVolumeResponse.ProtoReflect.Descriptor instead. +func (*RemoveVolumeResponse) Descriptor() ([]byte, []int) { + return file_containerz_containerz_proto_rawDescGZIP(), []int{32} +} + +type ListVolumeRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Filter []*ListVolumeRequest_Filter `protobuf:"bytes,1,rep,name=filter,proto3" json:"filter,omitempty"` +} + +func (x *ListVolumeRequest) Reset() { + *x = ListVolumeRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_containerz_containerz_proto_msgTypes[33] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListVolumeRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListVolumeRequest) ProtoMessage() {} + +func (x *ListVolumeRequest) ProtoReflect() protoreflect.Message { + mi := &file_containerz_containerz_proto_msgTypes[33] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListVolumeRequest.ProtoReflect.Descriptor instead. +func (*ListVolumeRequest) Descriptor() ([]byte, []int) { + return file_containerz_containerz_proto_rawDescGZIP(), []int{33} +} + +func (x *ListVolumeRequest) GetFilter() []*ListVolumeRequest_Filter { + if x != nil { + return x.Filter + } + return nil +} + +type ListVolumeResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Created *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=created,proto3" json:"created,omitempty"` + Driver string `protobuf:"bytes,3,opt,name=driver,proto3" json:"driver,omitempty"` + Options map[string]string `protobuf:"bytes,4,rep,name=options,proto3" json:"options,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + Labels map[string]string `protobuf:"bytes,5,rep,name=labels,proto3" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +func (x *ListVolumeResponse) Reset() { + *x = ListVolumeResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_containerz_containerz_proto_msgTypes[34] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListVolumeResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListVolumeResponse) ProtoMessage() {} + +func (x *ListVolumeResponse) ProtoReflect() protoreflect.Message { + mi := &file_containerz_containerz_proto_msgTypes[34] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListVolumeResponse.ProtoReflect.Descriptor instead. +func (*ListVolumeResponse) Descriptor() ([]byte, []int) { + return file_containerz_containerz_proto_rawDescGZIP(), []int{34} +} + +func (x *ListVolumeResponse) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *ListVolumeResponse) GetCreated() *timestamppb.Timestamp { + if x != nil { + return x.Created + } + return nil +} + +func (x *ListVolumeResponse) GetDriver() string { + if x != nil { + return x.Driver + } + return "" +} + +func (x *ListVolumeResponse) GetOptions() map[string]string { + if x != nil { + return x.Options + } + return nil +} + +func (x *ListVolumeResponse) GetLabels() map[string]string { + if x != nil { + return x.Labels + } + return nil +} + +type ListImageRequest_Filter struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` + Value []string `protobuf:"bytes,2,rep,name=value,proto3" json:"value,omitempty"` +} + +func (x *ListImageRequest_Filter) Reset() { + *x = ListImageRequest_Filter{} + if protoimpl.UnsafeEnabled { + mi := &file_containerz_containerz_proto_msgTypes[35] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListImageRequest_Filter) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListImageRequest_Filter) ProtoMessage() {} + +func (x *ListImageRequest_Filter) ProtoReflect() protoreflect.Message { + mi := &file_containerz_containerz_proto_msgTypes[35] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListImageRequest_Filter.ProtoReflect.Descriptor instead. +func (*ListImageRequest_Filter) Descriptor() ([]byte, []int) { + return file_containerz_containerz_proto_rawDescGZIP(), []int{11, 0} +} + +func (x *ListImageRequest_Filter) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +func (x *ListImageRequest_Filter) GetValue() []string { + if x != nil { + return x.Value + } + return nil +} + +type ListContainerRequest_Filter struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` + Value []string `protobuf:"bytes,2,rep,name=value,proto3" json:"value,omitempty"` +} + +func (x *ListContainerRequest_Filter) Reset() { + *x = ListContainerRequest_Filter{} + if protoimpl.UnsafeEnabled { + mi := &file_containerz_containerz_proto_msgTypes[36] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListContainerRequest_Filter) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListContainerRequest_Filter) ProtoMessage() {} + +func (x *ListContainerRequest_Filter) ProtoReflect() protoreflect.Message { + mi := &file_containerz_containerz_proto_msgTypes[36] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListContainerRequest_Filter.ProtoReflect.Descriptor instead. +func (*ListContainerRequest_Filter) Descriptor() ([]byte, []int) { + return file_containerz_containerz_proto_rawDescGZIP(), []int{13, 0} +} + +func (x *ListContainerRequest_Filter) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +func (x *ListContainerRequest_Filter) GetValue() []string { + if x != nil { + return x.Value + } + return nil +} + +type StartContainerRequest_Port struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Internal uint32 `protobuf:"varint,1,opt,name=internal,proto3" json:"internal,omitempty"` + External uint32 `protobuf:"varint,2,opt,name=external,proto3" json:"external,omitempty"` +} + +func (x *StartContainerRequest_Port) Reset() { + *x = StartContainerRequest_Port{} + if protoimpl.UnsafeEnabled { + mi := &file_containerz_containerz_proto_msgTypes[37] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StartContainerRequest_Port) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StartContainerRequest_Port) ProtoMessage() {} + +func (x *StartContainerRequest_Port) ProtoReflect() protoreflect.Message { + mi := &file_containerz_containerz_proto_msgTypes[37] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use StartContainerRequest_Port.ProtoReflect.Descriptor instead. +func (*StartContainerRequest_Port) Descriptor() ([]byte, []int) { + return file_containerz_containerz_proto_rawDescGZIP(), []int{16, 0} +} + +func (x *StartContainerRequest_Port) GetInternal() uint32 { + if x != nil { + return x.Internal + } + return 0 +} + +func (x *StartContainerRequest_Port) GetExternal() uint32 { + if x != nil { + return x.External + } + return 0 +} + +type StartContainerRequest_Capabilities struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Add []string `protobuf:"bytes,1,rep,name=add,proto3" json:"add,omitempty"` + Remove []string `protobuf:"bytes,2,rep,name=remove,proto3" json:"remove,omitempty"` +} + +func (x *StartContainerRequest_Capabilities) Reset() { + *x = StartContainerRequest_Capabilities{} + if protoimpl.UnsafeEnabled { + mi := &file_containerz_containerz_proto_msgTypes[39] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StartContainerRequest_Capabilities) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StartContainerRequest_Capabilities) ProtoMessage() {} + +func (x *StartContainerRequest_Capabilities) ProtoReflect() protoreflect.Message { + mi := &file_containerz_containerz_proto_msgTypes[39] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use StartContainerRequest_Capabilities.ProtoReflect.Descriptor instead. +func (*StartContainerRequest_Capabilities) Descriptor() ([]byte, []int) { + return file_containerz_containerz_proto_rawDescGZIP(), []int{16, 2} +} + +func (x *StartContainerRequest_Capabilities) GetAdd() []string { + if x != nil { + return x.Add + } + return nil +} + +func (x *StartContainerRequest_Capabilities) GetRemove() []string { + if x != nil { + return x.Remove + } + return nil +} + +type StartContainerRequest_Restart struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Policy StartContainerRequest_Restart_Policy `protobuf:"varint,1,opt,name=policy,proto3,enum=gnoi.containerz.StartContainerRequest_Restart_Policy" json:"policy,omitempty"` + Attempts uint32 `protobuf:"varint,2,opt,name=attempts,proto3" json:"attempts,omitempty"` +} + +func (x *StartContainerRequest_Restart) Reset() { + *x = StartContainerRequest_Restart{} + if protoimpl.UnsafeEnabled { + mi := &file_containerz_containerz_proto_msgTypes[40] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StartContainerRequest_Restart) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StartContainerRequest_Restart) ProtoMessage() {} + +func (x *StartContainerRequest_Restart) ProtoReflect() protoreflect.Message { + mi := &file_containerz_containerz_proto_msgTypes[40] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use StartContainerRequest_Restart.ProtoReflect.Descriptor instead. +func (*StartContainerRequest_Restart) Descriptor() ([]byte, []int) { + return file_containerz_containerz_proto_rawDescGZIP(), []int{16, 3} +} + +func (x *StartContainerRequest_Restart) GetPolicy() StartContainerRequest_Restart_Policy { + if x != nil { + return x.Policy + } + return StartContainerRequest_Restart_NONE +} + +func (x *StartContainerRequest_Restart) GetAttempts() uint32 { + if x != nil { + return x.Attempts + } + return 0 +} + +type StartContainerRequest_RunAs struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + User string `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"` + Group string `protobuf:"bytes,2,opt,name=group,proto3" json:"group,omitempty"` +} + +func (x *StartContainerRequest_RunAs) Reset() { + *x = StartContainerRequest_RunAs{} + if protoimpl.UnsafeEnabled { + mi := &file_containerz_containerz_proto_msgTypes[41] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StartContainerRequest_RunAs) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StartContainerRequest_RunAs) ProtoMessage() {} + +func (x *StartContainerRequest_RunAs) ProtoReflect() protoreflect.Message { + mi := &file_containerz_containerz_proto_msgTypes[41] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use StartContainerRequest_RunAs.ProtoReflect.Descriptor instead. +func (*StartContainerRequest_RunAs) Descriptor() ([]byte, []int) { + return file_containerz_containerz_proto_rawDescGZIP(), []int{16, 4} +} + +func (x *StartContainerRequest_RunAs) GetUser() string { + if x != nil { + return x.User + } + return "" +} + +func (x *StartContainerRequest_RunAs) GetGroup() string { + if x != nil { + return x.Group + } + return "" +} + +type ListVolumeRequest_Filter struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` + Value []string `protobuf:"bytes,2,rep,name=value,proto3" json:"value,omitempty"` +} + +func (x *ListVolumeRequest_Filter) Reset() { + *x = ListVolumeRequest_Filter{} + if protoimpl.UnsafeEnabled { + mi := &file_containerz_containerz_proto_msgTypes[43] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListVolumeRequest_Filter) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListVolumeRequest_Filter) ProtoMessage() {} + +func (x *ListVolumeRequest_Filter) ProtoReflect() protoreflect.Message { + mi := &file_containerz_containerz_proto_msgTypes[43] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListVolumeRequest_Filter.ProtoReflect.Descriptor instead. +func (*ListVolumeRequest_Filter) Descriptor() ([]byte, []int) { + return file_containerz_containerz_proto_rawDescGZIP(), []int{33, 0} +} + +func (x *ListVolumeRequest_Filter) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +func (x *ListVolumeRequest_Filter) GetValue() []string { + if x != nil { + return x.Value + } + return nil +} + +var File_containerz_containerz_proto protoreflect.FileDescriptor + +var file_containerz_containerz_proto_rawDesc = []byte{ + 0x0a, 0x1b, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x7a, 0x2f, 0x63, 0x6f, 0x6e, + 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x7a, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0f, 0x67, + 0x6e, 0x6f, 0x69, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x7a, 0x1a, 0x2e, + 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x63, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x67, 0x6e, 0x6f, 0x69, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, + 0x6e, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2c, + 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x63, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x67, 0x6e, 0x6f, 0x69, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, + 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, + 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x72, 0x70, 0x63, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xd2, 0x01, 0x0a, 0x0d, 0x44, 0x65, 0x70, 0x6c, 0x6f, + 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x47, 0x0a, 0x0e, 0x69, 0x6d, 0x61, 0x67, + 0x65, 0x5f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1e, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, + 0x72, 0x7a, 0x2e, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, + 0x48, 0x00, 0x52, 0x0d, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, + 0x72, 0x12, 0x1a, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0c, 0x48, 0x00, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x51, 0x0a, + 0x12, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x5f, + 0x65, 0x6e, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x67, 0x6e, 0x6f, 0x69, + 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x7a, 0x2e, 0x49, 0x6d, 0x61, 0x67, + 0x65, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x45, 0x6e, 0x64, 0x48, 0x00, 0x52, 0x10, + 0x69, 0x6d, 0x61, 0x67, 0x65, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x45, 0x6e, 0x64, + 0x42, 0x09, 0x0a, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x9a, 0x01, 0x0a, 0x0d, + 0x49, 0x6d, 0x61, 0x67, 0x65, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x12, 0x12, 0x0a, + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x12, 0x10, 0x0a, 0x03, 0x74, 0x61, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, + 0x74, 0x61, 0x67, 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, + 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x53, 0x69, + 0x7a, 0x65, 0x12, 0x44, 0x0a, 0x0f, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x5f, 0x64, 0x6f, 0x77, + 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6e, + 0x6f, 0x69, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, + 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x0e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, + 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x22, 0x12, 0x0a, 0x10, 0x49, 0x6d, 0x61, 0x67, + 0x65, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x45, 0x6e, 0x64, 0x22, 0xfe, 0x02, 0x0a, + 0x0e, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x57, 0x0a, 0x14, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, + 0x72, 0x5f, 0x72, 0x65, 0x61, 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, + 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x7a, 0x2e, + 0x49, 0x6d, 0x61, 0x67, 0x65, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x52, 0x65, 0x61, + 0x64, 0x79, 0x48, 0x00, 0x52, 0x12, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x54, 0x72, 0x61, 0x6e, 0x73, + 0x66, 0x65, 0x72, 0x52, 0x65, 0x61, 0x64, 0x79, 0x12, 0x60, 0x0a, 0x17, 0x69, 0x6d, 0x61, 0x67, + 0x65, 0x5f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x5f, 0x70, 0x72, 0x6f, 0x67, 0x72, + 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x67, 0x6e, 0x6f, 0x69, + 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x7a, 0x2e, 0x49, 0x6d, 0x61, 0x67, + 0x65, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, + 0x73, 0x48, 0x00, 0x52, 0x15, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, + 0x65, 0x72, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x12, 0x5d, 0x0a, 0x16, 0x69, 0x6d, + 0x61, 0x67, 0x65, 0x5f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x5f, 0x73, 0x75, 0x63, + 0x63, 0x65, 0x73, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x67, 0x6e, 0x6f, + 0x69, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x7a, 0x2e, 0x49, 0x6d, 0x61, + 0x67, 0x65, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, + 0x73, 0x48, 0x00, 0x52, 0x14, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, + 0x65, 0x72, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x46, 0x0a, 0x14, 0x69, 0x6d, 0x61, + 0x67, 0x65, 0x5f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x5f, 0x65, 0x72, 0x72, 0x6f, + 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x48, 0x00, 0x52, 0x12, 0x69, + 0x6d, 0x61, 0x67, 0x65, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x45, 0x72, 0x72, 0x6f, + 0x72, 0x42, 0x0a, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x33, 0x0a, + 0x12, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x52, 0x65, + 0x61, 0x64, 0x79, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x5f, 0x73, 0x69, 0x7a, + 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x53, 0x69, + 0x7a, 0x65, 0x22, 0x3e, 0x0a, 0x15, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x54, 0x72, 0x61, 0x6e, 0x73, + 0x66, 0x65, 0x72, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x12, 0x25, 0x0a, 0x0e, 0x62, + 0x79, 0x74, 0x65, 0x73, 0x5f, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x04, 0x52, 0x0d, 0x62, 0x79, 0x74, 0x65, 0x73, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, + 0x65, 0x64, 0x22, 0x5b, 0x0a, 0x14, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x54, 0x72, 0x61, 0x6e, 0x73, + 0x66, 0x65, 0x72, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x10, + 0x0a, 0x03, 0x74, 0x61, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x74, 0x61, 0x67, + 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x22, + 0x50, 0x0a, 0x12, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x74, 0x61, 0x67, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x74, 0x61, 0x67, 0x12, 0x14, 0x0a, 0x05, 0x66, + 0x6f, 0x72, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x66, 0x6f, 0x72, 0x63, + 0x65, 0x22, 0xbb, 0x01, 0x0a, 0x13, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x49, 0x6d, 0x61, 0x67, + 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3d, 0x0a, 0x04, 0x63, 0x6f, 0x64, + 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x29, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x63, + 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x7a, 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, + 0x49, 0x6d, 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x43, 0x6f, + 0x64, 0x65, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x64, 0x65, 0x74, 0x61, + 0x69, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, + 0x22, 0x4d, 0x0a, 0x04, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x0f, 0x0a, 0x0b, 0x55, 0x4e, 0x53, 0x50, + 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, + 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x01, 0x12, 0x0d, 0x0a, 0x09, 0x4e, 0x4f, 0x54, 0x5f, 0x46, 0x4f, + 0x55, 0x4e, 0x44, 0x10, 0x02, 0x12, 0x0b, 0x0a, 0x07, 0x52, 0x55, 0x4e, 0x4e, 0x49, 0x4e, 0x47, + 0x10, 0x03, 0x12, 0x0b, 0x0a, 0x07, 0x53, 0x55, 0x43, 0x43, 0x45, 0x53, 0x53, 0x10, 0x04, 0x22, + 0x54, 0x0a, 0x16, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, + 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x10, 0x0a, + 0x03, 0x74, 0x61, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x74, 0x61, 0x67, 0x12, + 0x14, 0x0a, 0x05, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, + 0x66, 0x6f, 0x72, 0x63, 0x65, 0x22, 0xb6, 0x01, 0x0a, 0x17, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, + 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x41, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, + 0x2d, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, + 0x7a, 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, + 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x04, + 0x63, 0x6f, 0x64, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x22, 0x40, 0x0a, 0x04, + 0x43, 0x6f, 0x64, 0x65, 0x12, 0x0f, 0x0a, 0x0b, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, + 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0d, 0x0a, 0x09, 0x4e, 0x4f, 0x54, 0x5f, 0x46, 0x4f, 0x55, + 0x4e, 0x44, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x52, 0x55, 0x4e, 0x4e, 0x49, 0x4e, 0x47, 0x10, + 0x02, 0x12, 0x0b, 0x0a, 0x07, 0x53, 0x55, 0x43, 0x43, 0x45, 0x53, 0x53, 0x10, 0x03, 0x22, 0x9c, + 0x01, 0x0a, 0x10, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x40, 0x0a, 0x06, 0x66, 0x69, 0x6c, + 0x74, 0x65, 0x72, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x67, 0x6e, 0x6f, 0x69, + 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x7a, 0x2e, 0x4c, 0x69, 0x73, 0x74, + 0x49, 0x6d, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x46, 0x69, 0x6c, + 0x74, 0x65, 0x72, 0x52, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x1a, 0x30, 0x0a, 0x06, 0x46, + 0x69, 0x6c, 0x74, 0x65, 0x72, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x54, 0x0a, + 0x11, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, + 0x69, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x4e, 0x61, 0x6d, + 0x65, 0x12, 0x10, 0x0a, 0x03, 0x74, 0x61, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, + 0x74, 0x61, 0x67, 0x22, 0xb6, 0x01, 0x0a, 0x14, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x74, + 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x10, 0x0a, 0x03, + 0x61, 0x6c, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x03, 0x61, 0x6c, 0x6c, 0x12, 0x14, + 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x6c, + 0x69, 0x6d, 0x69, 0x74, 0x12, 0x44, 0x0a, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x03, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x63, 0x6f, 0x6e, 0x74, + 0x61, 0x69, 0x6e, 0x65, 0x72, 0x7a, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x61, + 0x69, 0x6e, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x46, 0x69, 0x6c, 0x74, + 0x65, 0x72, 0x52, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x1a, 0x30, 0x0a, 0x06, 0x46, 0x69, + 0x6c, 0x74, 0x65, 0x72, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, + 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0xf2, 0x01, 0x0a, + 0x15, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x6d, + 0x61, 0x67, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, + 0x69, 0x6d, 0x61, 0x67, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x45, 0x0a, 0x06, 0x73, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2d, 0x2e, 0x67, 0x6e, 0x6f, 0x69, + 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x7a, 0x2e, 0x4c, 0x69, 0x73, 0x74, + 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x22, 0x4f, 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x0f, 0x0a, 0x0b, 0x55, 0x4e, + 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x53, + 0x54, 0x4f, 0x50, 0x50, 0x45, 0x44, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x52, 0x55, 0x4e, 0x4e, + 0x49, 0x4e, 0x47, 0x10, 0x02, 0x12, 0x0b, 0x0a, 0x07, 0x50, 0x52, 0x45, 0x53, 0x45, 0x4e, 0x54, + 0x10, 0x03, 0x12, 0x0d, 0x0a, 0x09, 0x4e, 0x4f, 0x54, 0x5f, 0x46, 0x4f, 0x55, 0x4e, 0x44, 0x10, + 0x04, 0x22, 0x5a, 0x0a, 0x06, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, + 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, + 0x1f, 0x0a, 0x0b, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x50, 0x6f, 0x69, 0x6e, 0x74, + 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x6f, 0x6e, 0x6c, 0x79, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x08, 0x52, 0x08, 0x72, 0x65, 0x61, 0x64, 0x4f, 0x6e, 0x6c, 0x79, 0x22, 0xe8, 0x07, + 0x0a, 0x15, 0x53, 0x74, 0x61, 0x72, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x6d, 0x61, 0x67, 0x65, + 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x69, 0x6d, 0x61, + 0x67, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x74, 0x61, 0x67, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x03, 0x74, 0x61, 0x67, 0x12, 0x10, 0x0a, 0x03, 0x63, 0x6d, 0x64, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x63, 0x6d, 0x64, 0x12, 0x23, 0x0a, 0x0d, 0x69, 0x6e, + 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0c, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, + 0x41, 0x0a, 0x05, 0x70, 0x6f, 0x72, 0x74, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2b, + 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x7a, + 0x2e, 0x53, 0x74, 0x61, 0x72, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x50, 0x6f, 0x72, 0x74, 0x52, 0x05, 0x70, 0x6f, 0x72, + 0x74, 0x73, 0x12, 0x59, 0x0a, 0x0b, 0x65, 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, + 0x74, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x37, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x63, + 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x7a, 0x2e, 0x53, 0x74, 0x61, 0x72, 0x74, 0x43, + 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, + 0x45, 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x45, 0x6e, 0x74, 0x72, 0x79, + 0x52, 0x0b, 0x65, 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x31, 0x0a, + 0x07, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17, + 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x7a, + 0x2e, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x52, 0x07, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x73, + 0x12, 0x18, 0x0a, 0x07, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x18, 0x08, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x07, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x12, 0x45, 0x0a, 0x03, 0x63, 0x61, + 0x70, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x33, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x63, + 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x7a, 0x2e, 0x53, 0x74, 0x61, 0x72, 0x74, 0x43, + 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, + 0x43, 0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x69, 0x65, 0x73, 0x52, 0x03, 0x63, 0x61, + 0x70, 0x12, 0x48, 0x0a, 0x07, 0x72, 0x65, 0x73, 0x74, 0x61, 0x72, 0x74, 0x18, 0x0a, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, + 0x6e, 0x65, 0x72, 0x7a, 0x2e, 0x53, 0x74, 0x61, 0x72, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, + 0x6e, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x52, 0x65, 0x73, 0x74, 0x61, + 0x72, 0x74, 0x52, 0x07, 0x72, 0x65, 0x73, 0x74, 0x61, 0x72, 0x74, 0x12, 0x43, 0x0a, 0x06, 0x72, + 0x75, 0x6e, 0x5f, 0x61, 0x73, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x67, 0x6e, + 0x6f, 0x69, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x7a, 0x2e, 0x53, 0x74, + 0x61, 0x72, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x2e, 0x52, 0x75, 0x6e, 0x41, 0x73, 0x52, 0x05, 0x72, 0x75, 0x6e, 0x41, 0x73, + 0x1a, 0x3e, 0x0a, 0x04, 0x50, 0x6f, 0x72, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x69, 0x6e, 0x74, 0x65, + 0x72, 0x6e, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x69, 0x6e, 0x74, 0x65, + 0x72, 0x6e, 0x61, 0x6c, 0x12, 0x1a, 0x0a, 0x08, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, + 0x1a, 0x3e, 0x0a, 0x10, 0x45, 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x45, + 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, + 0x1a, 0x38, 0x0a, 0x0c, 0x43, 0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x69, 0x65, 0x73, + 0x12, 0x10, 0x0a, 0x03, 0x61, 0x64, 0x64, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x03, 0x61, + 0x64, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x18, 0x02, 0x20, 0x03, + 0x28, 0x09, 0x52, 0x06, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x1a, 0xb8, 0x01, 0x0a, 0x07, 0x52, + 0x65, 0x73, 0x74, 0x61, 0x72, 0x74, 0x12, 0x4d, 0x0a, 0x06, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x35, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x63, 0x6f, + 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x7a, 0x2e, 0x53, 0x74, 0x61, 0x72, 0x74, 0x43, 0x6f, + 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x52, + 0x65, 0x73, 0x74, 0x61, 0x72, 0x74, 0x2e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, 0x06, 0x70, + 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0x1a, 0x0a, 0x08, 0x61, 0x74, 0x74, 0x65, 0x6d, 0x70, 0x74, + 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x61, 0x74, 0x74, 0x65, 0x6d, 0x70, 0x74, + 0x73, 0x22, 0x42, 0x0a, 0x06, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0x08, 0x0a, 0x04, 0x4e, + 0x4f, 0x4e, 0x45, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x41, 0x4c, 0x57, 0x41, 0x59, 0x53, 0x10, + 0x01, 0x12, 0x12, 0x0a, 0x0e, 0x55, 0x4e, 0x4c, 0x45, 0x53, 0x53, 0x5f, 0x53, 0x54, 0x4f, 0x50, + 0x50, 0x45, 0x44, 0x10, 0x02, 0x12, 0x0e, 0x0a, 0x0a, 0x4f, 0x4e, 0x5f, 0x46, 0x41, 0x49, 0x4c, + 0x55, 0x52, 0x45, 0x10, 0x03, 0x1a, 0x31, 0x0a, 0x05, 0x52, 0x75, 0x6e, 0x41, 0x73, 0x12, 0x12, + 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x75, 0x73, + 0x65, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x22, 0x9b, 0x01, 0x0a, 0x16, 0x53, 0x74, 0x61, + 0x72, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x35, 0x0a, 0x08, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x6f, 0x6b, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x63, 0x6f, 0x6e, + 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x7a, 0x2e, 0x53, 0x74, 0x61, 0x72, 0x74, 0x4f, 0x4b, 0x48, + 0x00, 0x52, 0x07, 0x73, 0x74, 0x61, 0x72, 0x74, 0x4f, 0x6b, 0x12, 0x3e, 0x0a, 0x0b, 0x73, 0x74, + 0x61, 0x72, 0x74, 0x5f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x1b, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, + 0x7a, 0x2e, 0x53, 0x74, 0x61, 0x72, 0x74, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x48, 0x00, 0x52, 0x0a, + 0x73, 0x74, 0x61, 0x72, 0x74, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x42, 0x0a, 0x0a, 0x08, 0x72, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2e, 0x0a, 0x07, 0x53, 0x74, 0x61, 0x72, 0x74, 0x4f, + 0x4b, 0x12, 0x23, 0x0a, 0x0d, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x6e, 0x61, + 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, + 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0xab, 0x01, 0x0a, 0x0a, 0x53, 0x74, 0x61, 0x72, 0x74, + 0x45, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x3f, 0x0a, 0x0a, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x63, + 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x20, 0x2e, 0x67, 0x6e, 0x6f, 0x69, + 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x7a, 0x2e, 0x53, 0x74, 0x61, 0x72, + 0x74, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x2e, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x09, 0x65, 0x72, 0x72, + 0x6f, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, + 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, + 0x22, 0x42, 0x0a, 0x04, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x0f, 0x0a, 0x0b, 0x55, 0x4e, 0x53, 0x50, + 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, + 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x01, 0x12, 0x0d, 0x0a, 0x09, 0x4e, 0x4f, 0x54, 0x5f, 0x46, 0x4f, + 0x55, 0x4e, 0x44, 0x10, 0x02, 0x12, 0x0d, 0x0a, 0x09, 0x50, 0x4f, 0x52, 0x54, 0x5f, 0x55, 0x53, + 0x45, 0x44, 0x10, 0x03, 0x22, 0x6b, 0x0a, 0x14, 0x53, 0x74, 0x6f, 0x70, 0x43, 0x6f, 0x6e, 0x74, + 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x23, 0x0a, 0x0d, + 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0c, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x4e, 0x61, 0x6d, + 0x65, 0x12, 0x14, 0x0a, 0x05, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, + 0x52, 0x05, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x65, 0x73, 0x74, 0x61, + 0x72, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x72, 0x65, 0x73, 0x74, 0x61, 0x72, + 0x74, 0x22, 0xb1, 0x01, 0x0a, 0x15, 0x53, 0x74, 0x6f, 0x70, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, + 0x6e, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3f, 0x0a, 0x04, 0x63, + 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2b, 0x2e, 0x67, 0x6e, 0x6f, 0x69, + 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x7a, 0x2e, 0x53, 0x74, 0x6f, 0x70, + 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x2e, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x18, 0x0a, 0x07, + 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x64, + 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x22, 0x3d, 0x0a, 0x04, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x0f, + 0x0a, 0x0b, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, + 0x08, 0x0a, 0x04, 0x42, 0x55, 0x53, 0x59, 0x10, 0x01, 0x12, 0x0d, 0x0a, 0x09, 0x4e, 0x4f, 0x54, + 0x5f, 0x46, 0x4f, 0x55, 0x4e, 0x44, 0x10, 0x02, 0x12, 0x0b, 0x0a, 0x07, 0x53, 0x55, 0x43, 0x43, + 0x45, 0x53, 0x53, 0x10, 0x03, 0x22, 0xcf, 0x01, 0x0a, 0x16, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x23, 0x0a, 0x0d, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, + 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, + 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x5f, 0x6e, + 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x69, 0x6d, 0x61, 0x67, 0x65, + 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x61, + 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x54, 0x61, + 0x67, 0x12, 0x3e, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x26, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, + 0x65, 0x72, 0x7a, 0x2e, 0x53, 0x74, 0x61, 0x72, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, + 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, + 0x73, 0x12, 0x14, 0x0a, 0x05, 0x61, 0x73, 0x79, 0x6e, 0x63, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, + 0x52, 0x05, 0x61, 0x73, 0x79, 0x6e, 0x63, 0x22, 0xa2, 0x01, 0x0a, 0x17, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x38, 0x0a, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6f, 0x6b, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x63, 0x6f, + 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x7a, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4f, + 0x4b, 0x48, 0x00, 0x52, 0x08, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4f, 0x6b, 0x12, 0x41, 0x0a, + 0x0c, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, + 0x69, 0x6e, 0x65, 0x72, 0x7a, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x45, 0x72, 0x72, 0x6f, + 0x72, 0x48, 0x00, 0x52, 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x45, 0x72, 0x72, 0x6f, 0x72, + 0x42, 0x0a, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x4a, 0x0a, 0x08, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4f, 0x4b, 0x12, 0x23, 0x0a, 0x0d, 0x69, 0x6e, 0x73, 0x74, + 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0c, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x19, 0x0a, + 0x08, 0x69, 0x73, 0x5f, 0x61, 0x73, 0x79, 0x6e, 0x63, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x07, 0x69, 0x73, 0x41, 0x73, 0x79, 0x6e, 0x63, 0x22, 0xcf, 0x01, 0x0a, 0x0b, 0x55, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x40, 0x0a, 0x0a, 0x65, 0x72, 0x72, 0x6f, + 0x72, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x21, 0x2e, 0x67, + 0x6e, 0x6f, 0x69, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x7a, 0x2e, 0x55, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x2e, 0x43, 0x6f, 0x64, 0x65, 0x52, + 0x09, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x64, 0x65, + 0x74, 0x61, 0x69, 0x6c, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x64, 0x65, 0x74, + 0x61, 0x69, 0x6c, 0x73, 0x22, 0x64, 0x0a, 0x04, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x0f, 0x0a, 0x0b, + 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0d, 0x0a, + 0x09, 0x4e, 0x4f, 0x54, 0x5f, 0x46, 0x4f, 0x55, 0x4e, 0x44, 0x10, 0x01, 0x12, 0x0d, 0x0a, 0x09, + 0x50, 0x4f, 0x52, 0x54, 0x5f, 0x55, 0x53, 0x45, 0x44, 0x10, 0x02, 0x12, 0x0f, 0x0a, 0x0b, 0x4e, + 0x4f, 0x54, 0x5f, 0x52, 0x55, 0x4e, 0x4e, 0x49, 0x4e, 0x47, 0x10, 0x03, 0x12, 0x0f, 0x0a, 0x0b, + 0x4e, 0x4f, 0x54, 0x5f, 0x55, 0x50, 0x44, 0x41, 0x54, 0x45, 0x44, 0x10, 0x04, 0x12, 0x0b, 0x0a, + 0x07, 0x46, 0x41, 0x49, 0x4c, 0x55, 0x52, 0x45, 0x10, 0x05, 0x22, 0x49, 0x0a, 0x0a, 0x4c, 0x6f, + 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x69, 0x6e, 0x73, 0x74, + 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0c, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, + 0x06, 0x66, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x66, + 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x22, 0x1f, 0x0a, 0x0b, 0x4c, 0x6f, 0x67, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6d, 0x73, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x03, 0x6d, 0x73, 0x67, 0x22, 0xb9, 0x01, 0x0a, 0x12, 0x4c, 0x6f, 0x63, 0x61, 0x6c, + 0x44, 0x72, 0x69, 0x76, 0x65, 0x72, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x3c, 0x0a, + 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x28, 0x2e, 0x67, 0x6e, + 0x6f, 0x69, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x7a, 0x2e, 0x4c, 0x6f, + 0x63, 0x61, 0x6c, 0x44, 0x72, 0x69, 0x76, 0x65, 0x72, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6f, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x6f, 0x70, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x1e, 0x0a, 0x0a, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x70, 0x6f, + 0x69, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x6d, 0x6f, 0x75, 0x6e, 0x74, + 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x22, 0x2b, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, + 0x10, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, + 0x44, 0x10, 0x00, 0x12, 0x0d, 0x0a, 0x09, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4e, 0x4f, 0x4e, 0x45, + 0x10, 0x01, 0x22, 0xc1, 0x02, 0x0a, 0x13, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x56, 0x6f, 0x6c, + 0x75, 0x6d, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x2f, + 0x0a, 0x06, 0x64, 0x72, 0x69, 0x76, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x17, + 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x7a, + 0x2e, 0x44, 0x72, 0x69, 0x76, 0x65, 0x72, 0x52, 0x06, 0x64, 0x72, 0x69, 0x76, 0x65, 0x72, 0x12, + 0x55, 0x0a, 0x13, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x5f, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x6f, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x67, + 0x6e, 0x6f, 0x69, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x7a, 0x2e, 0x4c, + 0x6f, 0x63, 0x61, 0x6c, 0x44, 0x72, 0x69, 0x76, 0x65, 0x72, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x48, 0x00, 0x52, 0x11, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x4d, 0x6f, 0x75, 0x6e, 0x74, 0x4f, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x48, 0x0a, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, + 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x30, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x63, 0x6f, + 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x7a, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x56, + 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x4c, 0x61, 0x62, + 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, + 0x1a, 0x39, 0x0a, 0x0b, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, + 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, + 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, 0x09, 0x0a, 0x07, 0x6f, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x2a, 0x0a, 0x14, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x12, + 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x22, 0x3f, 0x0a, 0x13, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x56, 0x6f, 0x6c, 0x75, + 0x6d, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, + 0x05, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x66, 0x6f, + 0x72, 0x63, 0x65, 0x22, 0x16, 0x0a, 0x14, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x56, 0x6f, 0x6c, + 0x75, 0x6d, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x88, 0x01, 0x0a, 0x11, + 0x4c, 0x69, 0x73, 0x74, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x41, 0x0a, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x01, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x29, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, + 0x65, 0x72, 0x7a, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x52, 0x06, 0x66, 0x69, + 0x6c, 0x74, 0x65, 0x72, 0x1a, 0x30, 0x0a, 0x06, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x12, 0x10, + 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, + 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x82, 0x03, 0x0a, 0x12, 0x4c, 0x69, 0x73, 0x74, 0x56, + 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x12, 0x0a, + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x12, 0x34, 0x0a, 0x07, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x07, + 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x64, 0x72, 0x69, 0x76, 0x65, + 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x72, 0x69, 0x76, 0x65, 0x72, 0x12, + 0x4a, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x30, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, + 0x72, 0x7a, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x45, 0x6e, 0x74, + 0x72, 0x79, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x47, 0x0a, 0x06, 0x6c, + 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x67, 0x6e, + 0x6f, 0x69, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x7a, 0x2e, 0x4c, 0x69, + 0x73, 0x74, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x6c, 0x61, + 0x62, 0x65, 0x6c, 0x73, 0x1a, 0x3a, 0x0a, 0x0c, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x45, + 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, + 0x1a, 0x39, 0x0a, 0x0b, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, + 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, + 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x2a, 0x2a, 0x0a, 0x06, 0x44, + 0x72, 0x69, 0x76, 0x65, 0x72, 0x12, 0x12, 0x0a, 0x0e, 0x44, 0x53, 0x5f, 0x55, 0x4e, 0x53, 0x50, + 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0c, 0x0a, 0x08, 0x44, 0x53, 0x5f, + 0x4c, 0x4f, 0x43, 0x41, 0x4c, 0x10, 0x01, 0x32, 0xeb, 0x08, 0x0a, 0x0a, 0x43, 0x6f, 0x6e, 0x74, + 0x61, 0x69, 0x6e, 0x65, 0x72, 0x7a, 0x12, 0x4f, 0x0a, 0x06, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, + 0x12, 0x1e, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, + 0x72, 0x7a, 0x2e, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x1f, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, + 0x72, 0x7a, 0x2e, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x00, 0x28, 0x01, 0x30, 0x01, 0x12, 0x56, 0x0a, 0x09, 0x4c, 0x69, 0x73, 0x74, 0x49, + 0x6d, 0x61, 0x67, 0x65, 0x12, 0x21, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x63, 0x6f, 0x6e, 0x74, + 0x61, 0x69, 0x6e, 0x65, 0x72, 0x7a, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x6d, 0x61, 0x67, 0x65, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x63, + 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x7a, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x6d, + 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x30, 0x01, 0x12, + 0x5a, 0x0a, 0x0b, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x12, 0x23, + 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x7a, + 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, + 0x69, 0x6e, 0x65, 0x72, 0x7a, 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x49, 0x6d, 0x61, 0x67, + 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x66, 0x0a, 0x0f, 0x52, + 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x12, 0x27, + 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x7a, + 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x63, + 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x7a, 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, + 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x00, 0x12, 0x62, 0x0a, 0x0d, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x61, + 0x69, 0x6e, 0x65, 0x72, 0x12, 0x25, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x63, 0x6f, 0x6e, 0x74, + 0x61, 0x69, 0x6e, 0x65, 0x72, 0x7a, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x61, + 0x69, 0x6e, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x67, 0x6e, + 0x6f, 0x69, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x7a, 0x2e, 0x4c, 0x69, + 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x00, 0x30, 0x01, 0x12, 0x63, 0x0a, 0x0e, 0x53, 0x74, 0x61, 0x72, 0x74, + 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x12, 0x26, 0x2e, 0x67, 0x6e, 0x6f, 0x69, + 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x7a, 0x2e, 0x53, 0x74, 0x61, 0x72, + 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x27, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, + 0x65, 0x72, 0x7a, 0x2e, 0x53, 0x74, 0x61, 0x72, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, + 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x60, 0x0a, 0x0d, + 0x53, 0x74, 0x6f, 0x70, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x12, 0x25, 0x2e, + 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x7a, 0x2e, + 0x53, 0x74, 0x6f, 0x70, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x63, 0x6f, 0x6e, 0x74, + 0x61, 0x69, 0x6e, 0x65, 0x72, 0x7a, 0x2e, 0x53, 0x74, 0x6f, 0x70, 0x43, 0x6f, 0x6e, 0x74, 0x61, + 0x69, 0x6e, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x66, + 0x0a, 0x0f, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, + 0x72, 0x12, 0x27, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, + 0x65, 0x72, 0x7a, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, + 0x6e, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x67, 0x6e, 0x6f, + 0x69, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x7a, 0x2e, 0x55, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x44, 0x0a, 0x03, 0x4c, 0x6f, 0x67, 0x12, 0x1b, 0x2e, + 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x7a, 0x2e, + 0x4c, 0x6f, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x67, 0x6e, 0x6f, + 0x69, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x7a, 0x2e, 0x4c, 0x6f, 0x67, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x30, 0x01, 0x12, 0x5d, 0x0a, 0x0c, + 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x12, 0x24, 0x2e, 0x67, + 0x6e, 0x6f, 0x69, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x7a, 0x2e, 0x43, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, + 0x6e, 0x65, 0x72, 0x7a, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x56, 0x6f, 0x6c, 0x75, 0x6d, + 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x5d, 0x0a, 0x0c, 0x52, + 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x12, 0x24, 0x2e, 0x67, 0x6e, + 0x6f, 0x69, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x7a, 0x2e, 0x52, 0x65, + 0x6d, 0x6f, 0x76, 0x65, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x25, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, + 0x65, 0x72, 0x7a, 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x59, 0x0a, 0x0a, 0x4c, 0x69, + 0x73, 0x74, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x12, 0x22, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, + 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x7a, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x56, + 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x67, + 0x6e, 0x6f, 0x69, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x7a, 0x2e, 0x4c, + 0x69, 0x73, 0x74, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x00, 0x30, 0x01, 0x42, 0x2f, 0xd2, 0x3e, 0x05, 0x30, 0x2e, 0x31, 0x2e, 0x32, 0x5a, + 0x25, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x70, 0x65, 0x6e, + 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x67, 0x6e, 0x6f, 0x69, 0x2f, 0x63, 0x6f, 0x6e, 0x74, + 0x61, 0x69, 0x6e, 0x65, 0x72, 0x7a, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_containerz_containerz_proto_rawDescOnce sync.Once + file_containerz_containerz_proto_rawDescData = file_containerz_containerz_proto_rawDesc +) + +func file_containerz_containerz_proto_rawDescGZIP() []byte { + file_containerz_containerz_proto_rawDescOnce.Do(func() { + file_containerz_containerz_proto_rawDescData = protoimpl.X.CompressGZIP(file_containerz_containerz_proto_rawDescData) + }) + return file_containerz_containerz_proto_rawDescData +} + +var file_containerz_containerz_proto_enumTypes = make([]protoimpl.EnumInfo, 9) +var file_containerz_containerz_proto_msgTypes = make([]protoimpl.MessageInfo, 46) +var file_containerz_containerz_proto_goTypes = []interface{}{ + (Driver)(0), // 0: gnoi.containerz.Driver + (RemoveImageResponse_Code)(0), // 1: gnoi.containerz.RemoveImageResponse.Code + (RemoveContainerResponse_Code)(0), // 2: gnoi.containerz.RemoveContainerResponse.Code + (ListContainerResponse_Status)(0), // 3: gnoi.containerz.ListContainerResponse.Status + (StartContainerRequest_Restart_Policy)(0), // 4: gnoi.containerz.StartContainerRequest.Restart.Policy + (StartError_Code)(0), // 5: gnoi.containerz.StartError.Code + (StopContainerResponse_Code)(0), // 6: gnoi.containerz.StopContainerResponse.Code + (UpdateError_Code)(0), // 7: gnoi.containerz.UpdateError.Code + (LocalDriverOptions_Type)(0), // 8: gnoi.containerz.LocalDriverOptions.Type + (*DeployRequest)(nil), // 9: gnoi.containerz.DeployRequest + (*ImageTransfer)(nil), // 10: gnoi.containerz.ImageTransfer + (*ImageTransferEnd)(nil), // 11: gnoi.containerz.ImageTransferEnd + (*DeployResponse)(nil), // 12: gnoi.containerz.DeployResponse + (*ImageTransferReady)(nil), // 13: gnoi.containerz.ImageTransferReady + (*ImageTransferProgress)(nil), // 14: gnoi.containerz.ImageTransferProgress + (*ImageTransferSuccess)(nil), // 15: gnoi.containerz.ImageTransferSuccess + (*RemoveImageRequest)(nil), // 16: gnoi.containerz.RemoveImageRequest + (*RemoveImageResponse)(nil), // 17: gnoi.containerz.RemoveImageResponse + (*RemoveContainerRequest)(nil), // 18: gnoi.containerz.RemoveContainerRequest + (*RemoveContainerResponse)(nil), // 19: gnoi.containerz.RemoveContainerResponse + (*ListImageRequest)(nil), // 20: gnoi.containerz.ListImageRequest + (*ListImageResponse)(nil), // 21: gnoi.containerz.ListImageResponse + (*ListContainerRequest)(nil), // 22: gnoi.containerz.ListContainerRequest + (*ListContainerResponse)(nil), // 23: gnoi.containerz.ListContainerResponse + (*Volume)(nil), // 24: gnoi.containerz.Volume + (*StartContainerRequest)(nil), // 25: gnoi.containerz.StartContainerRequest + (*StartContainerResponse)(nil), // 26: gnoi.containerz.StartContainerResponse + (*StartOK)(nil), // 27: gnoi.containerz.StartOK + (*StartError)(nil), // 28: gnoi.containerz.StartError + (*StopContainerRequest)(nil), // 29: gnoi.containerz.StopContainerRequest + (*StopContainerResponse)(nil), // 30: gnoi.containerz.StopContainerResponse + (*UpdateContainerRequest)(nil), // 31: gnoi.containerz.UpdateContainerRequest + (*UpdateContainerResponse)(nil), // 32: gnoi.containerz.UpdateContainerResponse + (*UpdateOK)(nil), // 33: gnoi.containerz.UpdateOK + (*UpdateError)(nil), // 34: gnoi.containerz.UpdateError + (*LogRequest)(nil), // 35: gnoi.containerz.LogRequest + (*LogResponse)(nil), // 36: gnoi.containerz.LogResponse + (*LocalDriverOptions)(nil), // 37: gnoi.containerz.LocalDriverOptions + (*CreateVolumeRequest)(nil), // 38: gnoi.containerz.CreateVolumeRequest + (*CreateVolumeResponse)(nil), // 39: gnoi.containerz.CreateVolumeResponse + (*RemoveVolumeRequest)(nil), // 40: gnoi.containerz.RemoveVolumeRequest + (*RemoveVolumeResponse)(nil), // 41: gnoi.containerz.RemoveVolumeResponse + (*ListVolumeRequest)(nil), // 42: gnoi.containerz.ListVolumeRequest + (*ListVolumeResponse)(nil), // 43: gnoi.containerz.ListVolumeResponse + (*ListImageRequest_Filter)(nil), // 44: gnoi.containerz.ListImageRequest.Filter + (*ListContainerRequest_Filter)(nil), // 45: gnoi.containerz.ListContainerRequest.Filter + (*StartContainerRequest_Port)(nil), // 46: gnoi.containerz.StartContainerRequest.Port + nil, // 47: gnoi.containerz.StartContainerRequest.EnvironmentEntry + (*StartContainerRequest_Capabilities)(nil), // 48: gnoi.containerz.StartContainerRequest.Capabilities + (*StartContainerRequest_Restart)(nil), // 49: gnoi.containerz.StartContainerRequest.Restart + (*StartContainerRequest_RunAs)(nil), // 50: gnoi.containerz.StartContainerRequest.RunAs + nil, // 51: gnoi.containerz.CreateVolumeRequest.LabelsEntry + (*ListVolumeRequest_Filter)(nil), // 52: gnoi.containerz.ListVolumeRequest.Filter + nil, // 53: gnoi.containerz.ListVolumeResponse.OptionsEntry + nil, // 54: gnoi.containerz.ListVolumeResponse.LabelsEntry + (*common.RemoteDownload)(nil), // 55: gnoi.common.RemoteDownload + (*status.Status)(nil), // 56: google.rpc.Status + (*timestamppb.Timestamp)(nil), // 57: google.protobuf.Timestamp +} +var file_containerz_containerz_proto_depIdxs = []int32{ + 10, // 0: gnoi.containerz.DeployRequest.image_transfer:type_name -> gnoi.containerz.ImageTransfer + 11, // 1: gnoi.containerz.DeployRequest.image_transfer_end:type_name -> gnoi.containerz.ImageTransferEnd + 55, // 2: gnoi.containerz.ImageTransfer.remote_download:type_name -> gnoi.common.RemoteDownload + 13, // 3: gnoi.containerz.DeployResponse.image_transfer_ready:type_name -> gnoi.containerz.ImageTransferReady + 14, // 4: gnoi.containerz.DeployResponse.image_transfer_progress:type_name -> gnoi.containerz.ImageTransferProgress + 15, // 5: gnoi.containerz.DeployResponse.image_transfer_success:type_name -> gnoi.containerz.ImageTransferSuccess + 56, // 6: gnoi.containerz.DeployResponse.image_transfer_error:type_name -> google.rpc.Status + 1, // 7: gnoi.containerz.RemoveImageResponse.code:type_name -> gnoi.containerz.RemoveImageResponse.Code + 2, // 8: gnoi.containerz.RemoveContainerResponse.code:type_name -> gnoi.containerz.RemoveContainerResponse.Code + 44, // 9: gnoi.containerz.ListImageRequest.filter:type_name -> gnoi.containerz.ListImageRequest.Filter + 45, // 10: gnoi.containerz.ListContainerRequest.filter:type_name -> gnoi.containerz.ListContainerRequest.Filter + 3, // 11: gnoi.containerz.ListContainerResponse.status:type_name -> gnoi.containerz.ListContainerResponse.Status + 46, // 12: gnoi.containerz.StartContainerRequest.ports:type_name -> gnoi.containerz.StartContainerRequest.Port + 47, // 13: gnoi.containerz.StartContainerRequest.environment:type_name -> gnoi.containerz.StartContainerRequest.EnvironmentEntry + 24, // 14: gnoi.containerz.StartContainerRequest.volumes:type_name -> gnoi.containerz.Volume + 48, // 15: gnoi.containerz.StartContainerRequest.cap:type_name -> gnoi.containerz.StartContainerRequest.Capabilities + 49, // 16: gnoi.containerz.StartContainerRequest.restart:type_name -> gnoi.containerz.StartContainerRequest.Restart + 50, // 17: gnoi.containerz.StartContainerRequest.run_as:type_name -> gnoi.containerz.StartContainerRequest.RunAs + 27, // 18: gnoi.containerz.StartContainerResponse.start_ok:type_name -> gnoi.containerz.StartOK + 28, // 19: gnoi.containerz.StartContainerResponse.start_error:type_name -> gnoi.containerz.StartError + 5, // 20: gnoi.containerz.StartError.error_code:type_name -> gnoi.containerz.StartError.Code + 6, // 21: gnoi.containerz.StopContainerResponse.code:type_name -> gnoi.containerz.StopContainerResponse.Code + 25, // 22: gnoi.containerz.UpdateContainerRequest.params:type_name -> gnoi.containerz.StartContainerRequest + 33, // 23: gnoi.containerz.UpdateContainerResponse.update_ok:type_name -> gnoi.containerz.UpdateOK + 34, // 24: gnoi.containerz.UpdateContainerResponse.update_error:type_name -> gnoi.containerz.UpdateError + 7, // 25: gnoi.containerz.UpdateError.error_code:type_name -> gnoi.containerz.UpdateError.Code + 8, // 26: gnoi.containerz.LocalDriverOptions.type:type_name -> gnoi.containerz.LocalDriverOptions.Type + 0, // 27: gnoi.containerz.CreateVolumeRequest.driver:type_name -> gnoi.containerz.Driver + 37, // 28: gnoi.containerz.CreateVolumeRequest.local_mount_options:type_name -> gnoi.containerz.LocalDriverOptions + 51, // 29: gnoi.containerz.CreateVolumeRequest.labels:type_name -> gnoi.containerz.CreateVolumeRequest.LabelsEntry + 52, // 30: gnoi.containerz.ListVolumeRequest.filter:type_name -> gnoi.containerz.ListVolumeRequest.Filter + 57, // 31: gnoi.containerz.ListVolumeResponse.created:type_name -> google.protobuf.Timestamp + 53, // 32: gnoi.containerz.ListVolumeResponse.options:type_name -> gnoi.containerz.ListVolumeResponse.OptionsEntry + 54, // 33: gnoi.containerz.ListVolumeResponse.labels:type_name -> gnoi.containerz.ListVolumeResponse.LabelsEntry + 4, // 34: gnoi.containerz.StartContainerRequest.Restart.policy:type_name -> gnoi.containerz.StartContainerRequest.Restart.Policy + 9, // 35: gnoi.containerz.Containerz.Deploy:input_type -> gnoi.containerz.DeployRequest + 20, // 36: gnoi.containerz.Containerz.ListImage:input_type -> gnoi.containerz.ListImageRequest + 16, // 37: gnoi.containerz.Containerz.RemoveImage:input_type -> gnoi.containerz.RemoveImageRequest + 18, // 38: gnoi.containerz.Containerz.RemoveContainer:input_type -> gnoi.containerz.RemoveContainerRequest + 22, // 39: gnoi.containerz.Containerz.ListContainer:input_type -> gnoi.containerz.ListContainerRequest + 25, // 40: gnoi.containerz.Containerz.StartContainer:input_type -> gnoi.containerz.StartContainerRequest + 29, // 41: gnoi.containerz.Containerz.StopContainer:input_type -> gnoi.containerz.StopContainerRequest + 31, // 42: gnoi.containerz.Containerz.UpdateContainer:input_type -> gnoi.containerz.UpdateContainerRequest + 35, // 43: gnoi.containerz.Containerz.Log:input_type -> gnoi.containerz.LogRequest + 38, // 44: gnoi.containerz.Containerz.CreateVolume:input_type -> gnoi.containerz.CreateVolumeRequest + 40, // 45: gnoi.containerz.Containerz.RemoveVolume:input_type -> gnoi.containerz.RemoveVolumeRequest + 42, // 46: gnoi.containerz.Containerz.ListVolume:input_type -> gnoi.containerz.ListVolumeRequest + 12, // 47: gnoi.containerz.Containerz.Deploy:output_type -> gnoi.containerz.DeployResponse + 21, // 48: gnoi.containerz.Containerz.ListImage:output_type -> gnoi.containerz.ListImageResponse + 17, // 49: gnoi.containerz.Containerz.RemoveImage:output_type -> gnoi.containerz.RemoveImageResponse + 19, // 50: gnoi.containerz.Containerz.RemoveContainer:output_type -> gnoi.containerz.RemoveContainerResponse + 23, // 51: gnoi.containerz.Containerz.ListContainer:output_type -> gnoi.containerz.ListContainerResponse + 26, // 52: gnoi.containerz.Containerz.StartContainer:output_type -> gnoi.containerz.StartContainerResponse + 30, // 53: gnoi.containerz.Containerz.StopContainer:output_type -> gnoi.containerz.StopContainerResponse + 32, // 54: gnoi.containerz.Containerz.UpdateContainer:output_type -> gnoi.containerz.UpdateContainerResponse + 36, // 55: gnoi.containerz.Containerz.Log:output_type -> gnoi.containerz.LogResponse + 39, // 56: gnoi.containerz.Containerz.CreateVolume:output_type -> gnoi.containerz.CreateVolumeResponse + 41, // 57: gnoi.containerz.Containerz.RemoveVolume:output_type -> gnoi.containerz.RemoveVolumeResponse + 43, // 58: gnoi.containerz.Containerz.ListVolume:output_type -> gnoi.containerz.ListVolumeResponse + 47, // [47:59] is the sub-list for method output_type + 35, // [35:47] is the sub-list for method input_type + 35, // [35:35] is the sub-list for extension type_name + 35, // [35:35] is the sub-list for extension extendee + 0, // [0:35] is the sub-list for field type_name +} + +func init() { file_containerz_containerz_proto_init() } +func file_containerz_containerz_proto_init() { + if File_containerz_containerz_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_containerz_containerz_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeployRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_containerz_containerz_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ImageTransfer); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_containerz_containerz_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ImageTransferEnd); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_containerz_containerz_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeployResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_containerz_containerz_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ImageTransferReady); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_containerz_containerz_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ImageTransferProgress); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_containerz_containerz_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ImageTransferSuccess); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_containerz_containerz_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RemoveImageRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_containerz_containerz_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RemoveImageResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_containerz_containerz_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RemoveContainerRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_containerz_containerz_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RemoveContainerResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_containerz_containerz_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListImageRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_containerz_containerz_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListImageResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_containerz_containerz_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListContainerRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_containerz_containerz_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListContainerResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_containerz_containerz_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Volume); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_containerz_containerz_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StartContainerRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_containerz_containerz_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StartContainerResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_containerz_containerz_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StartOK); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_containerz_containerz_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StartError); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_containerz_containerz_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StopContainerRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_containerz_containerz_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StopContainerResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_containerz_containerz_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateContainerRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_containerz_containerz_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateContainerResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_containerz_containerz_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateOK); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_containerz_containerz_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateError); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_containerz_containerz_proto_msgTypes[26].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LogRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_containerz_containerz_proto_msgTypes[27].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LogResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_containerz_containerz_proto_msgTypes[28].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LocalDriverOptions); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_containerz_containerz_proto_msgTypes[29].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateVolumeRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_containerz_containerz_proto_msgTypes[30].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateVolumeResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_containerz_containerz_proto_msgTypes[31].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RemoveVolumeRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_containerz_containerz_proto_msgTypes[32].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RemoveVolumeResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_containerz_containerz_proto_msgTypes[33].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListVolumeRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_containerz_containerz_proto_msgTypes[34].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListVolumeResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_containerz_containerz_proto_msgTypes[35].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListImageRequest_Filter); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_containerz_containerz_proto_msgTypes[36].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListContainerRequest_Filter); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_containerz_containerz_proto_msgTypes[37].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StartContainerRequest_Port); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_containerz_containerz_proto_msgTypes[39].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StartContainerRequest_Capabilities); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_containerz_containerz_proto_msgTypes[40].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StartContainerRequest_Restart); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_containerz_containerz_proto_msgTypes[41].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StartContainerRequest_RunAs); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_containerz_containerz_proto_msgTypes[43].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListVolumeRequest_Filter); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_containerz_containerz_proto_msgTypes[0].OneofWrappers = []interface{}{ + (*DeployRequest_ImageTransfer)(nil), + (*DeployRequest_Content)(nil), + (*DeployRequest_ImageTransferEnd)(nil), + } + file_containerz_containerz_proto_msgTypes[3].OneofWrappers = []interface{}{ + (*DeployResponse_ImageTransferReady)(nil), + (*DeployResponse_ImageTransferProgress)(nil), + (*DeployResponse_ImageTransferSuccess)(nil), + (*DeployResponse_ImageTransferError)(nil), + } + file_containerz_containerz_proto_msgTypes[17].OneofWrappers = []interface{}{ + (*StartContainerResponse_StartOk)(nil), + (*StartContainerResponse_StartError)(nil), + } + file_containerz_containerz_proto_msgTypes[23].OneofWrappers = []interface{}{ + (*UpdateContainerResponse_UpdateOk)(nil), + (*UpdateContainerResponse_UpdateError)(nil), + } + file_containerz_containerz_proto_msgTypes[29].OneofWrappers = []interface{}{ + (*CreateVolumeRequest_LocalMountOptions)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_containerz_containerz_proto_rawDesc, + NumEnums: 9, + NumMessages: 46, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_containerz_containerz_proto_goTypes, + DependencyIndexes: file_containerz_containerz_proto_depIdxs, + EnumInfos: file_containerz_containerz_proto_enumTypes, + MessageInfos: file_containerz_containerz_proto_msgTypes, + }.Build() + File_containerz_containerz_proto = out.File + file_containerz_containerz_proto_rawDesc = nil + file_containerz_containerz_proto_goTypes = nil + file_containerz_containerz_proto_depIdxs = nil +} diff --git a/src/sonic-framework/gnoi/containerz/containerz.proto b/src/sonic-framework/gnoi/containerz/containerz.proto new file mode 100644 index 000000000000..8ce69da0dbc6 --- /dev/null +++ b/src/sonic-framework/gnoi/containerz/containerz.proto @@ -0,0 +1,630 @@ +// +// Copyright 2023 Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +// This file defines the gNOI APIs used to perform container operations on a +// network device. In addition to the container operations specified in this +// file, any implementation of the containerz service is expected to clean or +// remove images and containers that are either no longer used or that have been +// orphaned either by upgrading containers or by containers that have been +// stopped not removed. +// +// This specification is still under design and subject to +// change. +syntax = "proto3"; + +package gnoi.containerz; + +import "github.com/openconfig/gnoi/common/common.proto"; +import "github.com/openconfig/gnoi/types/types.proto"; +import "google/protobuf/timestamp.proto"; +import "google/rpc/status.proto"; + +option go_package = "github.com/openconfig/gnoi/containerz"; +option (types.gnoi_version) = "0.1.2"; + +service Containerz { + // Deploy sets a container image on the target. The container is sent as + // a sequential stream of messages containing up to 4MB of data (max default + // gRPC message size). Upon reception of a valid container, the target must + // load it into its registry. Whether the registry is local or remote is + // target and deployment specific. A valid container is one that has passed + // its checksum. + rpc Deploy(stream DeployRequest) returns (stream DeployResponse) {} + + // ListImage returns all images that the spec defined in the request. + rpc ListImage(ListImageRequest) returns (stream ListImageResponse) {} + + // RemoveImage deletes images that match the spec defined in the + // request. If the image is associated to a running container then an error + // is returned. If the specified container image does not exist, this + // operation is a no-op. + rpc RemoveImage(RemoveImageRequest) + returns (RemoveImageResponse) {} + + // RemoveContainer deletes images that match the spec defined in the + // request. If the image is associated to a running container then an error + // is returned. If the specified container image does not exist, this + // operation is a no-op. + // + // Deprecated - use RemoveImage instead. + rpc RemoveContainer(RemoveContainerRequest) + returns (RemoveContainerResponse) {} + + // ListContainer returns all containers that match the spec defined in the + // request. + rpc ListContainer(ListContainerRequest) + returns (stream ListContainerResponse) {} + + // Start starts a container. If the image does not exist on the target, + // Start returns an error. A started container is identified by an instance + // name, which can optionally be supplied by the caller otherwise the target + // should provide one. If the instance name already exists, the target should + // return an error. + rpc StartContainer(StartContainerRequest) returns (StartContainerResponse) {} + + // Stop stops a container. If the container does not exist or is not running + // this operation returns an error. This operation can, optionally, force + // (i.e. kill) a container. + rpc StopContainer(StopContainerRequest) returns (StopContainerResponse) {} + + // UpdateContainer updates a running container to the image specified in the + // request. By default the operation is synchronous which means that the + // request will only return once the container has either been successfully + // updated or the update has failed. If the client requests an asynchronous + // update then the server must perform all validations (e.g. does the + // requested image exist on the system or does the instance name exist) and + // return to the client and the update happens asynchronously. It is up to the + // client to check if the update actually updates the container to the + // requested version or not. + // In both synchronous and asynchronous mode, the update process is a + // break-before-make process as resources bound to the old container must be + // released prior to launching the new container. + // If the update fails, the server must restore the previous version of the + // container. This can either be a start of the previous container or by + // starting a new container with the old image. + // It must use the provided StartContainerRequest provided in the + // params field. + // If a container exists but is not running should still upgrade the container + // and start it. + // The client should only depend on the client being restarted. Any ephemeral + // state (date written to memory or the filesystem) cannot be depended upon. + // In particular, the contents of the filesystem are not guaranteed during a + // rollback. + rpc UpdateContainer(UpdateContainerRequest) + returns (UpdateContainerResponse) {} + + // Log streams the logs of a running container. If the container if no longer + // running this operation streams the latest logs and returns. + rpc Log(LogRequest) returns (stream LogResponse) {} + + // Creates a volume. If the volume already exists, this operation returns an + // error. A volume is expected to be backed by persistent datastore and is + // expected exist across device reboots along with the data it contained. + rpc CreateVolume(CreateVolumeRequest) returns (CreateVolumeResponse) {} + + // Removes a volume. If the volume does not exist, this operation is a noop. + rpc RemoveVolume(RemoveVolumeRequest) returns (RemoveVolumeResponse) {} + + // ListVolume returns all volumes that match the spec defined in the filter. + rpc ListVolume(ListVolumeRequest) returns (stream ListVolumeResponse) {} +} + +message DeployRequest { + oneof request { + ImageTransfer image_transfer = 1; + bytes content = 2; + ImageTransferEnd image_transfer_end = 3; + } +} + +message ImageTransfer { + // The image name. This is the name the container image must have after the + // is completed. + string name = 1; + + // The tag is a version identifier for this container image. After the + // transfer successfully completes, the tag must be applied to the + // container image. + string tag = 2; + + // Optional. Indicates the size (in bytes) of the container image. + uint64 image_size = 3; + + // Optional. Instructs the target to fetch the image from a remote location. + // The above name and tag must be applied to the container once downloaded. + common.RemoteDownload remote_download = 4; +} + +// ImageTransferEnd indicates to the target that the client is finished sending +// and therefore no more content will be sent. Any content sent after this +// message should be discarded. This message serves as a signal to the target +// to begin integrity verifications on the received data. +message ImageTransferEnd { +} + +message DeployResponse { + oneof response { + ImageTransferReady image_transfer_ready = 1; + ImageTransferProgress image_transfer_progress = 2; + ImageTransferSuccess image_transfer_success = 3; + google.rpc.Status image_transfer_error = 4; + } +} + +// ImageTransferReady indicates to the client that the target is ready to +// receive the container image content. +message ImageTransferReady { + // Indicates the size of the chunks that the client should break the + // container into as it is transferred. + int32 chunk_size = 1; +} + +// ImageTransferProgress is sent periodically to the client during the transfer. +message ImageTransferProgress { + // The number of bytes transferred so far. + uint64 bytes_received = 1; +} + +// ImageTransferSuccess indicates to the client that the container image +// transfer was successful. +message ImageTransferSuccess { + // The name of the container image. + string name = 1; + + // The tag of the container image. + string tag = 2; + + // The total size of the image. + uint64 image_size = 3; +} + +message RemoveImageRequest { + // The container image name to be removed. + string name = 1; + + // The container tag to be removed. + string tag = 2; + + // If force is set, the target should attempt to forcibly remove the + // container. + bool force = 3; +} + +message RemoveImageResponse { + enum Code { + UNSPECIFIED = 0; + + // An unknown error. Must use the detail value to describe the issue. + UNKNOWN = 1; + + // Indicates the image was not found in the remote location. + NOT_FOUND = 2; + + // Indicates that a container using this image is running. + RUNNING = 3; + + // The container image was successfully removed. + SUCCESS = 4; + } + + Code code = 1; + string detail = 2; +} + +message RemoveContainerRequest { + // The container image name to be removed. + string name = 1; + + // The container tag to be removed. + string tag = 2; + + // If force is set, the target should attempt to forcibly remove the + // container. + bool force = 3; +} + +message RemoveContainerResponse { + enum Code { + // An unspecified error. Must use the detail value to describe the issue. + UNSPECIFIED = 0; + + // Indicates the image was not found in the remote location. + NOT_FOUND = 1; + + // Indicates that a container using this image is running. + RUNNING = 2; + + // The container image was successfully removed. + SUCCESS = 3; + } + + Code code = 1; + string detail = 2; +} + +message ListImageRequest { + int32 limit = 1; + + // A filter is a mapping from a key to a list of values. + // TODO(alshabib) document possible keys + message Filter { + string key = 1; + repeated string value = 2; + } + + repeated Filter filter = 3; +} + +message ListImageResponse { + string id = 1; + string image_name = 2; + string tag = 3; +} + +message ListContainerRequest { + // List all containers, by default only running ones are returned. + bool all = 1; + + // Only return limit number of containers. + int32 limit = 2; + + // A filter is a mapping from a key to a list of values. + // TODO(alshabib) document possible keys + message Filter { + string key = 1; + repeated string value = 2; + } + + repeated Filter filter = 3; +} + +message ListContainerResponse { + string id = 1; + string name = 2; + string image_name = 3; + + enum Status { + // An unspecified state. + UNSPECIFIED = 0; + + // Container was running and is now stopped. + STOPPED = 1; + + // Container is running. + RUNNING = 2; + + // Container has never been run but exists on the target. + PRESENT = 3; + + // The container does not exist on the target. + NOT_FOUND = 4; + } + + Status status = 4; +} + +// A volume can be passed to a container such that it can persist data. +message Volume { + string name = 1; + + // The mount_point is location with the container where the volume should be + // attached within the container. + string mount_point = 2; + + // If read_only is set, the volume is mounted in readonly mode. + bool read_only = 3; +} + +message StartContainerRequest { + // The name and tag of the container to start. + string image_name = 1; + string tag = 2; + string cmd = 3; + + // Optional. The name to give the running container. If none is specified, + // the target should assign one. + string instance_name = 4; + message Port { + uint32 internal = 1; + uint32 external = 2; + } + + // List of internal ports to expose outside the container. + repeated Port ports = 5; + + // Environment to set in the container. + map environment = 6; + + // List of volumes that should be attached to the container. + repeated Volume volumes = 7; + + // The network to attach this container to. This could be 'host', 'bridged', + // or any other network available in the runtime. + string network = 8; + + // Capabilities to be added or removed. Capabilities are first removed then + // added. + message Capabilities { + repeated string add = 1; + repeated string remove = 2; + } + + // Add or remove capabilities to this container. The list of valid + // capabilities can be found in + // https://man7.org/linux/man-pages/man7/capabilities.7.html. + // This is default set of capabilities: + // AUDIT_WRITE, CHOWN, DAC_OVERRIDE, FOWNER, FSETID, KILL, MKNOD, + // NET_BIND_SERVICE, NET_RAW, SETFCAP, SETGID, SETPCAP, SETUID, SYS_CHROOT. + Capabilities cap = 9; + + message Restart { + enum Policy { + // Never restart a container. + NONE = 0; + + // Always restart a container unless explicitly stopped. This includes + // when the container runtime is restarted, i.e. any container with this + // policy prior to the runtime being stopped must be restarted when the + // runtime is started again. + ALWAYS = 1; + + // Same as ALWAYS but not across container runtime restarts. + UNLESS_STOPPED = 2; + + // Restart for max attempts if the container fails. + ON_FAILURE = 3; + } + + Policy policy = 1; + + // Only applies for the ON_FAILURE policy. + uint32 attempts = 2; + } + + // restart defines the restart policy to use for this container. All policies + // affect the behaviour when the container fails. Only the ALWAYS policy will + // affect the behaviour across system reboots. + Restart restart = 10; + + message RunAs { + // The user to run as. + string user = 1; + + // Optional. The group to run as. + string group = 2; + } + + // run_as defines what user and group this container should run as. If it is + // not specified then the container will be run as the docker user and group. + RunAs run_as = 11; + + // Other container properties will be added as it becomes necessary. +} + +message StartContainerResponse { + oneof response { + StartOK start_ok = 1; + StartError start_error = 2; + } +} + +message StartOK { + // The running containers name. + string instance_name = 1; +} + +message StartError { + enum Code { + UNSPECIFIED = 0; + + // An unknown error. The details field should provide more information. + UNKNOWN = 1; + + // The container image was not found. + NOT_FOUND = 2; + + // Exposed port is already used by another container. + PORT_USED = 3; + } + + Code error_code = 1; + string details = 2; +} + +message StopContainerRequest { + string instance_name = 1; + + // If force is set, the target should attempt to forcibly kill the container. + bool force = 2; + + // If restart is set, the target should start the container immediately + // after stopping it. + bool restart = 3; +} + +message StopContainerResponse { + enum Code { + // An unspecified error. The details field should provide more information. + UNSPECIFIED = 0; + + // Container is busy. + BUSY = 1; + + // Instance was not found on the target. + NOT_FOUND = 2; + + // The container was removed. + SUCCESS = 3; + } + + Code code = 1; + string details = 2; +} + +message UpdateContainerRequest { + + // The name of the running container to update. + string instance_name = 1; + + // The image and tag to update the container to. + string image_name = 2; + string image_tag = 3; + + // The set of parameters to run the container with. + StartContainerRequest params = 4; + + // Run this operation asynchronously or not. + bool async = 5; +} + +message UpdateContainerResponse { + oneof response { + UpdateOK update_ok = 1; + UpdateError update_error = 2; + } +} + +message UpdateOK { + // The running containers name. + string instance_name = 1; + + // Indicates if this is an async update. + bool is_async = 2; +} + +message UpdateError { + enum Code { + // An unspecified error. The details field should provide more information. + UNSPECIFIED = 0; + + // The container image was not found. + NOT_FOUND = 1; + + // Exposed port is already used by another container. + PORT_USED = 2; + + // The container was found but was not running. + NOT_RUNNING = 3; + + // The update failed and the previous version was restored. + NOT_UPDATED = 4; + + // The update operation or rollback failed. + FAILURE = 5; + } + + Code error_code = 1; + string details = 2; +} + +message LogRequest { + string instance_name = 1; + + // If set, the stream remains open until the client cancels it. + bool follow = 2; +} + +message LogResponse { + string msg = 1; +} + +// Driver enum defines which volume driver should be used when creating the +// volume +enum Driver { + DS_UNSPECIFIED = 0; + DS_LOCAL = 1; +} + +message LocalDriverOptions { + enum Type { + TYPE_UNSPECIFIED = 0; + TYPE_NONE = 1; + } + + // Mount type to use. If this is not specified it default to `none`. + Type type = 1; + + // List of mount options as specified by `options` in + // http://man7.org/linux/man-pages/man8/mount.8.html. + repeated string options = 2; + + string mountpoint = 3; +} + +message CreateVolumeRequest { + // name of the volume. If present, this system must create the volume with + // this name otherwise it must allocate a name. + string name = 1; + + // The volume driver. If not specified, this defaults to the the standard + // linux mount operation (http://man7.org/linux/man-pages/man8/mount.8.html) + // and associated options. + Driver driver = 2; + + // Options for the driver. The actual option keys and values are driver + // specific. + oneof options { + LocalDriverOptions local_mount_options = 3; + } + + // Labels to apply to the volume. Labels are metadata for the the volume. + map labels = 4; +} + +message CreateVolumeResponse { + // The name of the created volume. + string name = 1; +} + +message RemoveVolumeRequest { + // The volume to remove. + string name = 1; + + // force the volume removal. + bool force = 2; +} + +message RemoveVolumeResponse { +} + +message ListVolumeRequest { + // A filter is a mapping from a key to a list of values. + // TODO(alshabib) document possible keys + message Filter { + string key = 1; + repeated string value = 2; + } + + repeated Filter filter = 1; +} + +message ListVolumeResponse { + string name = 1; + + // The timestamp when the volume was created. + google.protobuf.Timestamp created = 2; + + // The volume driver + string driver = 3; + + // Options for the driver. The actual option keys and values are driver + // specific. + map options = 4; + + // Volume labels. + map labels = 5; + +} diff --git a/src/sonic-framework/gnoi/containerz/containerz_grpc.pb.go b/src/sonic-framework/gnoi/containerz/containerz_grpc.pb.go new file mode 100755 index 000000000000..b854e572adc8 --- /dev/null +++ b/src/sonic-framework/gnoi/containerz/containerz_grpc.pb.go @@ -0,0 +1,642 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.2.0 +// - protoc v3.21.10 +// source: containerz/containerz.proto + +package containerz + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +// ContainerzClient is the client API for Containerz service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type ContainerzClient interface { + Deploy(ctx context.Context, opts ...grpc.CallOption) (Containerz_DeployClient, error) + ListImage(ctx context.Context, in *ListImageRequest, opts ...grpc.CallOption) (Containerz_ListImageClient, error) + RemoveImage(ctx context.Context, in *RemoveImageRequest, opts ...grpc.CallOption) (*RemoveImageResponse, error) + RemoveContainer(ctx context.Context, in *RemoveContainerRequest, opts ...grpc.CallOption) (*RemoveContainerResponse, error) + ListContainer(ctx context.Context, in *ListContainerRequest, opts ...grpc.CallOption) (Containerz_ListContainerClient, error) + StartContainer(ctx context.Context, in *StartContainerRequest, opts ...grpc.CallOption) (*StartContainerResponse, error) + StopContainer(ctx context.Context, in *StopContainerRequest, opts ...grpc.CallOption) (*StopContainerResponse, error) + UpdateContainer(ctx context.Context, in *UpdateContainerRequest, opts ...grpc.CallOption) (*UpdateContainerResponse, error) + Log(ctx context.Context, in *LogRequest, opts ...grpc.CallOption) (Containerz_LogClient, error) + CreateVolume(ctx context.Context, in *CreateVolumeRequest, opts ...grpc.CallOption) (*CreateVolumeResponse, error) + RemoveVolume(ctx context.Context, in *RemoveVolumeRequest, opts ...grpc.CallOption) (*RemoveVolumeResponse, error) + ListVolume(ctx context.Context, in *ListVolumeRequest, opts ...grpc.CallOption) (Containerz_ListVolumeClient, error) +} + +type containerzClient struct { + cc grpc.ClientConnInterface +} + +func NewContainerzClient(cc grpc.ClientConnInterface) ContainerzClient { + return &containerzClient{cc} +} + +func (c *containerzClient) Deploy(ctx context.Context, opts ...grpc.CallOption) (Containerz_DeployClient, error) { + stream, err := c.cc.NewStream(ctx, &Containerz_ServiceDesc.Streams[0], "/gnoi.containerz.Containerz/Deploy", opts...) + if err != nil { + return nil, err + } + x := &containerzDeployClient{stream} + return x, nil +} + +type Containerz_DeployClient interface { + Send(*DeployRequest) error + Recv() (*DeployResponse, error) + grpc.ClientStream +} + +type containerzDeployClient struct { + grpc.ClientStream +} + +func (x *containerzDeployClient) Send(m *DeployRequest) error { + return x.ClientStream.SendMsg(m) +} + +func (x *containerzDeployClient) Recv() (*DeployResponse, error) { + m := new(DeployResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *containerzClient) ListImage(ctx context.Context, in *ListImageRequest, opts ...grpc.CallOption) (Containerz_ListImageClient, error) { + stream, err := c.cc.NewStream(ctx, &Containerz_ServiceDesc.Streams[1], "/gnoi.containerz.Containerz/ListImage", opts...) + if err != nil { + return nil, err + } + x := &containerzListImageClient{stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +type Containerz_ListImageClient interface { + Recv() (*ListImageResponse, error) + grpc.ClientStream +} + +type containerzListImageClient struct { + grpc.ClientStream +} + +func (x *containerzListImageClient) Recv() (*ListImageResponse, error) { + m := new(ListImageResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *containerzClient) RemoveImage(ctx context.Context, in *RemoveImageRequest, opts ...grpc.CallOption) (*RemoveImageResponse, error) { + out := new(RemoveImageResponse) + err := c.cc.Invoke(ctx, "/gnoi.containerz.Containerz/RemoveImage", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *containerzClient) RemoveContainer(ctx context.Context, in *RemoveContainerRequest, opts ...grpc.CallOption) (*RemoveContainerResponse, error) { + out := new(RemoveContainerResponse) + err := c.cc.Invoke(ctx, "/gnoi.containerz.Containerz/RemoveContainer", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *containerzClient) ListContainer(ctx context.Context, in *ListContainerRequest, opts ...grpc.CallOption) (Containerz_ListContainerClient, error) { + stream, err := c.cc.NewStream(ctx, &Containerz_ServiceDesc.Streams[2], "/gnoi.containerz.Containerz/ListContainer", opts...) + if err != nil { + return nil, err + } + x := &containerzListContainerClient{stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +type Containerz_ListContainerClient interface { + Recv() (*ListContainerResponse, error) + grpc.ClientStream +} + +type containerzListContainerClient struct { + grpc.ClientStream +} + +func (x *containerzListContainerClient) Recv() (*ListContainerResponse, error) { + m := new(ListContainerResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *containerzClient) StartContainer(ctx context.Context, in *StartContainerRequest, opts ...grpc.CallOption) (*StartContainerResponse, error) { + out := new(StartContainerResponse) + err := c.cc.Invoke(ctx, "/gnoi.containerz.Containerz/StartContainer", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *containerzClient) StopContainer(ctx context.Context, in *StopContainerRequest, opts ...grpc.CallOption) (*StopContainerResponse, error) { + out := new(StopContainerResponse) + err := c.cc.Invoke(ctx, "/gnoi.containerz.Containerz/StopContainer", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *containerzClient) UpdateContainer(ctx context.Context, in *UpdateContainerRequest, opts ...grpc.CallOption) (*UpdateContainerResponse, error) { + out := new(UpdateContainerResponse) + err := c.cc.Invoke(ctx, "/gnoi.containerz.Containerz/UpdateContainer", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *containerzClient) Log(ctx context.Context, in *LogRequest, opts ...grpc.CallOption) (Containerz_LogClient, error) { + stream, err := c.cc.NewStream(ctx, &Containerz_ServiceDesc.Streams[3], "/gnoi.containerz.Containerz/Log", opts...) + if err != nil { + return nil, err + } + x := &containerzLogClient{stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +type Containerz_LogClient interface { + Recv() (*LogResponse, error) + grpc.ClientStream +} + +type containerzLogClient struct { + grpc.ClientStream +} + +func (x *containerzLogClient) Recv() (*LogResponse, error) { + m := new(LogResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *containerzClient) CreateVolume(ctx context.Context, in *CreateVolumeRequest, opts ...grpc.CallOption) (*CreateVolumeResponse, error) { + out := new(CreateVolumeResponse) + err := c.cc.Invoke(ctx, "/gnoi.containerz.Containerz/CreateVolume", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *containerzClient) RemoveVolume(ctx context.Context, in *RemoveVolumeRequest, opts ...grpc.CallOption) (*RemoveVolumeResponse, error) { + out := new(RemoveVolumeResponse) + err := c.cc.Invoke(ctx, "/gnoi.containerz.Containerz/RemoveVolume", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *containerzClient) ListVolume(ctx context.Context, in *ListVolumeRequest, opts ...grpc.CallOption) (Containerz_ListVolumeClient, error) { + stream, err := c.cc.NewStream(ctx, &Containerz_ServiceDesc.Streams[4], "/gnoi.containerz.Containerz/ListVolume", opts...) + if err != nil { + return nil, err + } + x := &containerzListVolumeClient{stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +type Containerz_ListVolumeClient interface { + Recv() (*ListVolumeResponse, error) + grpc.ClientStream +} + +type containerzListVolumeClient struct { + grpc.ClientStream +} + +func (x *containerzListVolumeClient) Recv() (*ListVolumeResponse, error) { + m := new(ListVolumeResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +// ContainerzServer is the server API for Containerz service. +// All implementations must embed UnimplementedContainerzServer +// for forward compatibility +type ContainerzServer interface { + Deploy(Containerz_DeployServer) error + ListImage(*ListImageRequest, Containerz_ListImageServer) error + RemoveImage(context.Context, *RemoveImageRequest) (*RemoveImageResponse, error) + RemoveContainer(context.Context, *RemoveContainerRequest) (*RemoveContainerResponse, error) + ListContainer(*ListContainerRequest, Containerz_ListContainerServer) error + StartContainer(context.Context, *StartContainerRequest) (*StartContainerResponse, error) + StopContainer(context.Context, *StopContainerRequest) (*StopContainerResponse, error) + UpdateContainer(context.Context, *UpdateContainerRequest) (*UpdateContainerResponse, error) + Log(*LogRequest, Containerz_LogServer) error + CreateVolume(context.Context, *CreateVolumeRequest) (*CreateVolumeResponse, error) + RemoveVolume(context.Context, *RemoveVolumeRequest) (*RemoveVolumeResponse, error) + ListVolume(*ListVolumeRequest, Containerz_ListVolumeServer) error + mustEmbedUnimplementedContainerzServer() +} + +// UnimplementedContainerzServer must be embedded to have forward compatible implementations. +type UnimplementedContainerzServer struct { +} + +func (UnimplementedContainerzServer) Deploy(Containerz_DeployServer) error { + return status.Errorf(codes.Unimplemented, "method Deploy not implemented") +} +func (UnimplementedContainerzServer) ListImage(*ListImageRequest, Containerz_ListImageServer) error { + return status.Errorf(codes.Unimplemented, "method ListImage not implemented") +} +func (UnimplementedContainerzServer) RemoveImage(context.Context, *RemoveImageRequest) (*RemoveImageResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method RemoveImage not implemented") +} +func (UnimplementedContainerzServer) RemoveContainer(context.Context, *RemoveContainerRequest) (*RemoveContainerResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method RemoveContainer not implemented") +} +func (UnimplementedContainerzServer) ListContainer(*ListContainerRequest, Containerz_ListContainerServer) error { + return status.Errorf(codes.Unimplemented, "method ListContainer not implemented") +} +func (UnimplementedContainerzServer) StartContainer(context.Context, *StartContainerRequest) (*StartContainerResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method StartContainer not implemented") +} +func (UnimplementedContainerzServer) StopContainer(context.Context, *StopContainerRequest) (*StopContainerResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method StopContainer not implemented") +} +func (UnimplementedContainerzServer) UpdateContainer(context.Context, *UpdateContainerRequest) (*UpdateContainerResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateContainer not implemented") +} +func (UnimplementedContainerzServer) Log(*LogRequest, Containerz_LogServer) error { + return status.Errorf(codes.Unimplemented, "method Log not implemented") +} +func (UnimplementedContainerzServer) CreateVolume(context.Context, *CreateVolumeRequest) (*CreateVolumeResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateVolume not implemented") +} +func (UnimplementedContainerzServer) RemoveVolume(context.Context, *RemoveVolumeRequest) (*RemoveVolumeResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method RemoveVolume not implemented") +} +func (UnimplementedContainerzServer) ListVolume(*ListVolumeRequest, Containerz_ListVolumeServer) error { + return status.Errorf(codes.Unimplemented, "method ListVolume not implemented") +} +func (UnimplementedContainerzServer) mustEmbedUnimplementedContainerzServer() {} + +// UnsafeContainerzServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to ContainerzServer will +// result in compilation errors. +type UnsafeContainerzServer interface { + mustEmbedUnimplementedContainerzServer() +} + +func RegisterContainerzServer(s grpc.ServiceRegistrar, srv ContainerzServer) { + s.RegisterService(&Containerz_ServiceDesc, srv) +} + +func _Containerz_Deploy_Handler(srv interface{}, stream grpc.ServerStream) error { + return srv.(ContainerzServer).Deploy(&containerzDeployServer{stream}) +} + +type Containerz_DeployServer interface { + Send(*DeployResponse) error + Recv() (*DeployRequest, error) + grpc.ServerStream +} + +type containerzDeployServer struct { + grpc.ServerStream +} + +func (x *containerzDeployServer) Send(m *DeployResponse) error { + return x.ServerStream.SendMsg(m) +} + +func (x *containerzDeployServer) Recv() (*DeployRequest, error) { + m := new(DeployRequest) + if err := x.ServerStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func _Containerz_ListImage_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(ListImageRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(ContainerzServer).ListImage(m, &containerzListImageServer{stream}) +} + +type Containerz_ListImageServer interface { + Send(*ListImageResponse) error + grpc.ServerStream +} + +type containerzListImageServer struct { + grpc.ServerStream +} + +func (x *containerzListImageServer) Send(m *ListImageResponse) error { + return x.ServerStream.SendMsg(m) +} + +func _Containerz_RemoveImage_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(RemoveImageRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ContainerzServer).RemoveImage(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/gnoi.containerz.Containerz/RemoveImage", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ContainerzServer).RemoveImage(ctx, req.(*RemoveImageRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Containerz_RemoveContainer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(RemoveContainerRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ContainerzServer).RemoveContainer(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/gnoi.containerz.Containerz/RemoveContainer", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ContainerzServer).RemoveContainer(ctx, req.(*RemoveContainerRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Containerz_ListContainer_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(ListContainerRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(ContainerzServer).ListContainer(m, &containerzListContainerServer{stream}) +} + +type Containerz_ListContainerServer interface { + Send(*ListContainerResponse) error + grpc.ServerStream +} + +type containerzListContainerServer struct { + grpc.ServerStream +} + +func (x *containerzListContainerServer) Send(m *ListContainerResponse) error { + return x.ServerStream.SendMsg(m) +} + +func _Containerz_StartContainer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(StartContainerRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ContainerzServer).StartContainer(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/gnoi.containerz.Containerz/StartContainer", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ContainerzServer).StartContainer(ctx, req.(*StartContainerRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Containerz_StopContainer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(StopContainerRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ContainerzServer).StopContainer(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/gnoi.containerz.Containerz/StopContainer", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ContainerzServer).StopContainer(ctx, req.(*StopContainerRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Containerz_UpdateContainer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateContainerRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ContainerzServer).UpdateContainer(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/gnoi.containerz.Containerz/UpdateContainer", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ContainerzServer).UpdateContainer(ctx, req.(*UpdateContainerRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Containerz_Log_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(LogRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(ContainerzServer).Log(m, &containerzLogServer{stream}) +} + +type Containerz_LogServer interface { + Send(*LogResponse) error + grpc.ServerStream +} + +type containerzLogServer struct { + grpc.ServerStream +} + +func (x *containerzLogServer) Send(m *LogResponse) error { + return x.ServerStream.SendMsg(m) +} + +func _Containerz_CreateVolume_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateVolumeRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ContainerzServer).CreateVolume(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/gnoi.containerz.Containerz/CreateVolume", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ContainerzServer).CreateVolume(ctx, req.(*CreateVolumeRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Containerz_RemoveVolume_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(RemoveVolumeRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ContainerzServer).RemoveVolume(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/gnoi.containerz.Containerz/RemoveVolume", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ContainerzServer).RemoveVolume(ctx, req.(*RemoveVolumeRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Containerz_ListVolume_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(ListVolumeRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(ContainerzServer).ListVolume(m, &containerzListVolumeServer{stream}) +} + +type Containerz_ListVolumeServer interface { + Send(*ListVolumeResponse) error + grpc.ServerStream +} + +type containerzListVolumeServer struct { + grpc.ServerStream +} + +func (x *containerzListVolumeServer) Send(m *ListVolumeResponse) error { + return x.ServerStream.SendMsg(m) +} + +// Containerz_ServiceDesc is the grpc.ServiceDesc for Containerz service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Containerz_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "gnoi.containerz.Containerz", + HandlerType: (*ContainerzServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "RemoveImage", + Handler: _Containerz_RemoveImage_Handler, + }, + { + MethodName: "RemoveContainer", + Handler: _Containerz_RemoveContainer_Handler, + }, + { + MethodName: "StartContainer", + Handler: _Containerz_StartContainer_Handler, + }, + { + MethodName: "StopContainer", + Handler: _Containerz_StopContainer_Handler, + }, + { + MethodName: "UpdateContainer", + Handler: _Containerz_UpdateContainer_Handler, + }, + { + MethodName: "CreateVolume", + Handler: _Containerz_CreateVolume_Handler, + }, + { + MethodName: "RemoveVolume", + Handler: _Containerz_RemoveVolume_Handler, + }, + }, + Streams: []grpc.StreamDesc{ + { + StreamName: "Deploy", + Handler: _Containerz_Deploy_Handler, + ServerStreams: true, + ClientStreams: true, + }, + { + StreamName: "ListImage", + Handler: _Containerz_ListImage_Handler, + ServerStreams: true, + }, + { + StreamName: "ListContainer", + Handler: _Containerz_ListContainer_Handler, + ServerStreams: true, + }, + { + StreamName: "Log", + Handler: _Containerz_Log_Handler, + ServerStreams: true, + }, + { + StreamName: "ListVolume", + Handler: _Containerz_ListVolume_Handler, + ServerStreams: true, + }, + }, + Metadata: "containerz/containerz.proto", +} diff --git a/src/sonic-framework/gnoi/debug/BUILD.bazel b/src/sonic-framework/gnoi/debug/BUILD.bazel new file mode 100644 index 000000000000..ed1d346c50f3 --- /dev/null +++ b/src/sonic-framework/gnoi/debug/BUILD.bazel @@ -0,0 +1,64 @@ +load("@rules_proto//proto:defs.bzl", "proto_library") +load("@io_bazel_rules_go//go:def.bzl", "go_library") +load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library") +load("@com_github_grpc_grpc//bazel:cc_grpc_library.bzl", "cc_grpc_library") +load("//:common.bzl", "use_new_compilers") + +#Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +package( + default_visibility = ["//visibility:public"], + licenses = ["notice"], +) + +use_new_compilers() + +proto_library( + name = "debug_proto", + srcs = ["debug.proto"], + deps = [ + "//types:types_proto", + "@com_google_protobuf//:any_proto", + ], +) + +cc_proto_library( + name = "debug_cc_proto", + deps = [":debug_proto"], +) + +cc_grpc_library( + name = "debug_cc_grpc_proto", + srcs = [":debug_proto"], + grpc_only = True, + deps = [":debug_cc_proto"], +) + +go_proto_library( + name = "debug_go_proto", + compilers = [ + "go_protoc_gen_go", + "go_protoc_gen_go_grpc", + ], + importpath = "github.com/openconfig/gnoi/debug", + proto = ":debug_proto", + deps = ["//types"], +) + +go_library( + name = "debug", + embed = [":debug_go_proto"], + importpath = "github.com/openconfig/gnoi/debug", +) diff --git a/src/sonic-framework/gnoi/debug/README.md b/src/sonic-framework/gnoi/debug/README.md new file mode 100644 index 000000000000..155c0d85d7f6 --- /dev/null +++ b/src/sonic-framework/gnoi/debug/README.md @@ -0,0 +1,40 @@ +# gNOI `Debug` Streaming RPC Design + +**Contributors**: hines@google.com, robjs@google.com +**Last Updated**: 2023-11-04 + +## Background + +* [gNOI Repository](https://github.com/openconfig/gnoi) +* [gNOI `Debug` service](https://github.com/openconfig/gnoi/tree/master/debug) + +For all legacy devices that provided a CLI on box, providers have leveraged this CLI through services to provide users with the ability to interact with device CLI's to both get information as well as set operational state on devices. This interaction is very vendor specific and requires significant overhead to maintain the vendor specific bindings throughout the operational life cycle of a device. + +With the introduction of g* services, the goal has been to remove vendor specific data formats from the view operators. This lets operators have standard models for interacting with any number of vendor devices consistently. There however are gaps between those endpoints versioning and the ability to troubleshoot specific data on a device before API's can be updated. This proposal is to enable a lightweight interface via gRPC to still access shell level interactions on the device in a secure, maintainable way. + +## Architecture + +The service will run on a specified port. This service upon recieving a command the server will validate the user has access to the service via Authz check. If user has access the server will then parse the request and check if the user has both the acccess to run the command and if provided act as the role user. If the user is allowed the device will then open "shell" in the mode requested and execute the command in that mode. + +## User Experience + +### User needs to get custom state from device + +User Request -> Stream of data returned + +Example requests are CLI ‘show’ commands. Ie: + +`show proc cpu | json` + +### User needs to be able to shell to subcomponent (linecard / backup supervisor) to get data + +`shell ; show memory` + +### User needs to tail a process to get output + +`tail -f /var/log/foo` + +### User needs to capture a trace of process + +`strace ` + diff --git a/src/sonic-framework/gnoi/debug/debug.pb.go b/src/sonic-framework/gnoi/debug/debug.pb.go new file mode 100644 index 000000000000..d5063da03ea9 --- /dev/null +++ b/src/sonic-framework/gnoi/debug/debug.pb.go @@ -0,0 +1,465 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.30.0 +// protoc v3.21.10 +// source: debug/debug.proto + +package debug + +import ( + _ "github.com/openconfig/gnoi/types" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + anypb "google.golang.org/protobuf/types/known/anypb" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type DebugRequest_Mode int32 + +const ( + DebugRequest_MODE_UNSPECIFIED DebugRequest_Mode = 0 + DebugRequest_MODE_SHELL DebugRequest_Mode = 1 + DebugRequest_MODE_CLI DebugRequest_Mode = 2 +) + +// Enum value maps for DebugRequest_Mode. +var ( + DebugRequest_Mode_name = map[int32]string{ + 0: "MODE_UNSPECIFIED", + 1: "MODE_SHELL", + 2: "MODE_CLI", + } + DebugRequest_Mode_value = map[string]int32{ + "MODE_UNSPECIFIED": 0, + "MODE_SHELL": 1, + "MODE_CLI": 2, + } +) + +func (x DebugRequest_Mode) Enum() *DebugRequest_Mode { + p := new(DebugRequest_Mode) + *p = x + return p +} + +func (x DebugRequest_Mode) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (DebugRequest_Mode) Descriptor() protoreflect.EnumDescriptor { + return file_debug_debug_proto_enumTypes[0].Descriptor() +} + +func (DebugRequest_Mode) Type() protoreflect.EnumType { + return &file_debug_debug_proto_enumTypes[0] +} + +func (x DebugRequest_Mode) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use DebugRequest_Mode.Descriptor instead. +func (DebugRequest_Mode) EnumDescriptor() ([]byte, []int) { + return file_debug_debug_proto_rawDescGZIP(), []int{0, 0} +} + +type DebugRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Mode DebugRequest_Mode `protobuf:"varint,1,opt,name=mode,proto3,enum=gnoi.debug.DebugRequest_Mode" json:"mode,omitempty"` + Command []byte `protobuf:"bytes,2,opt,name=command,proto3" json:"command,omitempty"` + ByteLimit int64 `protobuf:"varint,3,opt,name=byte_limit,json=byteLimit,proto3" json:"byte_limit,omitempty"` + Timeout int64 `protobuf:"varint,4,opt,name=timeout,proto3" json:"timeout,omitempty"` + RoleAccount string `protobuf:"bytes,5,opt,name=role_account,json=roleAccount,proto3" json:"role_account,omitempty"` +} + +func (x *DebugRequest) Reset() { + *x = DebugRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_debug_debug_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DebugRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DebugRequest) ProtoMessage() {} + +func (x *DebugRequest) ProtoReflect() protoreflect.Message { + mi := &file_debug_debug_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DebugRequest.ProtoReflect.Descriptor instead. +func (*DebugRequest) Descriptor() ([]byte, []int) { + return file_debug_debug_proto_rawDescGZIP(), []int{0} +} + +func (x *DebugRequest) GetMode() DebugRequest_Mode { + if x != nil { + return x.Mode + } + return DebugRequest_MODE_UNSPECIFIED +} + +func (x *DebugRequest) GetCommand() []byte { + if x != nil { + return x.Command + } + return nil +} + +func (x *DebugRequest) GetByteLimit() int64 { + if x != nil { + return x.ByteLimit + } + return 0 +} + +func (x *DebugRequest) GetTimeout() int64 { + if x != nil { + return x.Timeout + } + return 0 +} + +func (x *DebugRequest) GetRoleAccount() string { + if x != nil { + return x.RoleAccount + } + return "" +} + +type DebugResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Response: + // + // *DebugResponse_Request + // *DebugResponse_Data + // *DebugResponse_Status + Response isDebugResponse_Response `protobuf_oneof:"response"` +} + +func (x *DebugResponse) Reset() { + *x = DebugResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_debug_debug_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DebugResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DebugResponse) ProtoMessage() {} + +func (x *DebugResponse) ProtoReflect() protoreflect.Message { + mi := &file_debug_debug_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DebugResponse.ProtoReflect.Descriptor instead. +func (*DebugResponse) Descriptor() ([]byte, []int) { + return file_debug_debug_proto_rawDescGZIP(), []int{1} +} + +func (m *DebugResponse) GetResponse() isDebugResponse_Response { + if m != nil { + return m.Response + } + return nil +} + +func (x *DebugResponse) GetRequest() *DebugRequest { + if x, ok := x.GetResponse().(*DebugResponse_Request); ok { + return x.Request + } + return nil +} + +func (x *DebugResponse) GetData() []byte { + if x, ok := x.GetResponse().(*DebugResponse_Data); ok { + return x.Data + } + return nil +} + +func (x *DebugResponse) GetStatus() *DebugStatus { + if x, ok := x.GetResponse().(*DebugResponse_Status); ok { + return x.Status + } + return nil +} + +type isDebugResponse_Response interface { + isDebugResponse_Response() +} + +type DebugResponse_Request struct { + Request *DebugRequest `protobuf:"bytes,100,opt,name=request,proto3,oneof"` +} + +type DebugResponse_Data struct { + Data []byte `protobuf:"bytes,101,opt,name=data,proto3,oneof"` +} + +type DebugResponse_Status struct { + Status *DebugStatus `protobuf:"bytes,102,opt,name=status,proto3,oneof"` +} + +func (*DebugResponse_Request) isDebugResponse_Response() {} + +func (*DebugResponse_Data) isDebugResponse_Response() {} + +func (*DebugResponse_Status) isDebugResponse_Response() {} + +type DebugStatus struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Code int32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` + Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` + Details []*anypb.Any `protobuf:"bytes,3,rep,name=details,proto3" json:"details,omitempty"` +} + +func (x *DebugStatus) Reset() { + *x = DebugStatus{} + if protoimpl.UnsafeEnabled { + mi := &file_debug_debug_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DebugStatus) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DebugStatus) ProtoMessage() {} + +func (x *DebugStatus) ProtoReflect() protoreflect.Message { + mi := &file_debug_debug_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DebugStatus.ProtoReflect.Descriptor instead. +func (*DebugStatus) Descriptor() ([]byte, []int) { + return file_debug_debug_proto_rawDescGZIP(), []int{2} +} + +func (x *DebugStatus) GetCode() int32 { + if x != nil { + return x.Code + } + return 0 +} + +func (x *DebugStatus) GetMessage() string { + if x != nil { + return x.Message + } + return "" +} + +func (x *DebugStatus) GetDetails() []*anypb.Any { + if x != nil { + return x.Details + } + return nil +} + +var File_debug_debug_proto protoreflect.FileDescriptor + +var file_debug_debug_proto_rawDesc = []byte{ + 0x0a, 0x11, 0x64, 0x65, 0x62, 0x75, 0x67, 0x2f, 0x64, 0x65, 0x62, 0x75, 0x67, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x12, 0x0a, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x64, 0x65, 0x62, 0x75, 0x67, 0x1a, + 0x2c, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x70, 0x65, 0x6e, + 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x67, 0x6e, 0x6f, 0x69, 0x2f, 0x74, 0x79, 0x70, 0x65, + 0x73, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x61, + 0x6e, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xf3, 0x01, 0x0a, 0x0c, 0x44, 0x65, 0x62, + 0x75, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x31, 0x0a, 0x04, 0x6d, 0x6f, 0x64, + 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1d, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x64, + 0x65, 0x62, 0x75, 0x67, 0x2e, 0x44, 0x65, 0x62, 0x75, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x2e, 0x4d, 0x6f, 0x64, 0x65, 0x52, 0x04, 0x6d, 0x6f, 0x64, 0x65, 0x12, 0x18, 0x0a, 0x07, + 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x63, + 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x62, 0x79, 0x74, 0x65, 0x5f, 0x6c, + 0x69, 0x6d, 0x69, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x62, 0x79, 0x74, 0x65, + 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x12, + 0x21, 0x0a, 0x0c, 0x72, 0x6f, 0x6c, 0x65, 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x72, 0x6f, 0x6c, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x22, 0x3a, 0x0a, 0x04, 0x4d, 0x6f, 0x64, 0x65, 0x12, 0x14, 0x0a, 0x10, 0x4d, 0x4f, + 0x44, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, + 0x12, 0x0e, 0x0a, 0x0a, 0x4d, 0x4f, 0x44, 0x45, 0x5f, 0x53, 0x48, 0x45, 0x4c, 0x4c, 0x10, 0x01, + 0x12, 0x0c, 0x0a, 0x08, 0x4d, 0x4f, 0x44, 0x45, 0x5f, 0x43, 0x4c, 0x49, 0x10, 0x02, 0x22, 0x9a, + 0x01, 0x0a, 0x0d, 0x44, 0x65, 0x62, 0x75, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x34, 0x0a, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x64, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x18, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x64, 0x65, 0x62, 0x75, 0x67, 0x2e, 0x44, + 0x65, 0x62, 0x75, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x07, 0x72, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x65, + 0x20, 0x01, 0x28, 0x0c, 0x48, 0x00, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x31, 0x0a, 0x06, + 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x66, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, + 0x6e, 0x6f, 0x69, 0x2e, 0x64, 0x65, 0x62, 0x75, 0x67, 0x2e, 0x44, 0x65, 0x62, 0x75, 0x67, 0x53, + 0x74, 0x61, 0x74, 0x75, 0x73, 0x48, 0x00, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x42, + 0x0a, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x6b, 0x0a, 0x0b, 0x44, + 0x65, 0x62, 0x75, 0x67, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, + 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x18, + 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x2e, 0x0a, 0x07, 0x64, 0x65, 0x74, 0x61, + 0x69, 0x6c, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, + 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x32, 0x47, 0x0a, 0x05, 0x44, 0x65, 0x62, 0x75, + 0x67, 0x12, 0x3e, 0x0a, 0x05, 0x44, 0x65, 0x62, 0x75, 0x67, 0x12, 0x18, 0x2e, 0x67, 0x6e, 0x6f, + 0x69, 0x2e, 0x64, 0x65, 0x62, 0x75, 0x67, 0x2e, 0x44, 0x65, 0x62, 0x75, 0x67, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x64, 0x65, 0x62, 0x75, + 0x67, 0x2e, 0x44, 0x65, 0x62, 0x75, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x30, + 0x01, 0x42, 0x2a, 0xd2, 0x3e, 0x05, 0x30, 0x2e, 0x31, 0x2e, 0x30, 0x5a, 0x20, 0x67, 0x69, 0x74, + 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6f, 0x6e, 0x66, + 0x69, 0x67, 0x2f, 0x67, 0x6e, 0x6f, 0x69, 0x2f, 0x64, 0x65, 0x62, 0x75, 0x67, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_debug_debug_proto_rawDescOnce sync.Once + file_debug_debug_proto_rawDescData = file_debug_debug_proto_rawDesc +) + +func file_debug_debug_proto_rawDescGZIP() []byte { + file_debug_debug_proto_rawDescOnce.Do(func() { + file_debug_debug_proto_rawDescData = protoimpl.X.CompressGZIP(file_debug_debug_proto_rawDescData) + }) + return file_debug_debug_proto_rawDescData +} + +var file_debug_debug_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_debug_debug_proto_msgTypes = make([]protoimpl.MessageInfo, 3) +var file_debug_debug_proto_goTypes = []interface{}{ + (DebugRequest_Mode)(0), // 0: gnoi.debug.DebugRequest.Mode + (*DebugRequest)(nil), // 1: gnoi.debug.DebugRequest + (*DebugResponse)(nil), // 2: gnoi.debug.DebugResponse + (*DebugStatus)(nil), // 3: gnoi.debug.DebugStatus + (*anypb.Any)(nil), // 4: google.protobuf.Any +} +var file_debug_debug_proto_depIdxs = []int32{ + 0, // 0: gnoi.debug.DebugRequest.mode:type_name -> gnoi.debug.DebugRequest.Mode + 1, // 1: gnoi.debug.DebugResponse.request:type_name -> gnoi.debug.DebugRequest + 3, // 2: gnoi.debug.DebugResponse.status:type_name -> gnoi.debug.DebugStatus + 4, // 3: gnoi.debug.DebugStatus.details:type_name -> google.protobuf.Any + 1, // 4: gnoi.debug.Debug.Debug:input_type -> gnoi.debug.DebugRequest + 2, // 5: gnoi.debug.Debug.Debug:output_type -> gnoi.debug.DebugResponse + 5, // [5:6] is the sub-list for method output_type + 4, // [4:5] is the sub-list for method input_type + 4, // [4:4] is the sub-list for extension type_name + 4, // [4:4] is the sub-list for extension extendee + 0, // [0:4] is the sub-list for field type_name +} + +func init() { file_debug_debug_proto_init() } +func file_debug_debug_proto_init() { + if File_debug_debug_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_debug_debug_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DebugRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_debug_debug_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DebugResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_debug_debug_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DebugStatus); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_debug_debug_proto_msgTypes[1].OneofWrappers = []interface{}{ + (*DebugResponse_Request)(nil), + (*DebugResponse_Data)(nil), + (*DebugResponse_Status)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_debug_debug_proto_rawDesc, + NumEnums: 1, + NumMessages: 3, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_debug_debug_proto_goTypes, + DependencyIndexes: file_debug_debug_proto_depIdxs, + EnumInfos: file_debug_debug_proto_enumTypes, + MessageInfos: file_debug_debug_proto_msgTypes, + }.Build() + File_debug_debug_proto = out.File + file_debug_debug_proto_rawDesc = nil + file_debug_debug_proto_goTypes = nil + file_debug_debug_proto_depIdxs = nil +} diff --git a/src/sonic-framework/gnoi/debug/debug.proto b/src/sonic-framework/gnoi/debug/debug.proto new file mode 100644 index 000000000000..17e08becc872 --- /dev/null +++ b/src/sonic-framework/gnoi/debug/debug.proto @@ -0,0 +1,77 @@ +// +// Copyright 2023 Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +// This file defines the gNOI APIs used to gather specific debug information +// from the network device. +syntax = "proto3"; + +package gnoi.debug; + +import "github.com/openconfig/gnoi/types/types.proto"; +import "google/protobuf/any.proto"; + +option go_package = "github.com/openconfig/gnoi/debug"; + +option (types.gnoi_version) = "0.1.0"; + +service Debug { + // Debug will execute the set of commands provided in the request. + // The command will be executed in the mode provided. + // All command modes must support an exit code on completion of the + // command. (e.g. Cli modes must exit after sending a command) + // Errors: + // InvalidArgument: for unspecified mode + rpc Debug (DebugRequest) returns (stream DebugResponse); +} + +message DebugRequest { + enum Mode { + MODE_UNSPECIFIED = 0; + MODE_SHELL = 1; + MODE_CLI = 2; + } + // Mode the commands will be executed in. + Mode mode = 1; + // Raw bytes for the command to be executed. + bytes command = 2; + // Truncate the amount of data returned for the command. + int64 byte_limit = 3; + // Timeout in nanoseconds. + int64 timeout = 4; + // Role account to use for the command. + string role_account = 5; +} + +// DebugResponse stream will send the request in the first +// message then stream all bytes returned by the command. +// The last message will be a status message containing the exit +// code and any error details. +message DebugResponse { + oneof response { + DebugRequest request = 100; + bytes data = 101; + DebugStatus status = 102; + } +} + +message DebugStatus { + // The status code, which should be the underlying OS exit status. + int32 code = 1; + // Any returned error status string. + string message = 2; + // A list of messages that carry the error details. + repeated google.protobuf.Any details = 3; +} diff --git a/src/sonic-framework/gnoi/debug/debug_grpc.pb.go b/src/sonic-framework/gnoi/debug/debug_grpc.pb.go new file mode 100755 index 000000000000..e6d6699bf29a --- /dev/null +++ b/src/sonic-framework/gnoi/debug/debug_grpc.pb.go @@ -0,0 +1,132 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.2.0 +// - protoc v3.21.10 +// source: debug/debug.proto + +package debug + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +// DebugClient is the client API for Debug service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type DebugClient interface { + Debug(ctx context.Context, in *DebugRequest, opts ...grpc.CallOption) (Debug_DebugClient, error) +} + +type debugClient struct { + cc grpc.ClientConnInterface +} + +func NewDebugClient(cc grpc.ClientConnInterface) DebugClient { + return &debugClient{cc} +} + +func (c *debugClient) Debug(ctx context.Context, in *DebugRequest, opts ...grpc.CallOption) (Debug_DebugClient, error) { + stream, err := c.cc.NewStream(ctx, &Debug_ServiceDesc.Streams[0], "/gnoi.debug.Debug/Debug", opts...) + if err != nil { + return nil, err + } + x := &debugDebugClient{stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +type Debug_DebugClient interface { + Recv() (*DebugResponse, error) + grpc.ClientStream +} + +type debugDebugClient struct { + grpc.ClientStream +} + +func (x *debugDebugClient) Recv() (*DebugResponse, error) { + m := new(DebugResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +// DebugServer is the server API for Debug service. +// All implementations must embed UnimplementedDebugServer +// for forward compatibility +type DebugServer interface { + Debug(*DebugRequest, Debug_DebugServer) error + mustEmbedUnimplementedDebugServer() +} + +// UnimplementedDebugServer must be embedded to have forward compatible implementations. +type UnimplementedDebugServer struct { +} + +func (UnimplementedDebugServer) Debug(*DebugRequest, Debug_DebugServer) error { + return status.Errorf(codes.Unimplemented, "method Debug not implemented") +} +func (UnimplementedDebugServer) mustEmbedUnimplementedDebugServer() {} + +// UnsafeDebugServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to DebugServer will +// result in compilation errors. +type UnsafeDebugServer interface { + mustEmbedUnimplementedDebugServer() +} + +func RegisterDebugServer(s grpc.ServiceRegistrar, srv DebugServer) { + s.RegisterService(&Debug_ServiceDesc, srv) +} + +func _Debug_Debug_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(DebugRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(DebugServer).Debug(m, &debugDebugServer{stream}) +} + +type Debug_DebugServer interface { + Send(*DebugResponse) error + grpc.ServerStream +} + +type debugDebugServer struct { + grpc.ServerStream +} + +func (x *debugDebugServer) Send(m *DebugResponse) error { + return x.ServerStream.SendMsg(m) +} + +// Debug_ServiceDesc is the grpc.ServiceDesc for Debug service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Debug_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "gnoi.debug.Debug", + HandlerType: (*DebugServer)(nil), + Methods: []grpc.MethodDesc{}, + Streams: []grpc.StreamDesc{ + { + StreamName: "Debug", + Handler: _Debug_Debug_Handler, + ServerStreams: true, + }, + }, + Metadata: "debug/debug.proto", +} diff --git a/src/sonic-framework/gnoi/diag/BUILD.bazel b/src/sonic-framework/gnoi/diag/BUILD.bazel new file mode 100644 index 000000000000..2e2fe744d248 --- /dev/null +++ b/src/sonic-framework/gnoi/diag/BUILD.bazel @@ -0,0 +1,63 @@ +load("@rules_proto//proto:defs.bzl", "proto_library") +load("@io_bazel_rules_go//go:def.bzl", "go_library") +load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library") +load("@com_github_grpc_grpc//bazel:cc_grpc_library.bzl", "cc_grpc_library") +load("//:common.bzl", "use_new_compilers") + +#Copyright 2021 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +package( + default_visibility = ["//visibility:public"], + licenses = ["notice"], +) + +use_new_compilers() + +proto_library( + name = "diag_proto", + srcs = ["diag.proto"], + deps = [ + "//types:types_proto", + ], +) + +cc_proto_library( + name = "diag_cc_proto", + deps = [":diag_proto"], +) + +cc_grpc_library( + name = "diag_cc_grpc_proto", + srcs = [":diag_proto"], + grpc_only = True, + deps = [":diag_cc_proto"], +) + +go_proto_library( + name = "diag_go_proto", + compilers = [ + "go_protoc_gen_go", + "go_protoc_gen_go_grpc", + ], + importpath = "github.com/openconfig/gnoi/diag", + proto = ":diag_proto", + deps = ["//types"], +) + +go_library( + name = "diag", + embed = [":diag_go_proto"], + importpath = "github.com/openconfig/gnoi/diag", +) diff --git a/src/sonic-framework/gnoi/diag/diag.pb.go b/src/sonic-framework/gnoi/diag/diag.pb.go new file mode 100644 index 000000000000..90b8c838f732 --- /dev/null +++ b/src/sonic-framework/gnoi/diag/diag.pb.go @@ -0,0 +1,1316 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.30.0 +// protoc v3.21.10 +// source: diag/diag.proto + +package diag + +import ( + types "github.com/openconfig/gnoi/types" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type PrbsPolynomial int32 + +const ( + PrbsPolynomial_PRBS_POLYNOMIAL_UNKNOWN PrbsPolynomial = 0 + PrbsPolynomial_PRBS_POLYNOMIAL_PRBS7 PrbsPolynomial = 1 + PrbsPolynomial_PRBS_POLYNOMIAL_PRBS9 PrbsPolynomial = 2 + PrbsPolynomial_PRBS_POLYNOMIAL_PRBS15 PrbsPolynomial = 3 + PrbsPolynomial_PRBS_POLYNOMIAL_PRBS20 PrbsPolynomial = 4 + PrbsPolynomial_PRBS_POLYNOMIAL_PRBS23 PrbsPolynomial = 5 + PrbsPolynomial_PRBS_POLYNOMIAL_PRBS31 PrbsPolynomial = 6 +) + +// Enum value maps for PrbsPolynomial. +var ( + PrbsPolynomial_name = map[int32]string{ + 0: "PRBS_POLYNOMIAL_UNKNOWN", + 1: "PRBS_POLYNOMIAL_PRBS7", + 2: "PRBS_POLYNOMIAL_PRBS9", + 3: "PRBS_POLYNOMIAL_PRBS15", + 4: "PRBS_POLYNOMIAL_PRBS20", + 5: "PRBS_POLYNOMIAL_PRBS23", + 6: "PRBS_POLYNOMIAL_PRBS31", + } + PrbsPolynomial_value = map[string]int32{ + "PRBS_POLYNOMIAL_UNKNOWN": 0, + "PRBS_POLYNOMIAL_PRBS7": 1, + "PRBS_POLYNOMIAL_PRBS9": 2, + "PRBS_POLYNOMIAL_PRBS15": 3, + "PRBS_POLYNOMIAL_PRBS20": 4, + "PRBS_POLYNOMIAL_PRBS23": 5, + "PRBS_POLYNOMIAL_PRBS31": 6, + } +) + +func (x PrbsPolynomial) Enum() *PrbsPolynomial { + p := new(PrbsPolynomial) + *p = x + return p +} + +func (x PrbsPolynomial) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (PrbsPolynomial) Descriptor() protoreflect.EnumDescriptor { + return file_diag_diag_proto_enumTypes[0].Descriptor() +} + +func (PrbsPolynomial) Type() protoreflect.EnumType { + return &file_diag_diag_proto_enumTypes[0] +} + +func (x PrbsPolynomial) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use PrbsPolynomial.Descriptor instead. +func (PrbsPolynomial) EnumDescriptor() ([]byte, []int) { + return file_diag_diag_proto_rawDescGZIP(), []int{0} +} + +type BertStatus int32 + +const ( + BertStatus_BERT_STATUS_UNKNOWN BertStatus = 0 + BertStatus_BERT_STATUS_OK BertStatus = 1 + BertStatus_BERT_STATUS_NON_EXISTENT_PORT BertStatus = 2 + BertStatus_BERT_STATUS_HARDWARE_ACCESS_ERROR BertStatus = 3 + BertStatus_BERT_STATUS_UNSUPPORTED_PRBS_POLYNOMIAL BertStatus = 4 + BertStatus_BERT_STATUS_PORT_ALREADY_IN_BERT BertStatus = 5 + BertStatus_BERT_STATUS_PORT_NOT_RUNNING_BERT BertStatus = 6 + BertStatus_BERT_STATUS_TEST_DURATION_TOO_SHORT BertStatus = 7 + BertStatus_BERT_STATUS_TEST_DURATION_TOO_LONG BertStatus = 8 + BertStatus_BERT_STATUS_OPERATION_ID_NOT_FOUND BertStatus = 9 + BertStatus_BERT_STATUS_OPERATION_ID_IN_USE BertStatus = 10 + BertStatus_BERT_STATUS_PEER_LOCK_FAILURE BertStatus = 11 + BertStatus_BERT_STATUS_PEER_LOCK_LOST BertStatus = 12 + BertStatus_BERT_STATUS_INTERNAL_ERROR BertStatus = 13 +) + +// Enum value maps for BertStatus. +var ( + BertStatus_name = map[int32]string{ + 0: "BERT_STATUS_UNKNOWN", + 1: "BERT_STATUS_OK", + 2: "BERT_STATUS_NON_EXISTENT_PORT", + 3: "BERT_STATUS_HARDWARE_ACCESS_ERROR", + 4: "BERT_STATUS_UNSUPPORTED_PRBS_POLYNOMIAL", + 5: "BERT_STATUS_PORT_ALREADY_IN_BERT", + 6: "BERT_STATUS_PORT_NOT_RUNNING_BERT", + 7: "BERT_STATUS_TEST_DURATION_TOO_SHORT", + 8: "BERT_STATUS_TEST_DURATION_TOO_LONG", + 9: "BERT_STATUS_OPERATION_ID_NOT_FOUND", + 10: "BERT_STATUS_OPERATION_ID_IN_USE", + 11: "BERT_STATUS_PEER_LOCK_FAILURE", + 12: "BERT_STATUS_PEER_LOCK_LOST", + 13: "BERT_STATUS_INTERNAL_ERROR", + } + BertStatus_value = map[string]int32{ + "BERT_STATUS_UNKNOWN": 0, + "BERT_STATUS_OK": 1, + "BERT_STATUS_NON_EXISTENT_PORT": 2, + "BERT_STATUS_HARDWARE_ACCESS_ERROR": 3, + "BERT_STATUS_UNSUPPORTED_PRBS_POLYNOMIAL": 4, + "BERT_STATUS_PORT_ALREADY_IN_BERT": 5, + "BERT_STATUS_PORT_NOT_RUNNING_BERT": 6, + "BERT_STATUS_TEST_DURATION_TOO_SHORT": 7, + "BERT_STATUS_TEST_DURATION_TOO_LONG": 8, + "BERT_STATUS_OPERATION_ID_NOT_FOUND": 9, + "BERT_STATUS_OPERATION_ID_IN_USE": 10, + "BERT_STATUS_PEER_LOCK_FAILURE": 11, + "BERT_STATUS_PEER_LOCK_LOST": 12, + "BERT_STATUS_INTERNAL_ERROR": 13, + } +) + +func (x BertStatus) Enum() *BertStatus { + p := new(BertStatus) + *p = x + return p +} + +func (x BertStatus) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (BertStatus) Descriptor() protoreflect.EnumDescriptor { + return file_diag_diag_proto_enumTypes[1].Descriptor() +} + +func (BertStatus) Type() protoreflect.EnumType { + return &file_diag_diag_proto_enumTypes[1] +} + +func (x BertStatus) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use BertStatus.Descriptor instead. +func (BertStatus) EnumDescriptor() ([]byte, []int) { + return file_diag_diag_proto_rawDescGZIP(), []int{1} +} + +type StartBERTRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + BertOperationId string `protobuf:"bytes,1,opt,name=bert_operation_id,json=bertOperationId,proto3" json:"bert_operation_id,omitempty"` + PerPortRequests []*StartBERTRequest_PerPortRequest `protobuf:"bytes,2,rep,name=per_port_requests,json=perPortRequests,proto3" json:"per_port_requests,omitempty"` +} + +func (x *StartBERTRequest) Reset() { + *x = StartBERTRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_diag_diag_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StartBERTRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StartBERTRequest) ProtoMessage() {} + +func (x *StartBERTRequest) ProtoReflect() protoreflect.Message { + mi := &file_diag_diag_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use StartBERTRequest.ProtoReflect.Descriptor instead. +func (*StartBERTRequest) Descriptor() ([]byte, []int) { + return file_diag_diag_proto_rawDescGZIP(), []int{0} +} + +func (x *StartBERTRequest) GetBertOperationId() string { + if x != nil { + return x.BertOperationId + } + return "" +} + +func (x *StartBERTRequest) GetPerPortRequests() []*StartBERTRequest_PerPortRequest { + if x != nil { + return x.PerPortRequests + } + return nil +} + +type StartBERTResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + BertOperationId string `protobuf:"bytes,1,opt,name=bert_operation_id,json=bertOperationId,proto3" json:"bert_operation_id,omitempty"` + PerPortResponses []*StartBERTResponse_PerPortResponse `protobuf:"bytes,2,rep,name=per_port_responses,json=perPortResponses,proto3" json:"per_port_responses,omitempty"` +} + +func (x *StartBERTResponse) Reset() { + *x = StartBERTResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_diag_diag_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StartBERTResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StartBERTResponse) ProtoMessage() {} + +func (x *StartBERTResponse) ProtoReflect() protoreflect.Message { + mi := &file_diag_diag_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use StartBERTResponse.ProtoReflect.Descriptor instead. +func (*StartBERTResponse) Descriptor() ([]byte, []int) { + return file_diag_diag_proto_rawDescGZIP(), []int{1} +} + +func (x *StartBERTResponse) GetBertOperationId() string { + if x != nil { + return x.BertOperationId + } + return "" +} + +func (x *StartBERTResponse) GetPerPortResponses() []*StartBERTResponse_PerPortResponse { + if x != nil { + return x.PerPortResponses + } + return nil +} + +type StopBERTRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + BertOperationId string `protobuf:"bytes,1,opt,name=bert_operation_id,json=bertOperationId,proto3" json:"bert_operation_id,omitempty"` + PerPortRequests []*StopBERTRequest_PerPortRequest `protobuf:"bytes,2,rep,name=per_port_requests,json=perPortRequests,proto3" json:"per_port_requests,omitempty"` +} + +func (x *StopBERTRequest) Reset() { + *x = StopBERTRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_diag_diag_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StopBERTRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StopBERTRequest) ProtoMessage() {} + +func (x *StopBERTRequest) ProtoReflect() protoreflect.Message { + mi := &file_diag_diag_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use StopBERTRequest.ProtoReflect.Descriptor instead. +func (*StopBERTRequest) Descriptor() ([]byte, []int) { + return file_diag_diag_proto_rawDescGZIP(), []int{2} +} + +func (x *StopBERTRequest) GetBertOperationId() string { + if x != nil { + return x.BertOperationId + } + return "" +} + +func (x *StopBERTRequest) GetPerPortRequests() []*StopBERTRequest_PerPortRequest { + if x != nil { + return x.PerPortRequests + } + return nil +} + +type StopBERTResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + BertOperationId string `protobuf:"bytes,1,opt,name=bert_operation_id,json=bertOperationId,proto3" json:"bert_operation_id,omitempty"` + PerPortResponses []*StopBERTResponse_PerPortResponse `protobuf:"bytes,2,rep,name=per_port_responses,json=perPortResponses,proto3" json:"per_port_responses,omitempty"` +} + +func (x *StopBERTResponse) Reset() { + *x = StopBERTResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_diag_diag_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StopBERTResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StopBERTResponse) ProtoMessage() {} + +func (x *StopBERTResponse) ProtoReflect() protoreflect.Message { + mi := &file_diag_diag_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use StopBERTResponse.ProtoReflect.Descriptor instead. +func (*StopBERTResponse) Descriptor() ([]byte, []int) { + return file_diag_diag_proto_rawDescGZIP(), []int{3} +} + +func (x *StopBERTResponse) GetBertOperationId() string { + if x != nil { + return x.BertOperationId + } + return "" +} + +func (x *StopBERTResponse) GetPerPortResponses() []*StopBERTResponse_PerPortResponse { + if x != nil { + return x.PerPortResponses + } + return nil +} + +type GetBERTResultRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + BertOperationId string `protobuf:"bytes,1,opt,name=bert_operation_id,json=bertOperationId,proto3" json:"bert_operation_id,omitempty"` + PerPortRequests []*GetBERTResultRequest_PerPortRequest `protobuf:"bytes,2,rep,name=per_port_requests,json=perPortRequests,proto3" json:"per_port_requests,omitempty"` + ResultFromAllPorts bool `protobuf:"varint,3,opt,name=result_from_all_ports,json=resultFromAllPorts,proto3" json:"result_from_all_ports,omitempty"` +} + +func (x *GetBERTResultRequest) Reset() { + *x = GetBERTResultRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_diag_diag_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetBERTResultRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetBERTResultRequest) ProtoMessage() {} + +func (x *GetBERTResultRequest) ProtoReflect() protoreflect.Message { + mi := &file_diag_diag_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetBERTResultRequest.ProtoReflect.Descriptor instead. +func (*GetBERTResultRequest) Descriptor() ([]byte, []int) { + return file_diag_diag_proto_rawDescGZIP(), []int{4} +} + +func (x *GetBERTResultRequest) GetBertOperationId() string { + if x != nil { + return x.BertOperationId + } + return "" +} + +func (x *GetBERTResultRequest) GetPerPortRequests() []*GetBERTResultRequest_PerPortRequest { + if x != nil { + return x.PerPortRequests + } + return nil +} + +func (x *GetBERTResultRequest) GetResultFromAllPorts() bool { + if x != nil { + return x.ResultFromAllPorts + } + return false +} + +type GetBERTResultResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + PerPortResponses []*GetBERTResultResponse_PerPortResponse `protobuf:"bytes,1,rep,name=per_port_responses,json=perPortResponses,proto3" json:"per_port_responses,omitempty"` +} + +func (x *GetBERTResultResponse) Reset() { + *x = GetBERTResultResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_diag_diag_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetBERTResultResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetBERTResultResponse) ProtoMessage() {} + +func (x *GetBERTResultResponse) ProtoReflect() protoreflect.Message { + mi := &file_diag_diag_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetBERTResultResponse.ProtoReflect.Descriptor instead. +func (*GetBERTResultResponse) Descriptor() ([]byte, []int) { + return file_diag_diag_proto_rawDescGZIP(), []int{5} +} + +func (x *GetBERTResultResponse) GetPerPortResponses() []*GetBERTResultResponse_PerPortResponse { + if x != nil { + return x.PerPortResponses + } + return nil +} + +type StartBERTRequest_PerPortRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Interface *types.Path `protobuf:"bytes,1,opt,name=interface,proto3" json:"interface,omitempty"` + PrbsPolynomial PrbsPolynomial `protobuf:"varint,2,opt,name=prbs_polynomial,json=prbsPolynomial,proto3,enum=gnoi.diag.PrbsPolynomial" json:"prbs_polynomial,omitempty"` + TestDurationInSecs uint32 `protobuf:"varint,3,opt,name=test_duration_in_secs,json=testDurationInSecs,proto3" json:"test_duration_in_secs,omitempty"` +} + +func (x *StartBERTRequest_PerPortRequest) Reset() { + *x = StartBERTRequest_PerPortRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_diag_diag_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StartBERTRequest_PerPortRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StartBERTRequest_PerPortRequest) ProtoMessage() {} + +func (x *StartBERTRequest_PerPortRequest) ProtoReflect() protoreflect.Message { + mi := &file_diag_diag_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use StartBERTRequest_PerPortRequest.ProtoReflect.Descriptor instead. +func (*StartBERTRequest_PerPortRequest) Descriptor() ([]byte, []int) { + return file_diag_diag_proto_rawDescGZIP(), []int{0, 0} +} + +func (x *StartBERTRequest_PerPortRequest) GetInterface() *types.Path { + if x != nil { + return x.Interface + } + return nil +} + +func (x *StartBERTRequest_PerPortRequest) GetPrbsPolynomial() PrbsPolynomial { + if x != nil { + return x.PrbsPolynomial + } + return PrbsPolynomial_PRBS_POLYNOMIAL_UNKNOWN +} + +func (x *StartBERTRequest_PerPortRequest) GetTestDurationInSecs() uint32 { + if x != nil { + return x.TestDurationInSecs + } + return 0 +} + +type StartBERTResponse_PerPortResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Interface *types.Path `protobuf:"bytes,1,opt,name=interface,proto3" json:"interface,omitempty"` + Status BertStatus `protobuf:"varint,2,opt,name=status,proto3,enum=gnoi.diag.BertStatus" json:"status,omitempty"` +} + +func (x *StartBERTResponse_PerPortResponse) Reset() { + *x = StartBERTResponse_PerPortResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_diag_diag_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StartBERTResponse_PerPortResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StartBERTResponse_PerPortResponse) ProtoMessage() {} + +func (x *StartBERTResponse_PerPortResponse) ProtoReflect() protoreflect.Message { + mi := &file_diag_diag_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use StartBERTResponse_PerPortResponse.ProtoReflect.Descriptor instead. +func (*StartBERTResponse_PerPortResponse) Descriptor() ([]byte, []int) { + return file_diag_diag_proto_rawDescGZIP(), []int{1, 0} +} + +func (x *StartBERTResponse_PerPortResponse) GetInterface() *types.Path { + if x != nil { + return x.Interface + } + return nil +} + +func (x *StartBERTResponse_PerPortResponse) GetStatus() BertStatus { + if x != nil { + return x.Status + } + return BertStatus_BERT_STATUS_UNKNOWN +} + +type StopBERTRequest_PerPortRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Interface *types.Path `protobuf:"bytes,1,opt,name=interface,proto3" json:"interface,omitempty"` +} + +func (x *StopBERTRequest_PerPortRequest) Reset() { + *x = StopBERTRequest_PerPortRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_diag_diag_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StopBERTRequest_PerPortRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StopBERTRequest_PerPortRequest) ProtoMessage() {} + +func (x *StopBERTRequest_PerPortRequest) ProtoReflect() protoreflect.Message { + mi := &file_diag_diag_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use StopBERTRequest_PerPortRequest.ProtoReflect.Descriptor instead. +func (*StopBERTRequest_PerPortRequest) Descriptor() ([]byte, []int) { + return file_diag_diag_proto_rawDescGZIP(), []int{2, 0} +} + +func (x *StopBERTRequest_PerPortRequest) GetInterface() *types.Path { + if x != nil { + return x.Interface + } + return nil +} + +type StopBERTResponse_PerPortResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Interface *types.Path `protobuf:"bytes,1,opt,name=interface,proto3" json:"interface,omitempty"` + Status BertStatus `protobuf:"varint,2,opt,name=status,proto3,enum=gnoi.diag.BertStatus" json:"status,omitempty"` +} + +func (x *StopBERTResponse_PerPortResponse) Reset() { + *x = StopBERTResponse_PerPortResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_diag_diag_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StopBERTResponse_PerPortResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StopBERTResponse_PerPortResponse) ProtoMessage() {} + +func (x *StopBERTResponse_PerPortResponse) ProtoReflect() protoreflect.Message { + mi := &file_diag_diag_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use StopBERTResponse_PerPortResponse.ProtoReflect.Descriptor instead. +func (*StopBERTResponse_PerPortResponse) Descriptor() ([]byte, []int) { + return file_diag_diag_proto_rawDescGZIP(), []int{3, 0} +} + +func (x *StopBERTResponse_PerPortResponse) GetInterface() *types.Path { + if x != nil { + return x.Interface + } + return nil +} + +func (x *StopBERTResponse_PerPortResponse) GetStatus() BertStatus { + if x != nil { + return x.Status + } + return BertStatus_BERT_STATUS_UNKNOWN +} + +type GetBERTResultRequest_PerPortRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Interface *types.Path `protobuf:"bytes,1,opt,name=interface,proto3" json:"interface,omitempty"` +} + +func (x *GetBERTResultRequest_PerPortRequest) Reset() { + *x = GetBERTResultRequest_PerPortRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_diag_diag_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetBERTResultRequest_PerPortRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetBERTResultRequest_PerPortRequest) ProtoMessage() {} + +func (x *GetBERTResultRequest_PerPortRequest) ProtoReflect() protoreflect.Message { + mi := &file_diag_diag_proto_msgTypes[10] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetBERTResultRequest_PerPortRequest.ProtoReflect.Descriptor instead. +func (*GetBERTResultRequest_PerPortRequest) Descriptor() ([]byte, []int) { + return file_diag_diag_proto_rawDescGZIP(), []int{4, 0} +} + +func (x *GetBERTResultRequest_PerPortRequest) GetInterface() *types.Path { + if x != nil { + return x.Interface + } + return nil +} + +type GetBERTResultResponse_PerPortResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Interface *types.Path `protobuf:"bytes,1,opt,name=interface,proto3" json:"interface,omitempty"` + Status BertStatus `protobuf:"varint,2,opt,name=status,proto3,enum=gnoi.diag.BertStatus" json:"status,omitempty"` + BertOperationId string `protobuf:"bytes,3,opt,name=bert_operation_id,json=bertOperationId,proto3" json:"bert_operation_id,omitempty"` + PrbsPolynomial PrbsPolynomial `protobuf:"varint,4,opt,name=prbs_polynomial,json=prbsPolynomial,proto3,enum=gnoi.diag.PrbsPolynomial" json:"prbs_polynomial,omitempty"` + LastBertStartTimestamp uint64 `protobuf:"varint,5,opt,name=last_bert_start_timestamp,json=lastBertStartTimestamp,proto3" json:"last_bert_start_timestamp,omitempty"` + LastBertGetResultTimestamp uint64 `protobuf:"varint,6,opt,name=last_bert_get_result_timestamp,json=lastBertGetResultTimestamp,proto3" json:"last_bert_get_result_timestamp,omitempty"` + PeerLockEstablished bool `protobuf:"varint,7,opt,name=peer_lock_established,json=peerLockEstablished,proto3" json:"peer_lock_established,omitempty"` + PeerLockLost bool `protobuf:"varint,8,opt,name=peer_lock_lost,json=peerLockLost,proto3" json:"peer_lock_lost,omitempty"` + ErrorCountPerMinute []uint32 `protobuf:"varint,9,rep,packed,name=error_count_per_minute,json=errorCountPerMinute,proto3" json:"error_count_per_minute,omitempty"` + TotalErrors uint64 `protobuf:"varint,10,opt,name=total_errors,json=totalErrors,proto3" json:"total_errors,omitempty"` +} + +func (x *GetBERTResultResponse_PerPortResponse) Reset() { + *x = GetBERTResultResponse_PerPortResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_diag_diag_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetBERTResultResponse_PerPortResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetBERTResultResponse_PerPortResponse) ProtoMessage() {} + +func (x *GetBERTResultResponse_PerPortResponse) ProtoReflect() protoreflect.Message { + mi := &file_diag_diag_proto_msgTypes[11] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetBERTResultResponse_PerPortResponse.ProtoReflect.Descriptor instead. +func (*GetBERTResultResponse_PerPortResponse) Descriptor() ([]byte, []int) { + return file_diag_diag_proto_rawDescGZIP(), []int{5, 0} +} + +func (x *GetBERTResultResponse_PerPortResponse) GetInterface() *types.Path { + if x != nil { + return x.Interface + } + return nil +} + +func (x *GetBERTResultResponse_PerPortResponse) GetStatus() BertStatus { + if x != nil { + return x.Status + } + return BertStatus_BERT_STATUS_UNKNOWN +} + +func (x *GetBERTResultResponse_PerPortResponse) GetBertOperationId() string { + if x != nil { + return x.BertOperationId + } + return "" +} + +func (x *GetBERTResultResponse_PerPortResponse) GetPrbsPolynomial() PrbsPolynomial { + if x != nil { + return x.PrbsPolynomial + } + return PrbsPolynomial_PRBS_POLYNOMIAL_UNKNOWN +} + +func (x *GetBERTResultResponse_PerPortResponse) GetLastBertStartTimestamp() uint64 { + if x != nil { + return x.LastBertStartTimestamp + } + return 0 +} + +func (x *GetBERTResultResponse_PerPortResponse) GetLastBertGetResultTimestamp() uint64 { + if x != nil { + return x.LastBertGetResultTimestamp + } + return 0 +} + +func (x *GetBERTResultResponse_PerPortResponse) GetPeerLockEstablished() bool { + if x != nil { + return x.PeerLockEstablished + } + return false +} + +func (x *GetBERTResultResponse_PerPortResponse) GetPeerLockLost() bool { + if x != nil { + return x.PeerLockLost + } + return false +} + +func (x *GetBERTResultResponse_PerPortResponse) GetErrorCountPerMinute() []uint32 { + if x != nil { + return x.ErrorCountPerMinute + } + return nil +} + +func (x *GetBERTResultResponse_PerPortResponse) GetTotalErrors() uint64 { + if x != nil { + return x.TotalErrors + } + return 0 +} + +var File_diag_diag_proto protoreflect.FileDescriptor + +var file_diag_diag_proto_rawDesc = []byte{ + 0x0a, 0x0f, 0x64, 0x69, 0x61, 0x67, 0x2f, 0x64, 0x69, 0x61, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x12, 0x09, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x64, 0x69, 0x61, 0x67, 0x1a, 0x2c, 0x67, 0x69, + 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6f, 0x6e, + 0x66, 0x69, 0x67, 0x2f, 0x67, 0x6e, 0x6f, 0x69, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x74, + 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xd0, 0x02, 0x0a, 0x10, 0x53, + 0x74, 0x61, 0x72, 0x74, 0x42, 0x45, 0x52, 0x54, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x2a, 0x0a, 0x11, 0x62, 0x65, 0x72, 0x74, 0x5f, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x62, 0x65, 0x72, 0x74, + 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x56, 0x0a, 0x11, 0x70, + 0x65, 0x72, 0x5f, 0x70, 0x6f, 0x72, 0x74, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, + 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x64, 0x69, + 0x61, 0x67, 0x2e, 0x53, 0x74, 0x61, 0x72, 0x74, 0x42, 0x45, 0x52, 0x54, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x2e, 0x50, 0x65, 0x72, 0x50, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x52, 0x0f, 0x70, 0x65, 0x72, 0x50, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x73, 0x1a, 0xb7, 0x01, 0x0a, 0x0e, 0x50, 0x65, 0x72, 0x50, 0x6f, 0x72, 0x74, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2e, 0x0a, 0x09, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x66, + 0x61, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x67, 0x6e, 0x6f, 0x69, + 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x50, 0x61, 0x74, 0x68, 0x52, 0x09, 0x69, 0x6e, 0x74, + 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x12, 0x42, 0x0a, 0x0f, 0x70, 0x72, 0x62, 0x73, 0x5f, 0x70, + 0x6f, 0x6c, 0x79, 0x6e, 0x6f, 0x6d, 0x69, 0x61, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, + 0x19, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x64, 0x69, 0x61, 0x67, 0x2e, 0x50, 0x72, 0x62, 0x73, + 0x50, 0x6f, 0x6c, 0x79, 0x6e, 0x6f, 0x6d, 0x69, 0x61, 0x6c, 0x52, 0x0e, 0x70, 0x72, 0x62, 0x73, + 0x50, 0x6f, 0x6c, 0x79, 0x6e, 0x6f, 0x6d, 0x69, 0x61, 0x6c, 0x12, 0x31, 0x0a, 0x15, 0x74, 0x65, + 0x73, 0x74, 0x5f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x6e, 0x5f, 0x73, + 0x65, 0x63, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x12, 0x74, 0x65, 0x73, 0x74, 0x44, + 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x53, 0x65, 0x63, 0x73, 0x22, 0x8d, 0x02, + 0x0a, 0x11, 0x53, 0x74, 0x61, 0x72, 0x74, 0x42, 0x45, 0x52, 0x54, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x2a, 0x0a, 0x11, 0x62, 0x65, 0x72, 0x74, 0x5f, 0x6f, 0x70, 0x65, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, + 0x62, 0x65, 0x72, 0x74, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, + 0x5a, 0x0a, 0x12, 0x70, 0x65, 0x72, 0x5f, 0x70, 0x6f, 0x72, 0x74, 0x5f, 0x72, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x67, 0x6e, + 0x6f, 0x69, 0x2e, 0x64, 0x69, 0x61, 0x67, 0x2e, 0x53, 0x74, 0x61, 0x72, 0x74, 0x42, 0x45, 0x52, + 0x54, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x50, 0x65, 0x72, 0x50, 0x6f, 0x72, + 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x10, 0x70, 0x65, 0x72, 0x50, 0x6f, + 0x72, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x1a, 0x70, 0x0a, 0x0f, 0x50, + 0x65, 0x72, 0x50, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2e, + 0x0a, 0x09, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x10, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x50, + 0x61, 0x74, 0x68, 0x52, 0x09, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x12, 0x2d, + 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x15, + 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x64, 0x69, 0x61, 0x67, 0x2e, 0x42, 0x65, 0x72, 0x74, 0x53, + 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0xd6, 0x01, + 0x0a, 0x0f, 0x53, 0x74, 0x6f, 0x70, 0x42, 0x45, 0x52, 0x54, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x2a, 0x0a, 0x11, 0x62, 0x65, 0x72, 0x74, 0x5f, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x62, 0x65, + 0x72, 0x74, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x55, 0x0a, + 0x11, 0x70, 0x65, 0x72, 0x5f, 0x70, 0x6f, 0x72, 0x74, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, + 0x64, 0x69, 0x61, 0x67, 0x2e, 0x53, 0x74, 0x6f, 0x70, 0x42, 0x45, 0x52, 0x54, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x2e, 0x50, 0x65, 0x72, 0x50, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x52, 0x0f, 0x70, 0x65, 0x72, 0x50, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x73, 0x1a, 0x40, 0x0a, 0x0e, 0x50, 0x65, 0x72, 0x50, 0x6f, 0x72, 0x74, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2e, 0x0a, 0x09, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x66, + 0x61, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x67, 0x6e, 0x6f, 0x69, + 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x50, 0x61, 0x74, 0x68, 0x52, 0x09, 0x69, 0x6e, 0x74, + 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x22, 0x8b, 0x02, 0x0a, 0x10, 0x53, 0x74, 0x6f, 0x70, 0x42, + 0x45, 0x52, 0x54, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2a, 0x0a, 0x11, 0x62, + 0x65, 0x72, 0x74, 0x5f, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x62, 0x65, 0x72, 0x74, 0x4f, 0x70, 0x65, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x59, 0x0a, 0x12, 0x70, 0x65, 0x72, 0x5f, 0x70, + 0x6f, 0x72, 0x74, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x18, 0x02, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x64, 0x69, 0x61, 0x67, 0x2e, + 0x53, 0x74, 0x6f, 0x70, 0x42, 0x45, 0x52, 0x54, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x2e, 0x50, 0x65, 0x72, 0x50, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x52, 0x10, 0x70, 0x65, 0x72, 0x50, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x73, 0x1a, 0x70, 0x0a, 0x0f, 0x50, 0x65, 0x72, 0x50, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2e, 0x0a, 0x09, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, + 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, + 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x50, 0x61, 0x74, 0x68, 0x52, 0x09, 0x69, 0x6e, 0x74, 0x65, + 0x72, 0x66, 0x61, 0x63, 0x65, 0x12, 0x2d, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x15, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x64, 0x69, 0x61, + 0x67, 0x2e, 0x42, 0x65, 0x72, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x22, 0x93, 0x02, 0x0a, 0x14, 0x47, 0x65, 0x74, 0x42, 0x45, 0x52, 0x54, + 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2a, 0x0a, + 0x11, 0x62, 0x65, 0x72, 0x74, 0x5f, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x62, 0x65, 0x72, 0x74, 0x4f, 0x70, + 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x5a, 0x0a, 0x11, 0x70, 0x65, 0x72, + 0x5f, 0x70, 0x6f, 0x72, 0x74, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x18, 0x02, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x64, 0x69, 0x61, 0x67, + 0x2e, 0x47, 0x65, 0x74, 0x42, 0x45, 0x52, 0x54, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x50, 0x65, 0x72, 0x50, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x52, 0x0f, 0x70, 0x65, 0x72, 0x50, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x73, 0x12, 0x31, 0x0a, 0x15, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x5f, + 0x66, 0x72, 0x6f, 0x6d, 0x5f, 0x61, 0x6c, 0x6c, 0x5f, 0x70, 0x6f, 0x72, 0x74, 0x73, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x12, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x46, 0x72, 0x6f, 0x6d, + 0x41, 0x6c, 0x6c, 0x50, 0x6f, 0x72, 0x74, 0x73, 0x1a, 0x40, 0x0a, 0x0e, 0x50, 0x65, 0x72, 0x50, + 0x6f, 0x72, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2e, 0x0a, 0x09, 0x69, 0x6e, + 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, + 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x50, 0x61, 0x74, 0x68, 0x52, + 0x09, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x22, 0x8b, 0x05, 0x0a, 0x15, 0x47, + 0x65, 0x74, 0x42, 0x45, 0x52, 0x54, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5e, 0x0a, 0x12, 0x70, 0x65, 0x72, 0x5f, 0x70, 0x6f, 0x72, 0x74, + 0x5f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x30, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x64, 0x69, 0x61, 0x67, 0x2e, 0x47, 0x65, 0x74, + 0x42, 0x45, 0x52, 0x54, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x2e, 0x50, 0x65, 0x72, 0x50, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x52, 0x10, 0x70, 0x65, 0x72, 0x50, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x73, 0x1a, 0x91, 0x04, 0x0a, 0x0f, 0x50, 0x65, 0x72, 0x50, 0x6f, 0x72, 0x74, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2e, 0x0a, 0x09, 0x69, 0x6e, 0x74, 0x65, + 0x72, 0x66, 0x61, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x67, 0x6e, + 0x6f, 0x69, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x50, 0x61, 0x74, 0x68, 0x52, 0x09, 0x69, + 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x12, 0x2d, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x15, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, + 0x64, 0x69, 0x61, 0x67, 0x2e, 0x42, 0x65, 0x72, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, + 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x2a, 0x0a, 0x11, 0x62, 0x65, 0x72, 0x74, 0x5f, + 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0f, 0x62, 0x65, 0x72, 0x74, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x49, 0x64, 0x12, 0x42, 0x0a, 0x0f, 0x70, 0x72, 0x62, 0x73, 0x5f, 0x70, 0x6f, 0x6c, 0x79, + 0x6e, 0x6f, 0x6d, 0x69, 0x61, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x19, 0x2e, 0x67, + 0x6e, 0x6f, 0x69, 0x2e, 0x64, 0x69, 0x61, 0x67, 0x2e, 0x50, 0x72, 0x62, 0x73, 0x50, 0x6f, 0x6c, + 0x79, 0x6e, 0x6f, 0x6d, 0x69, 0x61, 0x6c, 0x52, 0x0e, 0x70, 0x72, 0x62, 0x73, 0x50, 0x6f, 0x6c, + 0x79, 0x6e, 0x6f, 0x6d, 0x69, 0x61, 0x6c, 0x12, 0x39, 0x0a, 0x19, 0x6c, 0x61, 0x73, 0x74, 0x5f, + 0x62, 0x65, 0x72, 0x74, 0x5f, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x73, + 0x74, 0x61, 0x6d, 0x70, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, 0x52, 0x16, 0x6c, 0x61, 0x73, 0x74, + 0x42, 0x65, 0x72, 0x74, 0x53, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, + 0x6d, 0x70, 0x12, 0x42, 0x0a, 0x1e, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x62, 0x65, 0x72, 0x74, 0x5f, + 0x67, 0x65, 0x74, 0x5f, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x73, + 0x74, 0x61, 0x6d, 0x70, 0x18, 0x06, 0x20, 0x01, 0x28, 0x04, 0x52, 0x1a, 0x6c, 0x61, 0x73, 0x74, + 0x42, 0x65, 0x72, 0x74, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x54, 0x69, 0x6d, + 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x32, 0x0a, 0x15, 0x70, 0x65, 0x65, 0x72, 0x5f, 0x6c, + 0x6f, 0x63, 0x6b, 0x5f, 0x65, 0x73, 0x74, 0x61, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x65, 0x64, 0x18, + 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x13, 0x70, 0x65, 0x65, 0x72, 0x4c, 0x6f, 0x63, 0x6b, 0x45, + 0x73, 0x74, 0x61, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x65, 0x64, 0x12, 0x24, 0x0a, 0x0e, 0x70, 0x65, + 0x65, 0x72, 0x5f, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x6c, 0x6f, 0x73, 0x74, 0x18, 0x08, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x0c, 0x70, 0x65, 0x65, 0x72, 0x4c, 0x6f, 0x63, 0x6b, 0x4c, 0x6f, 0x73, 0x74, + 0x12, 0x33, 0x0a, 0x16, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, + 0x70, 0x65, 0x72, 0x5f, 0x6d, 0x69, 0x6e, 0x75, 0x74, 0x65, 0x18, 0x09, 0x20, 0x03, 0x28, 0x0d, + 0x52, 0x13, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x50, 0x65, 0x72, 0x4d, + 0x69, 0x6e, 0x75, 0x74, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x65, + 0x72, 0x72, 0x6f, 0x72, 0x73, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x74, 0x6f, 0x74, + 0x61, 0x6c, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x2a, 0xd3, 0x01, 0x0a, 0x0e, 0x50, 0x72, 0x62, + 0x73, 0x50, 0x6f, 0x6c, 0x79, 0x6e, 0x6f, 0x6d, 0x69, 0x61, 0x6c, 0x12, 0x1b, 0x0a, 0x17, 0x50, + 0x52, 0x42, 0x53, 0x5f, 0x50, 0x4f, 0x4c, 0x59, 0x4e, 0x4f, 0x4d, 0x49, 0x41, 0x4c, 0x5f, 0x55, + 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x19, 0x0a, 0x15, 0x50, 0x52, 0x42, 0x53, + 0x5f, 0x50, 0x4f, 0x4c, 0x59, 0x4e, 0x4f, 0x4d, 0x49, 0x41, 0x4c, 0x5f, 0x50, 0x52, 0x42, 0x53, + 0x37, 0x10, 0x01, 0x12, 0x19, 0x0a, 0x15, 0x50, 0x52, 0x42, 0x53, 0x5f, 0x50, 0x4f, 0x4c, 0x59, + 0x4e, 0x4f, 0x4d, 0x49, 0x41, 0x4c, 0x5f, 0x50, 0x52, 0x42, 0x53, 0x39, 0x10, 0x02, 0x12, 0x1a, + 0x0a, 0x16, 0x50, 0x52, 0x42, 0x53, 0x5f, 0x50, 0x4f, 0x4c, 0x59, 0x4e, 0x4f, 0x4d, 0x49, 0x41, + 0x4c, 0x5f, 0x50, 0x52, 0x42, 0x53, 0x31, 0x35, 0x10, 0x03, 0x12, 0x1a, 0x0a, 0x16, 0x50, 0x52, + 0x42, 0x53, 0x5f, 0x50, 0x4f, 0x4c, 0x59, 0x4e, 0x4f, 0x4d, 0x49, 0x41, 0x4c, 0x5f, 0x50, 0x52, + 0x42, 0x53, 0x32, 0x30, 0x10, 0x04, 0x12, 0x1a, 0x0a, 0x16, 0x50, 0x52, 0x42, 0x53, 0x5f, 0x50, + 0x4f, 0x4c, 0x59, 0x4e, 0x4f, 0x4d, 0x49, 0x41, 0x4c, 0x5f, 0x50, 0x52, 0x42, 0x53, 0x32, 0x33, + 0x10, 0x05, 0x12, 0x1a, 0x0a, 0x16, 0x50, 0x52, 0x42, 0x53, 0x5f, 0x50, 0x4f, 0x4c, 0x59, 0x4e, + 0x4f, 0x4d, 0x49, 0x41, 0x4c, 0x5f, 0x50, 0x52, 0x42, 0x53, 0x33, 0x31, 0x10, 0x06, 0x2a, 0xfe, + 0x03, 0x0a, 0x0a, 0x42, 0x65, 0x72, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x17, 0x0a, + 0x13, 0x42, 0x45, 0x52, 0x54, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x55, 0x4e, 0x4b, + 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x12, 0x0a, 0x0e, 0x42, 0x45, 0x52, 0x54, 0x5f, 0x53, + 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x4f, 0x4b, 0x10, 0x01, 0x12, 0x21, 0x0a, 0x1d, 0x42, 0x45, + 0x52, 0x54, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x4e, 0x4f, 0x4e, 0x5f, 0x45, 0x58, + 0x49, 0x53, 0x54, 0x45, 0x4e, 0x54, 0x5f, 0x50, 0x4f, 0x52, 0x54, 0x10, 0x02, 0x12, 0x25, 0x0a, + 0x21, 0x42, 0x45, 0x52, 0x54, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x48, 0x41, 0x52, + 0x44, 0x57, 0x41, 0x52, 0x45, 0x5f, 0x41, 0x43, 0x43, 0x45, 0x53, 0x53, 0x5f, 0x45, 0x52, 0x52, + 0x4f, 0x52, 0x10, 0x03, 0x12, 0x2b, 0x0a, 0x27, 0x42, 0x45, 0x52, 0x54, 0x5f, 0x53, 0x54, 0x41, + 0x54, 0x55, 0x53, 0x5f, 0x55, 0x4e, 0x53, 0x55, 0x50, 0x50, 0x4f, 0x52, 0x54, 0x45, 0x44, 0x5f, + 0x50, 0x52, 0x42, 0x53, 0x5f, 0x50, 0x4f, 0x4c, 0x59, 0x4e, 0x4f, 0x4d, 0x49, 0x41, 0x4c, 0x10, + 0x04, 0x12, 0x24, 0x0a, 0x20, 0x42, 0x45, 0x52, 0x54, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, + 0x5f, 0x50, 0x4f, 0x52, 0x54, 0x5f, 0x41, 0x4c, 0x52, 0x45, 0x41, 0x44, 0x59, 0x5f, 0x49, 0x4e, + 0x5f, 0x42, 0x45, 0x52, 0x54, 0x10, 0x05, 0x12, 0x25, 0x0a, 0x21, 0x42, 0x45, 0x52, 0x54, 0x5f, + 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x50, 0x4f, 0x52, 0x54, 0x5f, 0x4e, 0x4f, 0x54, 0x5f, + 0x52, 0x55, 0x4e, 0x4e, 0x49, 0x4e, 0x47, 0x5f, 0x42, 0x45, 0x52, 0x54, 0x10, 0x06, 0x12, 0x27, + 0x0a, 0x23, 0x42, 0x45, 0x52, 0x54, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x54, 0x45, + 0x53, 0x54, 0x5f, 0x44, 0x55, 0x52, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x54, 0x4f, 0x4f, 0x5f, + 0x53, 0x48, 0x4f, 0x52, 0x54, 0x10, 0x07, 0x12, 0x26, 0x0a, 0x22, 0x42, 0x45, 0x52, 0x54, 0x5f, + 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x54, 0x45, 0x53, 0x54, 0x5f, 0x44, 0x55, 0x52, 0x41, + 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x54, 0x4f, 0x4f, 0x5f, 0x4c, 0x4f, 0x4e, 0x47, 0x10, 0x08, 0x12, + 0x26, 0x0a, 0x22, 0x42, 0x45, 0x52, 0x54, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x4f, + 0x50, 0x45, 0x52, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x49, 0x44, 0x5f, 0x4e, 0x4f, 0x54, 0x5f, + 0x46, 0x4f, 0x55, 0x4e, 0x44, 0x10, 0x09, 0x12, 0x23, 0x0a, 0x1f, 0x42, 0x45, 0x52, 0x54, 0x5f, + 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x4f, 0x50, 0x45, 0x52, 0x41, 0x54, 0x49, 0x4f, 0x4e, + 0x5f, 0x49, 0x44, 0x5f, 0x49, 0x4e, 0x5f, 0x55, 0x53, 0x45, 0x10, 0x0a, 0x12, 0x21, 0x0a, 0x1d, + 0x42, 0x45, 0x52, 0x54, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x50, 0x45, 0x45, 0x52, + 0x5f, 0x4c, 0x4f, 0x43, 0x4b, 0x5f, 0x46, 0x41, 0x49, 0x4c, 0x55, 0x52, 0x45, 0x10, 0x0b, 0x12, + 0x1e, 0x0a, 0x1a, 0x42, 0x45, 0x52, 0x54, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x50, + 0x45, 0x45, 0x52, 0x5f, 0x4c, 0x4f, 0x43, 0x4b, 0x5f, 0x4c, 0x4f, 0x53, 0x54, 0x10, 0x0c, 0x12, + 0x1e, 0x0a, 0x1a, 0x42, 0x45, 0x52, 0x54, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x49, + 0x4e, 0x54, 0x45, 0x52, 0x4e, 0x41, 0x4c, 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x10, 0x0d, 0x32, + 0xed, 0x01, 0x0a, 0x04, 0x44, 0x69, 0x61, 0x67, 0x12, 0x48, 0x0a, 0x09, 0x53, 0x74, 0x61, 0x72, + 0x74, 0x42, 0x45, 0x52, 0x54, 0x12, 0x1b, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x64, 0x69, 0x61, + 0x67, 0x2e, 0x53, 0x74, 0x61, 0x72, 0x74, 0x42, 0x45, 0x52, 0x54, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x64, 0x69, 0x61, 0x67, 0x2e, 0x53, + 0x74, 0x61, 0x72, 0x74, 0x42, 0x45, 0x52, 0x54, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x00, 0x12, 0x45, 0x0a, 0x08, 0x53, 0x74, 0x6f, 0x70, 0x42, 0x45, 0x52, 0x54, 0x12, 0x1a, + 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x64, 0x69, 0x61, 0x67, 0x2e, 0x53, 0x74, 0x6f, 0x70, 0x42, + 0x45, 0x52, 0x54, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x67, 0x6e, 0x6f, + 0x69, 0x2e, 0x64, 0x69, 0x61, 0x67, 0x2e, 0x53, 0x74, 0x6f, 0x70, 0x42, 0x45, 0x52, 0x54, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x54, 0x0a, 0x0d, 0x47, 0x65, 0x74, + 0x42, 0x45, 0x52, 0x54, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x1f, 0x2e, 0x67, 0x6e, 0x6f, + 0x69, 0x2e, 0x64, 0x69, 0x61, 0x67, 0x2e, 0x47, 0x65, 0x74, 0x42, 0x45, 0x52, 0x54, 0x52, 0x65, + 0x73, 0x75, 0x6c, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x67, 0x6e, + 0x6f, 0x69, 0x2e, 0x64, 0x69, 0x61, 0x67, 0x2e, 0x47, 0x65, 0x74, 0x42, 0x45, 0x52, 0x54, 0x52, + 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, + 0x29, 0xd2, 0x3e, 0x05, 0x30, 0x2e, 0x31, 0x2e, 0x30, 0x5a, 0x1f, 0x67, 0x69, 0x74, 0x68, 0x75, + 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, + 0x2f, 0x67, 0x6e, 0x6f, 0x69, 0x2f, 0x64, 0x69, 0x61, 0x67, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, +} + +var ( + file_diag_diag_proto_rawDescOnce sync.Once + file_diag_diag_proto_rawDescData = file_diag_diag_proto_rawDesc +) + +func file_diag_diag_proto_rawDescGZIP() []byte { + file_diag_diag_proto_rawDescOnce.Do(func() { + file_diag_diag_proto_rawDescData = protoimpl.X.CompressGZIP(file_diag_diag_proto_rawDescData) + }) + return file_diag_diag_proto_rawDescData +} + +var file_diag_diag_proto_enumTypes = make([]protoimpl.EnumInfo, 2) +var file_diag_diag_proto_msgTypes = make([]protoimpl.MessageInfo, 12) +var file_diag_diag_proto_goTypes = []interface{}{ + (PrbsPolynomial)(0), // 0: gnoi.diag.PrbsPolynomial + (BertStatus)(0), // 1: gnoi.diag.BertStatus + (*StartBERTRequest)(nil), // 2: gnoi.diag.StartBERTRequest + (*StartBERTResponse)(nil), // 3: gnoi.diag.StartBERTResponse + (*StopBERTRequest)(nil), // 4: gnoi.diag.StopBERTRequest + (*StopBERTResponse)(nil), // 5: gnoi.diag.StopBERTResponse + (*GetBERTResultRequest)(nil), // 6: gnoi.diag.GetBERTResultRequest + (*GetBERTResultResponse)(nil), // 7: gnoi.diag.GetBERTResultResponse + (*StartBERTRequest_PerPortRequest)(nil), // 8: gnoi.diag.StartBERTRequest.PerPortRequest + (*StartBERTResponse_PerPortResponse)(nil), // 9: gnoi.diag.StartBERTResponse.PerPortResponse + (*StopBERTRequest_PerPortRequest)(nil), // 10: gnoi.diag.StopBERTRequest.PerPortRequest + (*StopBERTResponse_PerPortResponse)(nil), // 11: gnoi.diag.StopBERTResponse.PerPortResponse + (*GetBERTResultRequest_PerPortRequest)(nil), // 12: gnoi.diag.GetBERTResultRequest.PerPortRequest + (*GetBERTResultResponse_PerPortResponse)(nil), // 13: gnoi.diag.GetBERTResultResponse.PerPortResponse + (*types.Path)(nil), // 14: gnoi.types.Path +} +var file_diag_diag_proto_depIdxs = []int32{ + 8, // 0: gnoi.diag.StartBERTRequest.per_port_requests:type_name -> gnoi.diag.StartBERTRequest.PerPortRequest + 9, // 1: gnoi.diag.StartBERTResponse.per_port_responses:type_name -> gnoi.diag.StartBERTResponse.PerPortResponse + 10, // 2: gnoi.diag.StopBERTRequest.per_port_requests:type_name -> gnoi.diag.StopBERTRequest.PerPortRequest + 11, // 3: gnoi.diag.StopBERTResponse.per_port_responses:type_name -> gnoi.diag.StopBERTResponse.PerPortResponse + 12, // 4: gnoi.diag.GetBERTResultRequest.per_port_requests:type_name -> gnoi.diag.GetBERTResultRequest.PerPortRequest + 13, // 5: gnoi.diag.GetBERTResultResponse.per_port_responses:type_name -> gnoi.diag.GetBERTResultResponse.PerPortResponse + 14, // 6: gnoi.diag.StartBERTRequest.PerPortRequest.interface:type_name -> gnoi.types.Path + 0, // 7: gnoi.diag.StartBERTRequest.PerPortRequest.prbs_polynomial:type_name -> gnoi.diag.PrbsPolynomial + 14, // 8: gnoi.diag.StartBERTResponse.PerPortResponse.interface:type_name -> gnoi.types.Path + 1, // 9: gnoi.diag.StartBERTResponse.PerPortResponse.status:type_name -> gnoi.diag.BertStatus + 14, // 10: gnoi.diag.StopBERTRequest.PerPortRequest.interface:type_name -> gnoi.types.Path + 14, // 11: gnoi.diag.StopBERTResponse.PerPortResponse.interface:type_name -> gnoi.types.Path + 1, // 12: gnoi.diag.StopBERTResponse.PerPortResponse.status:type_name -> gnoi.diag.BertStatus + 14, // 13: gnoi.diag.GetBERTResultRequest.PerPortRequest.interface:type_name -> gnoi.types.Path + 14, // 14: gnoi.diag.GetBERTResultResponse.PerPortResponse.interface:type_name -> gnoi.types.Path + 1, // 15: gnoi.diag.GetBERTResultResponse.PerPortResponse.status:type_name -> gnoi.diag.BertStatus + 0, // 16: gnoi.diag.GetBERTResultResponse.PerPortResponse.prbs_polynomial:type_name -> gnoi.diag.PrbsPolynomial + 2, // 17: gnoi.diag.Diag.StartBERT:input_type -> gnoi.diag.StartBERTRequest + 4, // 18: gnoi.diag.Diag.StopBERT:input_type -> gnoi.diag.StopBERTRequest + 6, // 19: gnoi.diag.Diag.GetBERTResult:input_type -> gnoi.diag.GetBERTResultRequest + 3, // 20: gnoi.diag.Diag.StartBERT:output_type -> gnoi.diag.StartBERTResponse + 5, // 21: gnoi.diag.Diag.StopBERT:output_type -> gnoi.diag.StopBERTResponse + 7, // 22: gnoi.diag.Diag.GetBERTResult:output_type -> gnoi.diag.GetBERTResultResponse + 20, // [20:23] is the sub-list for method output_type + 17, // [17:20] is the sub-list for method input_type + 17, // [17:17] is the sub-list for extension type_name + 17, // [17:17] is the sub-list for extension extendee + 0, // [0:17] is the sub-list for field type_name +} + +func init() { file_diag_diag_proto_init() } +func file_diag_diag_proto_init() { + if File_diag_diag_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_diag_diag_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StartBERTRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_diag_diag_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StartBERTResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_diag_diag_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StopBERTRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_diag_diag_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StopBERTResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_diag_diag_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetBERTResultRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_diag_diag_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetBERTResultResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_diag_diag_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StartBERTRequest_PerPortRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_diag_diag_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StartBERTResponse_PerPortResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_diag_diag_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StopBERTRequest_PerPortRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_diag_diag_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StopBERTResponse_PerPortResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_diag_diag_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetBERTResultRequest_PerPortRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_diag_diag_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetBERTResultResponse_PerPortResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_diag_diag_proto_rawDesc, + NumEnums: 2, + NumMessages: 12, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_diag_diag_proto_goTypes, + DependencyIndexes: file_diag_diag_proto_depIdxs, + EnumInfos: file_diag_diag_proto_enumTypes, + MessageInfos: file_diag_diag_proto_msgTypes, + }.Build() + File_diag_diag_proto = out.File + file_diag_diag_proto_rawDesc = nil + file_diag_diag_proto_goTypes = nil + file_diag_diag_proto_depIdxs = nil +} diff --git a/src/sonic-framework/gnoi/diag/diag.proto b/src/sonic-framework/gnoi/diag/diag.proto new file mode 100644 index 000000000000..5ca592fb936d --- /dev/null +++ b/src/sonic-framework/gnoi/diag/diag.proto @@ -0,0 +1,253 @@ +// +// Copyright 2017 Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +// This file defines the gNOI APIs used to perform diagnostic operations on a +// network device. +syntax = "proto3"; + +package gnoi.diag; + +import "github.com/openconfig/gnoi/types/types.proto"; + +option go_package = "github.com/openconfig/gnoi/diag"; + +option (types.gnoi_version) = "0.1.0"; + +// The Diag service exports to main set of RPCs: +// 1- BERT related RPCs: Used to perform Bit Error Rate Test (BERT) +// operations on a set of ports. +// 2- BURNIN related RPCs: Used to perform a vendor-provided Burnin test on the +// network device to ensure the device is ready to start serving traffic. +// Burnin tests are typically run in the field, as part of turnup or repair +// workflow. +// Note: The RPCs defined here are are stateless operations and them +// failing/passing should not leave any permanent artifact on the network device +// (unless there is something wrong HW-wise). +// Note: By "port" we refer to a channelized frontpanel or backplane port on a +// chassis. In OpenConfig YANG models, there is a one-to-one relationship +// between a port as used here and an "interface". Therefore, the "types.Path" +// fields below for ports correspond to "/interfaces/interface" in YANG models. +service Diag { + // Starts BERT operation on a set of ports. Each BERT operation is uniquely + // identified by an ID, which is given by the caller. The caller can then + // use this ID (as well as the list of the ports) to stop the BERT operation + // and/or get the BERT results. This RPC is expected to return an error status + // in the following situations: + // - When BERT operation is supported on none of the ports specified by + // the request. + // - When BERT is already in progress on any port specified by the request. + // - In case of any low-level HW/SW internal errors. + // The RPC returns an OK status of none of these situations is encountered. + rpc StartBERT(StartBERTRequest) returns(StartBERTResponse) {} + + // Stops an already in-progress BERT operation on a set of ports. The caller + // uses the BERT operation ID it previously used when starting the operation + // to stop it. The RPC is expected to return an error status in the following + // situations: + // - When there is at least one BERT operation in progress on a port which + // cannot be stopped in the middle of the operation (either due to lack of + // support or internal problems). + // - When no BERT operation, which matches the given BERT operation ID, is in + // progress or completed on any of the ports specified by the request. + // - When the BERT operation ID does not match the in progress or completed + // BERT operation on any of the ports specified by the request. + // The RPC returns an OK status of none of these situations is encountered. + // Note that a BERT operation is considered completed if the device has a + // record/history of it. Also note that it is OK to receive a stop request for + // a port which has completed BERT, as long as the recorded BERT operation ID + // matches the one specified by the request. + rpc StopBERT(StopBERTRequest) returns(StopBERTResponse) {} + + // Gets BERT results during the BERT operation or after it completes. The + // caller uses the BERT operation ID it previously used when starting the + // operation to query it. The device is expected to keep the results for + // last N BERT operations for some amount of time, as specified by the + // product requirement. This RPC is expected to return error status in the + // following situations: + // - When no BERT operation, which matches the given BERT operation ID, is in + // progress or completed on any of the ports specified by the request. + // - When the BERT operation ID does not match the in progress or completed + // BERT operation on any of the ports specified by the request. + // The RPC returns an OK status of none of these situations is encountered. + // Note that a BERT operation is considered completed if device has a + // record of it. + rpc GetBERTResult(GetBERTResultRequest) returns(GetBERTResultResponse) {} + + // TODO(aghaffar): Add BURNIN related RPCs. +} + +// Common sequence generating monic polynomials used for PRBS. +enum PrbsPolynomial { + PRBS_POLYNOMIAL_UNKNOWN = 0; // default invalid choice. + PRBS_POLYNOMIAL_PRBS7 = 1; + PRBS_POLYNOMIAL_PRBS9 = 2; + PRBS_POLYNOMIAL_PRBS15 = 3; + PRBS_POLYNOMIAL_PRBS20 = 4; + PRBS_POLYNOMIAL_PRBS23 = 5; + PRBS_POLYNOMIAL_PRBS31 = 6; +} + +// Status returned for each per-port BERT request. +enum BertStatus { + // default invalid choice. + BERT_STATUS_UNKNOWN = 0; + // BERT requests (Start, Stop, GetStatus) were processed successfully. + BERT_STATUS_OK = 1; + // The specified port was not found. + BERT_STATUS_NON_EXISTENT_PORT = 2; + // HW error was encountered while performing BERT operation. + BERT_STATUS_HARDWARE_ACCESS_ERROR = 3; + // PRBS generating polynomial is not supported by the target. + BERT_STATUS_UNSUPPORTED_PRBS_POLYNOMIAL = 4; + // There is already a BERT running on the specified port. Returned when + // `StartBert` RPC tries to add run BERT on an already in-use port. + BERT_STATUS_PORT_ALREADY_IN_BERT = 5; + // There is no BERT running on the specified port. Returned when `StopBert` + // or `GetBertResult` RPC was called for an idle port. + BERT_STATUS_PORT_NOT_RUNNING_BERT = 6; + // The specified test duration is too small. + BERT_STATUS_TEST_DURATION_TOO_SHORT = 7; + // The specified test duration is larger than maximum allowed. + BERT_STATUS_TEST_DURATION_TOO_LONG = 8; + // The given BERT operation ID is not known. Returned for `StopBert` and + // `GetBertResult` RPCs. + BERT_STATUS_OPERATION_ID_NOT_FOUND = 9; + // The given BERT operation ID is already in use. Returned when `StartBert` + // RPC uses an ID which is already memorized for a BERT operation. + BERT_STATUS_OPERATION_ID_IN_USE = 10; + // Failure to get the peer lock. + BERT_STATUS_PEER_LOCK_FAILURE = 11; + // Lost the peer lock after locking once. + BERT_STATUS_PEER_LOCK_LOST = 12; + // Misc internal errors that cannot be categorized by any of the previous + // error codes. + BERT_STATUS_INTERNAL_ERROR = 13; +} + +message StartBERTRequest { + // Per port BERT start requests. + message PerPortRequest { + // Path to the interface corresponding to the port. + types.Path interface = 1; // required + // The selected PRBS generating polynomial for BERT. + PrbsPolynomial prbs_polynomial = 2; // required + // BERT duration in seconds. Must be a positive number. + uint32 test_duration_in_secs = 3; // required + } + // Unique BERT operation ID specified by the client. Multiple BERTs run on + // different ports can have the same BERT operation ID. This ID will be used + // later to stop the operation and/or get its results. + // TODO: Investigate whether we can use numerical IDs instead. + string bert_operation_id = 1; + // All the per-port BERTs that are considered one BERT operation and have the + // same BERT operation ID. + repeated PerPortRequest per_port_requests = 2; +} + +message StartBERTResponse { + // Per-port BERT start responses. + message PerPortResponse { + // Path to the interface corresponding to the port. + types.Path interface = 1; + // BERT start status for this port. + BertStatus status = 2; + } + // The same BERT operation ID given by the request. + string bert_operation_id = 1; + // Captures the results of starting BERT on a per-port basis. + repeated PerPortResponse per_port_responses = 2; +} + +message StopBERTRequest { + // Per-port BERT stop requests. + message PerPortRequest { + // Path to the interface corresponding to the port. + types.Path interface = 1; + } + // The same BERT operation ID given when BERT operation was started. + string bert_operation_id = 1; + // All the per-port BERTs that need to be stopped. Must be part of the BERT + // operation specified by the `bert_operation_id` above. + repeated PerPortRequest per_port_requests = 2; +} + +message StopBERTResponse { + // Per-port BERT stop responses. + message PerPortResponse { + // Path to the interface corresponding to the port. + types.Path interface = 1; + // BERT stop status for this port. + BertStatus status = 2; + } + // The same BERT operation ID given by the request. + string bert_operation_id = 1; + // Captures the results of stopping BERT on a per-port basis. + repeated PerPortResponse per_port_responses = 2; +} + +// TODO: If there is no use case to get the BERT results for all the ports +// independent of the bert_operation_id, we can simplify this message and +// return the results for all the ports associated with an operation ID. +message GetBERTResultRequest { + // Per-port BERT get result requests. + message PerPortRequest { + // Path to the interface corresponding to the port. + types.Path interface = 1; + } + // The same BERT operation ID given when BERT operation was started. + string bert_operation_id = 1; + // All the per-port BERTs result of which we want to query. Must be part of + // the BERT operation specified by the `bert_operation_id` above. + repeated PerPortRequest per_port_requests = 2; + // If set to true, the results for all the per-port BERTs will be returned. + // `bert_operation_id` and `per_port_requests` will be ignored will be + // ignored in that case. + bool result_from_all_ports = 3; +} + +message GetBERTResultResponse { + // Per-port BERT results/status. + message PerPortResponse { + // Path to the interface corresponding to the port. + types.Path interface = 1; + // BERT result get status for this port. Only if the status is + // BERT_STATUS_OK are the rest of the fields meaningful. + BertStatus status = 2; + // The ID of the BERT operation running on this port. Since the caller + // can query the BERT results for all the ports, ID can potentially be + // different for different ports. + string bert_operation_id = 3; + // The selected PRBS generating polynomial for BERT on this port. + PrbsPolynomial prbs_polynomial = 4; + // The last time BERT started on this port. + uint64 last_bert_start_timestamp = 5; + // The last time BERT results were read for this port. + uint64 last_bert_get_result_timestamp = 6; + // Indicate whether BERT peer lock has was established. If false, + // `bert_lock_lost`, `error_count_per_minute`, and `total_errors` will not + // be meaningful. + bool peer_lock_established = 7; + // Indicate whether BERT peer lock was lost after being established + // once. + bool peer_lock_lost = 8; + // Sequence of bit errors per min since lock was established. + repeated uint32 error_count_per_minute = 9; + // Total number of bit errors accumulated since lock was established. + uint64 total_errors = 10; + } + // Captures the BERT results on a per-port basis. + repeated PerPortResponse per_port_responses = 1; +} diff --git a/src/sonic-framework/gnoi/diag/diag_grpc.pb.go b/src/sonic-framework/gnoi/diag/diag_grpc.pb.go new file mode 100755 index 000000000000..1c41d9c5e5b1 --- /dev/null +++ b/src/sonic-framework/gnoi/diag/diag_grpc.pb.go @@ -0,0 +1,177 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.2.0 +// - protoc v3.21.10 +// source: diag/diag.proto + +package diag + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +// DiagClient is the client API for Diag service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type DiagClient interface { + StartBERT(ctx context.Context, in *StartBERTRequest, opts ...grpc.CallOption) (*StartBERTResponse, error) + StopBERT(ctx context.Context, in *StopBERTRequest, opts ...grpc.CallOption) (*StopBERTResponse, error) + GetBERTResult(ctx context.Context, in *GetBERTResultRequest, opts ...grpc.CallOption) (*GetBERTResultResponse, error) +} + +type diagClient struct { + cc grpc.ClientConnInterface +} + +func NewDiagClient(cc grpc.ClientConnInterface) DiagClient { + return &diagClient{cc} +} + +func (c *diagClient) StartBERT(ctx context.Context, in *StartBERTRequest, opts ...grpc.CallOption) (*StartBERTResponse, error) { + out := new(StartBERTResponse) + err := c.cc.Invoke(ctx, "/gnoi.diag.Diag/StartBERT", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *diagClient) StopBERT(ctx context.Context, in *StopBERTRequest, opts ...grpc.CallOption) (*StopBERTResponse, error) { + out := new(StopBERTResponse) + err := c.cc.Invoke(ctx, "/gnoi.diag.Diag/StopBERT", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *diagClient) GetBERTResult(ctx context.Context, in *GetBERTResultRequest, opts ...grpc.CallOption) (*GetBERTResultResponse, error) { + out := new(GetBERTResultResponse) + err := c.cc.Invoke(ctx, "/gnoi.diag.Diag/GetBERTResult", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// DiagServer is the server API for Diag service. +// All implementations must embed UnimplementedDiagServer +// for forward compatibility +type DiagServer interface { + StartBERT(context.Context, *StartBERTRequest) (*StartBERTResponse, error) + StopBERT(context.Context, *StopBERTRequest) (*StopBERTResponse, error) + GetBERTResult(context.Context, *GetBERTResultRequest) (*GetBERTResultResponse, error) + mustEmbedUnimplementedDiagServer() +} + +// UnimplementedDiagServer must be embedded to have forward compatible implementations. +type UnimplementedDiagServer struct { +} + +func (UnimplementedDiagServer) StartBERT(context.Context, *StartBERTRequest) (*StartBERTResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method StartBERT not implemented") +} +func (UnimplementedDiagServer) StopBERT(context.Context, *StopBERTRequest) (*StopBERTResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method StopBERT not implemented") +} +func (UnimplementedDiagServer) GetBERTResult(context.Context, *GetBERTResultRequest) (*GetBERTResultResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetBERTResult not implemented") +} +func (UnimplementedDiagServer) mustEmbedUnimplementedDiagServer() {} + +// UnsafeDiagServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to DiagServer will +// result in compilation errors. +type UnsafeDiagServer interface { + mustEmbedUnimplementedDiagServer() +} + +func RegisterDiagServer(s grpc.ServiceRegistrar, srv DiagServer) { + s.RegisterService(&Diag_ServiceDesc, srv) +} + +func _Diag_StartBERT_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(StartBERTRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DiagServer).StartBERT(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/gnoi.diag.Diag/StartBERT", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DiagServer).StartBERT(ctx, req.(*StartBERTRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Diag_StopBERT_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(StopBERTRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DiagServer).StopBERT(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/gnoi.diag.Diag/StopBERT", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DiagServer).StopBERT(ctx, req.(*StopBERTRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Diag_GetBERTResult_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetBERTResultRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DiagServer).GetBERTResult(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/gnoi.diag.Diag/GetBERTResult", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DiagServer).GetBERTResult(ctx, req.(*GetBERTResultRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// Diag_ServiceDesc is the grpc.ServiceDesc for Diag service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Diag_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "gnoi.diag.Diag", + HandlerType: (*DiagServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "StartBERT", + Handler: _Diag_StartBERT_Handler, + }, + { + MethodName: "StopBERT", + Handler: _Diag_StopBERT_Handler, + }, + { + MethodName: "GetBERTResult", + Handler: _Diag_GetBERTResult_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "diag/diag.proto", +} diff --git a/src/sonic-framework/gnoi/docs/README.md b/src/sonic-framework/gnoi/docs/README.md new file mode 100644 index 000000000000..caae6bc7246e --- /dev/null +++ b/src/sonic-framework/gnoi/docs/README.md @@ -0,0 +1,6 @@ +# Documentation Related to gNOI + +This directory contains a set of documents supplementing the gNOI specifications. + + * [simplified_security_model.md](simplified_security_model.md) -- A simple security + model that can be implemented using gNOI. diff --git a/src/sonic-framework/gnoi/docs/best_practices.md b/src/sonic-framework/gnoi/docs/best_practices.md new file mode 100644 index 000000000000..f708e355813c --- /dev/null +++ b/src/sonic-framework/gnoi/docs/best_practices.md @@ -0,0 +1,237 @@ +# Guidelines for developing gNOI microservices + +This document delivers some guidance for helping develop gNOI microservices. + +## Why gNOI instead of gNMI? + +gNMI defines actions to retrieve or manipulate the state of a device via +telemetry or configuration data, respectively. gNOI, on the other hand, is used +to execute commands on a device rather than directly change its configuration. + +## Characteristics of a gNOI microservice + +After deciding that a gNOI microservice needs to be developed, a few aspects +should be taken into consideration. There are three fundamental components that +should be understood. + +**Interpretation** - The microservice should be easy to read and understand. The +service and RPC names should intuitively deduce its purpose. + +**Implementation** - The microservice should be easy to code. There should be no +ambiguities. The combination of the service definition together with its +documentation should offer a complete understanding of all the code paths. + +**Operation** - The microservice should be straightforward to use. Not in the +versatile sense of a single RPC fits all swiss army knife style, but that a +single RPC behaves equally across different implementations. The following +guidelines help with achieving this. + +### Thin and focused + +The microservice should be simple and focus on the process it aims to implement. +The microservice must not be overarching, it must be specialized. As such, avoid +defining a microservice that implements different unrelated actions. The +developed microservice should be categorized by the nature of the process it +implements, and not by the nature of the Target it is meant to be used on. This +also applies to the naming of the microservice. + +*Instead of this:* + +``` +service Car { + rpc Turn(...) returns (...); + rpc SetSpeed(...) returns (...); + rpc SetStation(...) returns (...); + rpc SetVolume(...) returns (...); +} +``` + +*Prefer this:* + +``` +service Guidance { + rpc Turn(...) returns (...); + rpc SetSpeed(...) returns (...); +} + +service Radio { + rpc SetStation(...) returns (...); + rpc SetVolume(...) returns (...); +} +``` + +### Shallow RPCs + +Aim for more RPCs instead of single RPCs overloaded with actions. This provides +a better path for augmenting the microservice without breaking backward +compatibility. + +*Instead of this:* + +``` +service Direction { + rpc Adjust(AdjustRequest) returns (...); +} + +message AdjustRequest { + speed = 0; + turn_angle = 1; +} +``` + +*Prefer this:** + +``` +service Guidance { + rpc Turn(...) returns (...); + rpc SetSpeed(...) returns (...); +} +``` + +### Precisely specified behavior + +By virtue of its proto definition, the microservice should already specify a +good amount of detail on what is expected of a Target that implements it. +However some details usually fall out of the proto definition. These details +must be specified meticulously as a complement to the proto definition. Take +also in consideration that prescriptions should focus on the behaviour of the +implementation, as opposed to the method of the implementation. + +*Instead of this:* + +``` +service Guidance { + // Turn sets the turn angle. The + // forward wheels must rotate to the + // expected angle. The rear wheels must + // help if applicable. + rpc Turn(...) returns (...); +} +``` + +*Prefer this:* + +``` +service Guidance { + // Turn sets the turn angle. The + // system is expected to reach the + // turn angle in less than one second. + rpc Turn(...) returns (...); +} +``` + +## Error handling + +Error handling is an important factor to take into consideration in a +microservice. There are generally two approaches that can be used for individual +scenarios. + +### Vanilla gRPC Errors + +RPC's return a gRPC error using the status definitions. See in +[golang](http://google.golang.org/genproto/googleapis/rpc/status) for examples. +These errors immediately terminate the RPC and should additionally provide +detailed messages about the nature of the error. They are useful for the +following scenarios: + +* RPC's that have a singular pass/fail criteria; +* Status RPC's that request unexpected or non existing data; +* Unexpected oneof message type used in a stream RPC workflow; +* Authentication issues; +* Network issues; + +An example: + +``` +Service Bubble { + ... + // An gRPC Unimplemented error will be returned if the target cannot generate bubbles. + rpc Generate(GenerateRequest) returns (GenerateResponse) + + rpc Count(CountRequest) returns (CountResponse) +} +``` + +### Structured Error messages + +Vanilla gRPC errors are straightforward to use but may allow ambiguity to creep +if applied on more complex scenarios. Structured Error messages help with +further documenting and scoping the proto definition which limits ambiguity. +They are, in addition, well defined signals that can be trivially consumed by +upstream workflows operating with a specific gNOI microservice. An example of an +RPC with structured error messages is seen below. + +``` +message StepLeft {} + +message StepRight {} + +message StepError { + enum Type { + UNSPECIFIED = 0; + NO_LEGS_ERROR = 1; + TIRED_ERROR = 2; + } + Type type = 1; + // The detail message must be used if type is UNSPECIFIED. + string detail = 2; +} + +message StepResponse { + oneof request { + StepLeft step_left = 1; + StepRight step_right = 2; + StepError step_error = 3; + } +} + +message StepRequest {} + +// Abort with a gRPC error if Metadata authentication fails. +rpc Step(stream StepRequest) returns (stream StepResponse) +``` + +Non zero (UNSPECIFIED) enum error types should be descriptive and in general not +require filling up the detail message. + +Note that a single RPC can still make use of both the vanilla gRPC Error and +Structured Error message approaches as long as they are applied to different +scenarios. Structured Error messages must never be accompanied by a Vanilla gRPC +Error. Structured Error messages don't necessarily require the RPC to return +immediately. + +## Versioning + +It is plausible that not all scenarios may have been taken into consideration +during the conception of a microservice. Equally, novel requirements can be +introduced. Microservices may need to expand in order to mature and accommodate +improvements. However there are two fundamental pathways to accomplish this. + +### Enhancement + +These add backward compatible incremental functionalities to the microservice. +Enhancements require little effort to implement. Enhancements must be reflected +in a version string that accompanies the specific microservice. + +``` +syntax = "proto3"; + +package gnoi.whack; + +import "github.com/openconfig/gnoi/types/types.proto"; + +option (types.gnoi_version) = "0.1.0"; + +service Whack { ... +``` + +The version string details the major, minor & micro revisions to the gNOI +microservice. + +### Evolution + +These add or change functionality to the microservice that will break previous +versions. Evolution is a result of a fundamental alteration in the expected +behaviour of the microservice. When a microservice evolves, it must not +necessarily replace the previous one. Evolutions typically result in a new, more +precise and specific service name. diff --git a/src/sonic-framework/gnoi/docs/img/bootstrapping_state.png b/src/sonic-framework/gnoi/docs/img/bootstrapping_state.png new file mode 100644 index 000000000000..bd441ef9e4de Binary files /dev/null and b/src/sonic-framework/gnoi/docs/img/bootstrapping_state.png differ diff --git a/src/sonic-framework/gnoi/docs/reserved_port.md b/src/sonic-framework/gnoi/docs/reserved_port.md new file mode 100644 index 000000000000..c6244a77135e --- /dev/null +++ b/src/sonic-framework/gnoi/docs/reserved_port.md @@ -0,0 +1,9 @@ +# IANA reserved port + +gNMI and gNOI services have a reserved port since May the 9th, 2019. Please use +this port as the default & configured port in your systems. + +` +service: gnmi-gnoi +port: 9339 +` diff --git a/src/sonic-framework/gnoi/docs/simplified_bootstrapping.md b/src/sonic-framework/gnoi/docs/simplified_bootstrapping.md new file mode 100644 index 000000000000..376ca54cdfe0 --- /dev/null +++ b/src/sonic-framework/gnoi/docs/simplified_bootstrapping.md @@ -0,0 +1,111 @@ +# Simplified Bootstrapping for gNOI and gNMI + +Updated: April 1st, 2019 + +Version: 0.1.0 + +### Definitions + +* Client is the same as defined in gNMI +* Target is the same as defined in gNMI +* gNOI [Certificate Management service](../cert/cert.proto) +* Secure connection - Encrypted and authenticated connection + +### Bootstrapping + +The gNOI Certificate Management service has the methods to install certificates +in the Target. But how does a Client use gNMI and gNOI to configure or operate a +Target, when the Target has not been given the state and trust to be able to +establish a secure connection in the first place? + +## Bootstrapping with the gNOI Certificate Management service + +When having a Target with no pre existing certificates, this method allows +installing certificates by using the gNOI Certificate Management service. +Following this installation the Target is then capable of establishing secure +gNOI/gNMI connections. This process assumes a pre-existing secure environment. +It is therefore more applicable to be used in build rooms, labs or properly +secured management networks. + +### Bootstrapping conditions + +Because the Target is not trusted, it is assumed that this bootstrapping process +happens in a secure environment. This implies that there is negligible chance of +man-in-the-middle attacks between the Client and the Target during this process. +In addition, it is assumed that the Target is not already compromised. + +### Target state + +A Target is defined as being in either the **default state** or the +**provisioned state**: + +![Target states](img/bootstrapping_state.png) + +#### Target in default state + +As in factory reset or unprovisioned state. When in this state, the Target must +provide a method for enabling the gNOI Certificate Management service if not +already enabled. In addition, the gNOI Certificate service must allow +unauthenticated connections. However, encryption should always be used, for this +a default certificate is employed. It is during this state the Client installs +the Target certificate and CA certificates bundle in the Target. + +##### Enable gNOI Certificate Management service + +The gNOI Certificate Management service must be enabled via one of the following +options: + +1. Already enabled by default; +2. Triggered to run via DHCP third party attribute; +3. Triggered to run via a compressed configuration downloaded from a location + passed by a DHCP attribute; + +The definition of such ZTP mechanisms are out of the scope of this document. + +##### Unauthenticated session + +Unauthenticated gRPC sessions are allowed in the default state. This is required +as the Target would have no way to validate the Client’s certificate as it has +no CA certificates. + +##### Encryption + +Encryption is always required as it raises the bar for potential attackers. As +such, in the default state, the Target should have and use a default +certificate. This certificate should be used only in the default state. +Resetting the Target to the default state always generates a new default +certificate or reuses a default one. + +##### Certificate ID + +The first installed certificate and CA certificate pool is used for the gNOI and +gNMI services. No other certificates should be installed during the default +stage. The certificate ID specified, becomes the associated certificate ID for +the gNMI/gNOI service. + +##### Target behaviour + +The Target must restart its gNOI/gNMI service and exclusively perform secure +connections as soon as the certificate and CA certificates have been +successfully installed, thus transitioning from the default state to the +provisioned state. The previously used default certificate must not be used once +in the provisioned state. + +##### Client behavior + +The Client, when bootstrapping a Target must not attempt to authenticate the +Target when establishing a connection. However it should still encrypt that +connection. + +#### Target in provisioned state + +When the Target is in provisioned state, the standard gNMI/gNOI authentication & +encryption rules apply. + +#### Target reset + +It must be possible to reset a Target to its default state. For a Network +Element this would be a factory reset triggered via gNOI. When executed, all +certificates and CA certificates should be cleared. A default certificate must +be generated if it does not already exist. The entire bootstrapping process +should be applicable again. diff --git a/src/sonic-framework/gnoi/docs/simplified_security_model.md b/src/sonic-framework/gnoi/docs/simplified_security_model.md new file mode 100644 index 000000000000..4b39a7eba6bb --- /dev/null +++ b/src/sonic-framework/gnoi/docs/simplified_security_model.md @@ -0,0 +1,108 @@ +# Simplified security model for the gNOI Certificate service + +Contributors: Sam Ribeiro (ribeiro@google.com), Rob Shakir (robjs@google.com), +Alireza Ghaffarkhah (aghaffar@google.com), Eric Breverman (ejbrever@google.com), +Anees Shaikh (aashaikh@google.com) + +Updated: August 7th, 2018 + +Version: 0.1.0 + +## Simplified security model + +What follows is the description of one security model and its relation with the +gNOI Certificate Service. This security model does not assert itself as the only +one that can be employed. Different security models can be defined to address +specific scenarios. + +This simplified security model makes assumptions about the installation and +rotation of certificates & CA certificates. Their assumed usage is applicable +not only to gNOI and gNMI, but also other services like OpenFlow. + +This simplified security model presumes that a secure connection between the +Target and the Client already exist for installing and rotating certificates. +Bootstrapping is out of scope for this model. + +This simplified security model assumes low risk of man-in-the-middle attacks +because it relinquishes mandating DNS verification for the Common Name of the +respective Client and Target certificates. + +## Client + +A Client is defined as per the definition in the gNMI and gNOI specifications. + +## Target + +A Target is defined as per the definition in the gNMI and gNOI specifications. + +## Peer + +Peer is an entity that participates in establishing a connection with another +entity, using whatever protocol that makes use of certificates to secure that +connection. An example would be an OpenFlow connection between an OpenFlow +switch and an OpenFlow Controller. Target and Client are particular cases of a +Peer. + +## Client is a Relying Party + +It is assumed that the Certificate Authority (CA) provides certificate signing +and generation services to the Client. The Client is therefore a Relying Party +for both certificates and CA bundles. The relationship and interaction between +the CA and the Client is out of scope for this model. + +## Secure Connection + +A secure connection is established between two Peers when mutual authentication +exists. Meaning that both Peers identify each other as genuine. An example is a +gNOI connection between the Client and the Target. The procedure for mutual +authentication is described below. + +## Target is authorized trust by the Client + +By authorized trust it is meant that the Target is granted the necessary +credentials (by the Client) to be able to identify Peers as genuine (using +whatever service uses these certificates). The Target is authorized trust by the +Client via the successful execution of either: + +* gNOI certificate installation or rotation under a Secure connection (where + the Target is not compromised), or +* other provisioning or bootstrapping mechanism described outside of the scope + of this security model. + +## Target certificate installation or rotation + +To initiate certificate installation using the gNOI Certificate Management +service: + +1. The Client sends parameters to the target so that it can generate a + certificate Signing Request (CSR). +2. The Target then generates this CSR using its Private Key. +3. The Target then replies with the certificate to the Client, which + subsequently provides the certificate to the CA to be signed. +4. The signed certificate is then returned to the Target by the Client and it + becomes one of the Target’s certificates. + +Each one of the Target’s certificate has a unique identifier, the certificate +ID. This ID is used both to install and to rotate a certificate. certificate +installation for an existing certificate ID MUST fail. Replacing an existing +certificate must rather use the certificate rotation mechanism, whose steps are +similar to the ones described above with the addition of final validation. + +## Target CA pool + +In order for the Target to validate the Client or a Peer's certificates, it must +have a pool of one or more CA certificates. These are provisioned onto the +Target by the Client during creation or rotation of the Target’s certificates. + +### Validate installed certificate + +For increased security, the Target must use certificates in its CA pool to +validate a newly installed certificate. This requires the CA pool to contain a +CA certificate that can validate the new certificate. + +## Mutual Authentication + +Mutual authentication exists when two Peers validate each other's certificate +against their CA pools. Optionally, either the Client or the Target can validate +that the Common Name (CN) in each other’s certificates matches the resolved one +for the Peer address of the connection. diff --git a/src/sonic-framework/gnoi/factory_reset/BUILD.bazel b/src/sonic-framework/gnoi/factory_reset/BUILD.bazel new file mode 100644 index 000000000000..c7a9e13823d7 --- /dev/null +++ b/src/sonic-framework/gnoi/factory_reset/BUILD.bazel @@ -0,0 +1,63 @@ +load("@rules_proto//proto:defs.bzl", "proto_library") +load("@io_bazel_rules_go//go:def.bzl", "go_library") +load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library") +load("@com_github_grpc_grpc//bazel:cc_grpc_library.bzl", "cc_grpc_library") +load("//:common.bzl", "use_new_compilers") + +#Copyright 2021 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +package( + default_visibility = ["//visibility:public"], + licenses = ["notice"], +) + +use_new_compilers() + +proto_library( + name = "factory_reset_proto", + srcs = ["factory_reset.proto"], + deps = [ + "//types:types_proto", + ], +) + +cc_proto_library( + name = "factory_reset_cc_proto", + deps = [":factory_reset_proto"], +) + +cc_grpc_library( + name = "factory_reset_cc_grpc_proto", + srcs = [":factory_reset_proto"], + grpc_only = True, + deps = [":factory_reset_cc_proto"], +) + +go_proto_library( + name = "factory_reset_go_proto", + compilers = [ + "go_protoc_gen_go", + "go_protoc_gen_go_grpc", + ], + importpath = "github.com/openconfig/gnoi/factory_reset", + proto = ":factory_reset_proto", + deps = ["//types"], +) + +go_library( + name = "factory_reset", + embed = [":factory_reset_go_proto"], + importpath = "github.com/openconfig/gnoi/factory_reset", +) diff --git a/src/sonic-framework/gnoi/factory_reset/factory_reset.pb.go b/src/sonic-framework/gnoi/factory_reset/factory_reset.pb.go new file mode 100644 index 000000000000..5b1931442674 --- /dev/null +++ b/src/sonic-framework/gnoi/factory_reset/factory_reset.pb.go @@ -0,0 +1,435 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.30.0 +// protoc v3.21.10 +// source: factory_reset/factory_reset.proto + +package factory_reset + +import ( + _ "github.com/openconfig/gnoi/types" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type StartRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + FactoryOs bool `protobuf:"varint,1,opt,name=factory_os,json=factoryOs,proto3" json:"factory_os,omitempty"` + ZeroFill bool `protobuf:"varint,2,opt,name=zero_fill,json=zeroFill,proto3" json:"zero_fill,omitempty"` + RetainCerts bool `protobuf:"varint,3,opt,name=retain_certs,json=retainCerts,proto3" json:"retain_certs,omitempty"` +} + +func (x *StartRequest) Reset() { + *x = StartRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_factory_reset_factory_reset_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StartRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StartRequest) ProtoMessage() {} + +func (x *StartRequest) ProtoReflect() protoreflect.Message { + mi := &file_factory_reset_factory_reset_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use StartRequest.ProtoReflect.Descriptor instead. +func (*StartRequest) Descriptor() ([]byte, []int) { + return file_factory_reset_factory_reset_proto_rawDescGZIP(), []int{0} +} + +func (x *StartRequest) GetFactoryOs() bool { + if x != nil { + return x.FactoryOs + } + return false +} + +func (x *StartRequest) GetZeroFill() bool { + if x != nil { + return x.ZeroFill + } + return false +} + +func (x *StartRequest) GetRetainCerts() bool { + if x != nil { + return x.RetainCerts + } + return false +} + +type ResetSuccess struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *ResetSuccess) Reset() { + *x = ResetSuccess{} + if protoimpl.UnsafeEnabled { + mi := &file_factory_reset_factory_reset_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ResetSuccess) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ResetSuccess) ProtoMessage() {} + +func (x *ResetSuccess) ProtoReflect() protoreflect.Message { + mi := &file_factory_reset_factory_reset_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ResetSuccess.ProtoReflect.Descriptor instead. +func (*ResetSuccess) Descriptor() ([]byte, []int) { + return file_factory_reset_factory_reset_proto_rawDescGZIP(), []int{1} +} + +type ResetError struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + FactoryOsUnsupported bool `protobuf:"varint,1,opt,name=factory_os_unsupported,json=factoryOsUnsupported,proto3" json:"factory_os_unsupported,omitempty"` + ZeroFillUnsupported bool `protobuf:"varint,2,opt,name=zero_fill_unsupported,json=zeroFillUnsupported,proto3" json:"zero_fill_unsupported,omitempty"` + Other bool `protobuf:"varint,3,opt,name=other,proto3" json:"other,omitempty"` + Detail string `protobuf:"bytes,4,opt,name=detail,proto3" json:"detail,omitempty"` +} + +func (x *ResetError) Reset() { + *x = ResetError{} + if protoimpl.UnsafeEnabled { + mi := &file_factory_reset_factory_reset_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ResetError) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ResetError) ProtoMessage() {} + +func (x *ResetError) ProtoReflect() protoreflect.Message { + mi := &file_factory_reset_factory_reset_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ResetError.ProtoReflect.Descriptor instead. +func (*ResetError) Descriptor() ([]byte, []int) { + return file_factory_reset_factory_reset_proto_rawDescGZIP(), []int{2} +} + +func (x *ResetError) GetFactoryOsUnsupported() bool { + if x != nil { + return x.FactoryOsUnsupported + } + return false +} + +func (x *ResetError) GetZeroFillUnsupported() bool { + if x != nil { + return x.ZeroFillUnsupported + } + return false +} + +func (x *ResetError) GetOther() bool { + if x != nil { + return x.Other + } + return false +} + +func (x *ResetError) GetDetail() string { + if x != nil { + return x.Detail + } + return "" +} + +type StartResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Response: + // + // *StartResponse_ResetSuccess + // *StartResponse_ResetError + Response isStartResponse_Response `protobuf_oneof:"response"` +} + +func (x *StartResponse) Reset() { + *x = StartResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_factory_reset_factory_reset_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StartResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StartResponse) ProtoMessage() {} + +func (x *StartResponse) ProtoReflect() protoreflect.Message { + mi := &file_factory_reset_factory_reset_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use StartResponse.ProtoReflect.Descriptor instead. +func (*StartResponse) Descriptor() ([]byte, []int) { + return file_factory_reset_factory_reset_proto_rawDescGZIP(), []int{3} +} + +func (m *StartResponse) GetResponse() isStartResponse_Response { + if m != nil { + return m.Response + } + return nil +} + +func (x *StartResponse) GetResetSuccess() *ResetSuccess { + if x, ok := x.GetResponse().(*StartResponse_ResetSuccess); ok { + return x.ResetSuccess + } + return nil +} + +func (x *StartResponse) GetResetError() *ResetError { + if x, ok := x.GetResponse().(*StartResponse_ResetError); ok { + return x.ResetError + } + return nil +} + +type isStartResponse_Response interface { + isStartResponse_Response() +} + +type StartResponse_ResetSuccess struct { + ResetSuccess *ResetSuccess `protobuf:"bytes,1,opt,name=reset_success,json=resetSuccess,proto3,oneof"` +} + +type StartResponse_ResetError struct { + ResetError *ResetError `protobuf:"bytes,2,opt,name=reset_error,json=resetError,proto3,oneof"` +} + +func (*StartResponse_ResetSuccess) isStartResponse_Response() {} + +func (*StartResponse_ResetError) isStartResponse_Response() {} + +var File_factory_reset_factory_reset_proto protoreflect.FileDescriptor + +var file_factory_reset_factory_reset_proto_rawDesc = []byte{ + 0x0a, 0x21, 0x66, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x79, 0x5f, 0x72, 0x65, 0x73, 0x65, 0x74, 0x2f, + 0x66, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x79, 0x5f, 0x72, 0x65, 0x73, 0x65, 0x74, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x12, 0x12, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x66, 0x61, 0x63, 0x74, 0x6f, 0x72, + 0x79, 0x5f, 0x72, 0x65, 0x73, 0x65, 0x74, 0x1a, 0x2c, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, + 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x67, + 0x6e, 0x6f, 0x69, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x6d, 0x0a, 0x0c, 0x53, 0x74, 0x61, 0x72, 0x74, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x66, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x79, + 0x5f, 0x6f, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x66, 0x61, 0x63, 0x74, 0x6f, + 0x72, 0x79, 0x4f, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x7a, 0x65, 0x72, 0x6f, 0x5f, 0x66, 0x69, 0x6c, + 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x7a, 0x65, 0x72, 0x6f, 0x46, 0x69, 0x6c, + 0x6c, 0x12, 0x21, 0x0a, 0x0c, 0x72, 0x65, 0x74, 0x61, 0x69, 0x6e, 0x5f, 0x63, 0x65, 0x72, 0x74, + 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x72, 0x65, 0x74, 0x61, 0x69, 0x6e, 0x43, + 0x65, 0x72, 0x74, 0x73, 0x22, 0x0e, 0x0a, 0x0c, 0x52, 0x65, 0x73, 0x65, 0x74, 0x53, 0x75, 0x63, + 0x63, 0x65, 0x73, 0x73, 0x22, 0xa4, 0x01, 0x0a, 0x0a, 0x52, 0x65, 0x73, 0x65, 0x74, 0x45, 0x72, + 0x72, 0x6f, 0x72, 0x12, 0x34, 0x0a, 0x16, 0x66, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x79, 0x5f, 0x6f, + 0x73, 0x5f, 0x75, 0x6e, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x08, 0x52, 0x14, 0x66, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x79, 0x4f, 0x73, 0x55, 0x6e, + 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x12, 0x32, 0x0a, 0x15, 0x7a, 0x65, 0x72, + 0x6f, 0x5f, 0x66, 0x69, 0x6c, 0x6c, 0x5f, 0x75, 0x6e, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, + 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x13, 0x7a, 0x65, 0x72, 0x6f, 0x46, 0x69, + 0x6c, 0x6c, 0x55, 0x6e, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x12, 0x14, 0x0a, + 0x05, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x6f, 0x74, + 0x68, 0x65, 0x72, 0x12, 0x16, 0x0a, 0x06, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x22, 0xa7, 0x01, 0x0a, 0x0d, + 0x53, 0x74, 0x61, 0x72, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x47, 0x0a, + 0x0d, 0x72, 0x65, 0x73, 0x65, 0x74, 0x5f, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x66, 0x61, 0x63, 0x74, + 0x6f, 0x72, 0x79, 0x5f, 0x72, 0x65, 0x73, 0x65, 0x74, 0x2e, 0x52, 0x65, 0x73, 0x65, 0x74, 0x53, + 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x48, 0x00, 0x52, 0x0c, 0x72, 0x65, 0x73, 0x65, 0x74, 0x53, + 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x41, 0x0a, 0x0b, 0x72, 0x65, 0x73, 0x65, 0x74, 0x5f, + 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x67, 0x6e, + 0x6f, 0x69, 0x2e, 0x66, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x79, 0x5f, 0x72, 0x65, 0x73, 0x65, 0x74, + 0x2e, 0x52, 0x65, 0x73, 0x65, 0x74, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x48, 0x00, 0x52, 0x0a, 0x72, + 0x65, 0x73, 0x65, 0x74, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x42, 0x0a, 0x0a, 0x08, 0x72, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0x5c, 0x0a, 0x0c, 0x46, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x79, + 0x52, 0x65, 0x73, 0x65, 0x74, 0x12, 0x4c, 0x0a, 0x05, 0x53, 0x74, 0x61, 0x72, 0x74, 0x12, 0x20, + 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x66, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x79, 0x5f, 0x72, 0x65, + 0x73, 0x65, 0x74, 0x2e, 0x53, 0x74, 0x61, 0x72, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x21, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x66, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x79, 0x5f, + 0x72, 0x65, 0x73, 0x65, 0x74, 0x2e, 0x53, 0x74, 0x61, 0x72, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x42, 0x32, 0xd2, 0x3e, 0x05, 0x30, 0x2e, 0x31, 0x2e, 0x30, 0x5a, 0x28, 0x67, + 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6f, + 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x67, 0x6e, 0x6f, 0x69, 0x2f, 0x66, 0x61, 0x63, 0x74, 0x6f, 0x72, + 0x79, 0x5f, 0x72, 0x65, 0x73, 0x65, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_factory_reset_factory_reset_proto_rawDescOnce sync.Once + file_factory_reset_factory_reset_proto_rawDescData = file_factory_reset_factory_reset_proto_rawDesc +) + +func file_factory_reset_factory_reset_proto_rawDescGZIP() []byte { + file_factory_reset_factory_reset_proto_rawDescOnce.Do(func() { + file_factory_reset_factory_reset_proto_rawDescData = protoimpl.X.CompressGZIP(file_factory_reset_factory_reset_proto_rawDescData) + }) + return file_factory_reset_factory_reset_proto_rawDescData +} + +var file_factory_reset_factory_reset_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_factory_reset_factory_reset_proto_goTypes = []interface{}{ + (*StartRequest)(nil), // 0: gnoi.factory_reset.StartRequest + (*ResetSuccess)(nil), // 1: gnoi.factory_reset.ResetSuccess + (*ResetError)(nil), // 2: gnoi.factory_reset.ResetError + (*StartResponse)(nil), // 3: gnoi.factory_reset.StartResponse +} +var file_factory_reset_factory_reset_proto_depIdxs = []int32{ + 1, // 0: gnoi.factory_reset.StartResponse.reset_success:type_name -> gnoi.factory_reset.ResetSuccess + 2, // 1: gnoi.factory_reset.StartResponse.reset_error:type_name -> gnoi.factory_reset.ResetError + 0, // 2: gnoi.factory_reset.FactoryReset.Start:input_type -> gnoi.factory_reset.StartRequest + 3, // 3: gnoi.factory_reset.FactoryReset.Start:output_type -> gnoi.factory_reset.StartResponse + 3, // [3:4] is the sub-list for method output_type + 2, // [2:3] is the sub-list for method input_type + 2, // [2:2] is the sub-list for extension type_name + 2, // [2:2] is the sub-list for extension extendee + 0, // [0:2] is the sub-list for field type_name +} + +func init() { file_factory_reset_factory_reset_proto_init() } +func file_factory_reset_factory_reset_proto_init() { + if File_factory_reset_factory_reset_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_factory_reset_factory_reset_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StartRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_factory_reset_factory_reset_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ResetSuccess); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_factory_reset_factory_reset_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ResetError); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_factory_reset_factory_reset_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StartResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_factory_reset_factory_reset_proto_msgTypes[3].OneofWrappers = []interface{}{ + (*StartResponse_ResetSuccess)(nil), + (*StartResponse_ResetError)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_factory_reset_factory_reset_proto_rawDesc, + NumEnums: 0, + NumMessages: 4, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_factory_reset_factory_reset_proto_goTypes, + DependencyIndexes: file_factory_reset_factory_reset_proto_depIdxs, + MessageInfos: file_factory_reset_factory_reset_proto_msgTypes, + }.Build() + File_factory_reset_factory_reset_proto = out.File + file_factory_reset_factory_reset_proto_rawDesc = nil + file_factory_reset_factory_reset_proto_goTypes = nil + file_factory_reset_factory_reset_proto_depIdxs = nil +} diff --git a/src/sonic-framework/gnoi/factory_reset/factory_reset.proto b/src/sonic-framework/gnoi/factory_reset/factory_reset.proto new file mode 100644 index 000000000000..a035c636008a --- /dev/null +++ b/src/sonic-framework/gnoi/factory_reset/factory_reset.proto @@ -0,0 +1,62 @@ +// This file defines a gNOI API used for factory reseting a Target. +syntax = "proto3"; + +package gnoi.factory_reset; + +import "github.com/openconfig/gnoi/types/types.proto"; + +option go_package = "github.com/openconfig/gnoi/factory_reset"; + +option (types.gnoi_version) = "0.1.0"; + +// The FactoryReset service exported by Targets. +service FactoryReset { + // The Start RPC allows the Client to instruct the Target to immediately + // clean all existing state and boot the Target in the same condition as it is + // shipped from factory. State includes storage, configuration, logs, + // certificates and licenses. + // + // Optionally allows rolling back the OS to the same version shipped from + // factory. + // + // Optionally allows for the Target to zero-fill permanent storage where state + // data is stored. + // + // If any of the optional flags is set but not supported, a gRPC Status with + // code INVALID_ARGUMENT must be returned with the details value set to a + // properly populated ResetError message. + rpc Start(StartRequest) returns (StartResponse); +} + +message StartRequest { + // Instructs the Target to rollback the OS to the same version as it shipped + // from factory. + bool factory_os = 1; + // Instructs the Target to zero fill persistent storage state data. + bool zero_fill = 2; + // Instructs the Target to retain certificates + bool retain_certs = 3; +} + +message ResetSuccess { +} + +// Message also used in gRPC status.details field. +message ResetError { + // Factory OS reset is not supported. + bool factory_os_unsupported = 1; + // Zero fill is not supported. + bool zero_fill_unsupported = 2; + // Unspecified error, must provide detail message. + bool other = 3; + string detail = 4; +} + +message StartResponse { + oneof response { + // Reset will be executed. + ResetSuccess reset_success = 1; + // Reset will not be executed. + ResetError reset_error = 2; + } +} diff --git a/src/sonic-framework/gnoi/factory_reset/factory_reset_grpc.pb.go b/src/sonic-framework/gnoi/factory_reset/factory_reset_grpc.pb.go new file mode 100755 index 000000000000..40d4c0f96c85 --- /dev/null +++ b/src/sonic-framework/gnoi/factory_reset/factory_reset_grpc.pb.go @@ -0,0 +1,105 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.2.0 +// - protoc v3.21.10 +// source: factory_reset/factory_reset.proto + +package factory_reset + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +// FactoryResetClient is the client API for FactoryReset service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type FactoryResetClient interface { + Start(ctx context.Context, in *StartRequest, opts ...grpc.CallOption) (*StartResponse, error) +} + +type factoryResetClient struct { + cc grpc.ClientConnInterface +} + +func NewFactoryResetClient(cc grpc.ClientConnInterface) FactoryResetClient { + return &factoryResetClient{cc} +} + +func (c *factoryResetClient) Start(ctx context.Context, in *StartRequest, opts ...grpc.CallOption) (*StartResponse, error) { + out := new(StartResponse) + err := c.cc.Invoke(ctx, "/gnoi.factory_reset.FactoryReset/Start", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// FactoryResetServer is the server API for FactoryReset service. +// All implementations must embed UnimplementedFactoryResetServer +// for forward compatibility +type FactoryResetServer interface { + Start(context.Context, *StartRequest) (*StartResponse, error) + mustEmbedUnimplementedFactoryResetServer() +} + +// UnimplementedFactoryResetServer must be embedded to have forward compatible implementations. +type UnimplementedFactoryResetServer struct { +} + +func (UnimplementedFactoryResetServer) Start(context.Context, *StartRequest) (*StartResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Start not implemented") +} +func (UnimplementedFactoryResetServer) mustEmbedUnimplementedFactoryResetServer() {} + +// UnsafeFactoryResetServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to FactoryResetServer will +// result in compilation errors. +type UnsafeFactoryResetServer interface { + mustEmbedUnimplementedFactoryResetServer() +} + +func RegisterFactoryResetServer(s grpc.ServiceRegistrar, srv FactoryResetServer) { + s.RegisterService(&FactoryReset_ServiceDesc, srv) +} + +func _FactoryReset_Start_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(StartRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(FactoryResetServer).Start(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/gnoi.factory_reset.FactoryReset/Start", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(FactoryResetServer).Start(ctx, req.(*StartRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// FactoryReset_ServiceDesc is the grpc.ServiceDesc for FactoryReset service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var FactoryReset_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "gnoi.factory_reset.FactoryReset", + HandlerType: (*FactoryResetServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Start", + Handler: _FactoryReset_Start_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "factory_reset/factory_reset.proto", +} diff --git a/src/sonic-framework/gnoi/file/BUILD.bazel b/src/sonic-framework/gnoi/file/BUILD.bazel new file mode 100644 index 000000000000..eb6ce04bfa41 --- /dev/null +++ b/src/sonic-framework/gnoi/file/BUILD.bazel @@ -0,0 +1,67 @@ +load("@rules_proto//proto:defs.bzl", "proto_library") +load("@io_bazel_rules_go//go:def.bzl", "go_library") +load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library") +load("@com_github_grpc_grpc//bazel:cc_grpc_library.bzl", "cc_grpc_library") +load("//:common.bzl", "use_new_compilers") + +#Copyright 2021 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +package( + default_visibility = ["//visibility:public"], + licenses = ["notice"], +) + +use_new_compilers() + +proto_library( + name = "file_proto", + srcs = ["file.proto"], + deps = [ + "//common:common_proto", + "//types:types_proto", + ], +) + +cc_proto_library( + name = "file_cc_proto", + deps = [":file_proto"], +) + +cc_grpc_library( + name = "file_cc_grpc_proto", + srcs = [":file_proto"], + grpc_only = True, + deps = [":file_cc_proto"], +) + +go_proto_library( + name = "file_go_proto", + compilers = [ + "go_protoc_gen_go", + "go_protoc_gen_go_grpc", + ], + importpath = "github.com/openconfig/gnoi/file", + proto = ":file_proto", + deps = [ + "//common", + "//types", + ], +) + +go_library( + name = "file", + embed = [":file_go_proto"], + importpath = "github.com/openconfig/gnoi/file", +) diff --git a/src/sonic-framework/gnoi/file/file.pb.go b/src/sonic-framework/gnoi/file/file.pb.go new file mode 100644 index 000000000000..fe87551ed8e4 --- /dev/null +++ b/src/sonic-framework/gnoi/file/file.pb.go @@ -0,0 +1,1026 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.30.0 +// protoc v3.21.10 +// source: file/file.proto + +package file + +import ( + common "github.com/openconfig/gnoi/common" + types "github.com/openconfig/gnoi/types" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type PutRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Request: + // + // *PutRequest_Open + // *PutRequest_Contents + // *PutRequest_Hash + Request isPutRequest_Request `protobuf_oneof:"request"` +} + +func (x *PutRequest) Reset() { + *x = PutRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_file_file_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PutRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PutRequest) ProtoMessage() {} + +func (x *PutRequest) ProtoReflect() protoreflect.Message { + mi := &file_file_file_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PutRequest.ProtoReflect.Descriptor instead. +func (*PutRequest) Descriptor() ([]byte, []int) { + return file_file_file_proto_rawDescGZIP(), []int{0} +} + +func (m *PutRequest) GetRequest() isPutRequest_Request { + if m != nil { + return m.Request + } + return nil +} + +func (x *PutRequest) GetOpen() *PutRequest_Details { + if x, ok := x.GetRequest().(*PutRequest_Open); ok { + return x.Open + } + return nil +} + +func (x *PutRequest) GetContents() []byte { + if x, ok := x.GetRequest().(*PutRequest_Contents); ok { + return x.Contents + } + return nil +} + +func (x *PutRequest) GetHash() *types.HashType { + if x, ok := x.GetRequest().(*PutRequest_Hash); ok { + return x.Hash + } + return nil +} + +type isPutRequest_Request interface { + isPutRequest_Request() +} + +type PutRequest_Open struct { + Open *PutRequest_Details `protobuf:"bytes,1,opt,name=open,proto3,oneof"` +} + +type PutRequest_Contents struct { + Contents []byte `protobuf:"bytes,2,opt,name=contents,proto3,oneof"` +} + +type PutRequest_Hash struct { + Hash *types.HashType `protobuf:"bytes,3,opt,name=hash,proto3,oneof"` +} + +func (*PutRequest_Open) isPutRequest_Request() {} + +func (*PutRequest_Contents) isPutRequest_Request() {} + +func (*PutRequest_Hash) isPutRequest_Request() {} + +type PutResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *PutResponse) Reset() { + *x = PutResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_file_file_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PutResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PutResponse) ProtoMessage() {} + +func (x *PutResponse) ProtoReflect() protoreflect.Message { + mi := &file_file_file_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PutResponse.ProtoReflect.Descriptor instead. +func (*PutResponse) Descriptor() ([]byte, []int) { + return file_file_file_proto_rawDescGZIP(), []int{1} +} + +type GetRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + RemoteFile string `protobuf:"bytes,1,opt,name=remote_file,json=remoteFile,proto3" json:"remote_file,omitempty"` +} + +func (x *GetRequest) Reset() { + *x = GetRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_file_file_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetRequest) ProtoMessage() {} + +func (x *GetRequest) ProtoReflect() protoreflect.Message { + mi := &file_file_file_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetRequest.ProtoReflect.Descriptor instead. +func (*GetRequest) Descriptor() ([]byte, []int) { + return file_file_file_proto_rawDescGZIP(), []int{2} +} + +func (x *GetRequest) GetRemoteFile() string { + if x != nil { + return x.RemoteFile + } + return "" +} + +type GetResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Response: + // + // *GetResponse_Contents + // *GetResponse_Hash + Response isGetResponse_Response `protobuf_oneof:"response"` +} + +func (x *GetResponse) Reset() { + *x = GetResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_file_file_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetResponse) ProtoMessage() {} + +func (x *GetResponse) ProtoReflect() protoreflect.Message { + mi := &file_file_file_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetResponse.ProtoReflect.Descriptor instead. +func (*GetResponse) Descriptor() ([]byte, []int) { + return file_file_file_proto_rawDescGZIP(), []int{3} +} + +func (m *GetResponse) GetResponse() isGetResponse_Response { + if m != nil { + return m.Response + } + return nil +} + +func (x *GetResponse) GetContents() []byte { + if x, ok := x.GetResponse().(*GetResponse_Contents); ok { + return x.Contents + } + return nil +} + +func (x *GetResponse) GetHash() *types.HashType { + if x, ok := x.GetResponse().(*GetResponse_Hash); ok { + return x.Hash + } + return nil +} + +type isGetResponse_Response interface { + isGetResponse_Response() +} + +type GetResponse_Contents struct { + Contents []byte `protobuf:"bytes,1,opt,name=contents,proto3,oneof"` +} + +type GetResponse_Hash struct { + Hash *types.HashType `protobuf:"bytes,2,opt,name=hash,proto3,oneof"` +} + +func (*GetResponse_Contents) isGetResponse_Response() {} + +func (*GetResponse_Hash) isGetResponse_Response() {} + +type TransferToRemoteRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + LocalPath string `protobuf:"bytes,1,opt,name=local_path,json=localPath,proto3" json:"local_path,omitempty"` + RemoteDownload *common.RemoteDownload `protobuf:"bytes,2,opt,name=remote_download,json=remoteDownload,proto3" json:"remote_download,omitempty"` +} + +func (x *TransferToRemoteRequest) Reset() { + *x = TransferToRemoteRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_file_file_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TransferToRemoteRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TransferToRemoteRequest) ProtoMessage() {} + +func (x *TransferToRemoteRequest) ProtoReflect() protoreflect.Message { + mi := &file_file_file_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TransferToRemoteRequest.ProtoReflect.Descriptor instead. +func (*TransferToRemoteRequest) Descriptor() ([]byte, []int) { + return file_file_file_proto_rawDescGZIP(), []int{4} +} + +func (x *TransferToRemoteRequest) GetLocalPath() string { + if x != nil { + return x.LocalPath + } + return "" +} + +func (x *TransferToRemoteRequest) GetRemoteDownload() *common.RemoteDownload { + if x != nil { + return x.RemoteDownload + } + return nil +} + +type TransferToRemoteResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Hash *types.HashType `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"` +} + +func (x *TransferToRemoteResponse) Reset() { + *x = TransferToRemoteResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_file_file_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TransferToRemoteResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TransferToRemoteResponse) ProtoMessage() {} + +func (x *TransferToRemoteResponse) ProtoReflect() protoreflect.Message { + mi := &file_file_file_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TransferToRemoteResponse.ProtoReflect.Descriptor instead. +func (*TransferToRemoteResponse) Descriptor() ([]byte, []int) { + return file_file_file_proto_rawDescGZIP(), []int{5} +} + +func (x *TransferToRemoteResponse) GetHash() *types.HashType { + if x != nil { + return x.Hash + } + return nil +} + +type StatRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Path string `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"` +} + +func (x *StatRequest) Reset() { + *x = StatRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_file_file_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StatRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StatRequest) ProtoMessage() {} + +func (x *StatRequest) ProtoReflect() protoreflect.Message { + mi := &file_file_file_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use StatRequest.ProtoReflect.Descriptor instead. +func (*StatRequest) Descriptor() ([]byte, []int) { + return file_file_file_proto_rawDescGZIP(), []int{6} +} + +func (x *StatRequest) GetPath() string { + if x != nil { + return x.Path + } + return "" +} + +type StatResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Stats []*StatInfo `protobuf:"bytes,1,rep,name=stats,proto3" json:"stats,omitempty"` +} + +func (x *StatResponse) Reset() { + *x = StatResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_file_file_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StatResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StatResponse) ProtoMessage() {} + +func (x *StatResponse) ProtoReflect() protoreflect.Message { + mi := &file_file_file_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use StatResponse.ProtoReflect.Descriptor instead. +func (*StatResponse) Descriptor() ([]byte, []int) { + return file_file_file_proto_rawDescGZIP(), []int{7} +} + +func (x *StatResponse) GetStats() []*StatInfo { + if x != nil { + return x.Stats + } + return nil +} + +type StatInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Path string `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"` + LastModified uint64 `protobuf:"varint,2,opt,name=last_modified,json=lastModified,proto3" json:"last_modified,omitempty"` + Permissions uint32 `protobuf:"varint,3,opt,name=permissions,proto3" json:"permissions,omitempty"` + Size uint64 `protobuf:"varint,4,opt,name=size,proto3" json:"size,omitempty"` + Umask uint32 `protobuf:"varint,5,opt,name=umask,proto3" json:"umask,omitempty"` +} + +func (x *StatInfo) Reset() { + *x = StatInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_file_file_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StatInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StatInfo) ProtoMessage() {} + +func (x *StatInfo) ProtoReflect() protoreflect.Message { + mi := &file_file_file_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use StatInfo.ProtoReflect.Descriptor instead. +func (*StatInfo) Descriptor() ([]byte, []int) { + return file_file_file_proto_rawDescGZIP(), []int{8} +} + +func (x *StatInfo) GetPath() string { + if x != nil { + return x.Path + } + return "" +} + +func (x *StatInfo) GetLastModified() uint64 { + if x != nil { + return x.LastModified + } + return 0 +} + +func (x *StatInfo) GetPermissions() uint32 { + if x != nil { + return x.Permissions + } + return 0 +} + +func (x *StatInfo) GetSize() uint64 { + if x != nil { + return x.Size + } + return 0 +} + +func (x *StatInfo) GetUmask() uint32 { + if x != nil { + return x.Umask + } + return 0 +} + +type RemoveRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + RemoteFile string `protobuf:"bytes,1,opt,name=remote_file,json=remoteFile,proto3" json:"remote_file,omitempty"` +} + +func (x *RemoveRequest) Reset() { + *x = RemoveRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_file_file_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RemoveRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RemoveRequest) ProtoMessage() {} + +func (x *RemoveRequest) ProtoReflect() protoreflect.Message { + mi := &file_file_file_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RemoveRequest.ProtoReflect.Descriptor instead. +func (*RemoveRequest) Descriptor() ([]byte, []int) { + return file_file_file_proto_rawDescGZIP(), []int{9} +} + +func (x *RemoveRequest) GetRemoteFile() string { + if x != nil { + return x.RemoteFile + } + return "" +} + +type RemoveResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *RemoveResponse) Reset() { + *x = RemoveResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_file_file_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RemoveResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RemoveResponse) ProtoMessage() {} + +func (x *RemoveResponse) ProtoReflect() protoreflect.Message { + mi := &file_file_file_proto_msgTypes[10] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RemoveResponse.ProtoReflect.Descriptor instead. +func (*RemoveResponse) Descriptor() ([]byte, []int) { + return file_file_file_proto_rawDescGZIP(), []int{10} +} + +type PutRequest_Details struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + RemoteFile string `protobuf:"bytes,1,opt,name=remote_file,json=remoteFile,proto3" json:"remote_file,omitempty"` + Permissions uint32 `protobuf:"varint,2,opt,name=permissions,proto3" json:"permissions,omitempty"` +} + +func (x *PutRequest_Details) Reset() { + *x = PutRequest_Details{} + if protoimpl.UnsafeEnabled { + mi := &file_file_file_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PutRequest_Details) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PutRequest_Details) ProtoMessage() {} + +func (x *PutRequest_Details) ProtoReflect() protoreflect.Message { + mi := &file_file_file_proto_msgTypes[11] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PutRequest_Details.ProtoReflect.Descriptor instead. +func (*PutRequest_Details) Descriptor() ([]byte, []int) { + return file_file_file_proto_rawDescGZIP(), []int{0, 0} +} + +func (x *PutRequest_Details) GetRemoteFile() string { + if x != nil { + return x.RemoteFile + } + return "" +} + +func (x *PutRequest_Details) GetPermissions() uint32 { + if x != nil { + return x.Permissions + } + return 0 +} + +var File_file_file_proto protoreflect.FileDescriptor + +var file_file_file_proto_rawDesc = []byte{ + 0x0a, 0x0f, 0x66, 0x69, 0x6c, 0x65, 0x2f, 0x66, 0x69, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x12, 0x09, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x66, 0x69, 0x6c, 0x65, 0x1a, 0x2e, 0x67, 0x69, + 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6f, 0x6e, + 0x66, 0x69, 0x67, 0x2f, 0x67, 0x6e, 0x6f, 0x69, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, + 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2c, 0x67, 0x69, + 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6f, 0x6e, + 0x66, 0x69, 0x67, 0x2f, 0x67, 0x6e, 0x6f, 0x69, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x74, + 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xe4, 0x01, 0x0a, 0x0a, 0x50, + 0x75, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x33, 0x0a, 0x04, 0x6f, 0x70, 0x65, + 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x66, + 0x69, 0x6c, 0x65, 0x2e, 0x50, 0x75, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x44, + 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x48, 0x00, 0x52, 0x04, 0x6f, 0x70, 0x65, 0x6e, 0x12, 0x1c, + 0x0a, 0x08, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, + 0x48, 0x00, 0x52, 0x08, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x2a, 0x0a, 0x04, + 0x68, 0x61, 0x73, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6e, 0x6f, + 0x69, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x48, 0x61, 0x73, 0x68, 0x54, 0x79, 0x70, 0x65, + 0x48, 0x00, 0x52, 0x04, 0x68, 0x61, 0x73, 0x68, 0x1a, 0x4c, 0x0a, 0x07, 0x44, 0x65, 0x74, 0x61, + 0x69, 0x6c, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x5f, 0x66, 0x69, + 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, + 0x46, 0x69, 0x6c, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, + 0x6f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0b, 0x70, 0x65, 0x72, 0x6d, 0x69, + 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x42, 0x09, 0x0a, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x22, 0x0d, 0x0a, 0x0b, 0x50, 0x75, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x2d, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1f, + 0x0a, 0x0b, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0a, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x46, 0x69, 0x6c, 0x65, 0x22, + 0x63, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1c, + 0x0a, 0x08, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, + 0x48, 0x00, 0x52, 0x08, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x2a, 0x0a, 0x04, + 0x68, 0x61, 0x73, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6e, 0x6f, + 0x69, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x48, 0x61, 0x73, 0x68, 0x54, 0x79, 0x70, 0x65, + 0x48, 0x00, 0x52, 0x04, 0x68, 0x61, 0x73, 0x68, 0x42, 0x0a, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x7e, 0x0a, 0x17, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, + 0x54, 0x6f, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x1d, 0x0a, 0x0a, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x09, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x50, 0x61, 0x74, 0x68, 0x12, 0x44, + 0x0a, 0x0f, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x5f, 0x64, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, + 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x63, + 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x44, 0x6f, 0x77, 0x6e, + 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x0e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x44, 0x6f, 0x77, 0x6e, + 0x6c, 0x6f, 0x61, 0x64, 0x22, 0x44, 0x0a, 0x18, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, + 0x54, 0x6f, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x28, 0x0a, 0x04, 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, + 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x48, 0x61, 0x73, 0x68, + 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x68, 0x61, 0x73, 0x68, 0x22, 0x21, 0x0a, 0x0b, 0x53, 0x74, + 0x61, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, + 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x22, 0x39, 0x0a, + 0x0c, 0x53, 0x74, 0x61, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x29, 0x0a, + 0x05, 0x73, 0x74, 0x61, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x67, + 0x6e, 0x6f, 0x69, 0x2e, 0x66, 0x69, 0x6c, 0x65, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x49, 0x6e, 0x66, + 0x6f, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x73, 0x22, 0x8f, 0x01, 0x0a, 0x08, 0x53, 0x74, 0x61, + 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x12, 0x23, 0x0a, 0x0d, 0x6c, 0x61, 0x73, + 0x74, 0x5f, 0x6d, 0x6f, 0x64, 0x69, 0x66, 0x69, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, + 0x52, 0x0c, 0x6c, 0x61, 0x73, 0x74, 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x69, 0x65, 0x64, 0x12, 0x20, + 0x0a, 0x0b, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x0d, 0x52, 0x0b, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, + 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x04, + 0x73, 0x69, 0x7a, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x75, 0x6d, 0x61, 0x73, 0x6b, 0x18, 0x05, 0x20, + 0x01, 0x28, 0x0d, 0x52, 0x05, 0x75, 0x6d, 0x61, 0x73, 0x6b, 0x22, 0x30, 0x0a, 0x0d, 0x52, 0x65, + 0x6d, 0x6f, 0x76, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x72, + 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0a, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x46, 0x69, 0x6c, 0x65, 0x22, 0x10, 0x0a, 0x0e, + 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0xd5, + 0x02, 0x0a, 0x04, 0x46, 0x69, 0x6c, 0x65, 0x12, 0x38, 0x0a, 0x03, 0x47, 0x65, 0x74, 0x12, 0x15, + 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x66, 0x69, 0x6c, 0x65, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x66, 0x69, 0x6c, + 0x65, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x30, + 0x01, 0x12, 0x5d, 0x0a, 0x10, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x54, 0x6f, 0x52, + 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x12, 0x22, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x66, 0x69, 0x6c, + 0x65, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x54, 0x6f, 0x52, 0x65, 0x6d, 0x6f, + 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x67, 0x6e, 0x6f, 0x69, + 0x2e, 0x66, 0x69, 0x6c, 0x65, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x54, 0x6f, + 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, + 0x12, 0x38, 0x0a, 0x03, 0x50, 0x75, 0x74, 0x12, 0x15, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x66, + 0x69, 0x6c, 0x65, 0x2e, 0x50, 0x75, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, + 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x66, 0x69, 0x6c, 0x65, 0x2e, 0x50, 0x75, 0x74, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x28, 0x01, 0x12, 0x39, 0x0a, 0x04, 0x53, 0x74, + 0x61, 0x74, 0x12, 0x16, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x66, 0x69, 0x6c, 0x65, 0x2e, 0x53, + 0x74, 0x61, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x67, 0x6e, 0x6f, + 0x69, 0x2e, 0x66, 0x69, 0x6c, 0x65, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x3f, 0x0a, 0x06, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x12, + 0x18, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x66, 0x69, 0x6c, 0x65, 0x2e, 0x52, 0x65, 0x6d, 0x6f, + 0x76, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x67, 0x6e, 0x6f, 0x69, + 0x2e, 0x66, 0x69, 0x6c, 0x65, 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x29, 0xd2, 0x3e, 0x05, 0x30, 0x2e, 0x31, 0x2e, 0x30, + 0x5a, 0x1f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x70, 0x65, + 0x6e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x67, 0x6e, 0x6f, 0x69, 0x2f, 0x66, 0x69, 0x6c, + 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_file_file_proto_rawDescOnce sync.Once + file_file_file_proto_rawDescData = file_file_file_proto_rawDesc +) + +func file_file_file_proto_rawDescGZIP() []byte { + file_file_file_proto_rawDescOnce.Do(func() { + file_file_file_proto_rawDescData = protoimpl.X.CompressGZIP(file_file_file_proto_rawDescData) + }) + return file_file_file_proto_rawDescData +} + +var file_file_file_proto_msgTypes = make([]protoimpl.MessageInfo, 12) +var file_file_file_proto_goTypes = []interface{}{ + (*PutRequest)(nil), // 0: gnoi.file.PutRequest + (*PutResponse)(nil), // 1: gnoi.file.PutResponse + (*GetRequest)(nil), // 2: gnoi.file.GetRequest + (*GetResponse)(nil), // 3: gnoi.file.GetResponse + (*TransferToRemoteRequest)(nil), // 4: gnoi.file.TransferToRemoteRequest + (*TransferToRemoteResponse)(nil), // 5: gnoi.file.TransferToRemoteResponse + (*StatRequest)(nil), // 6: gnoi.file.StatRequest + (*StatResponse)(nil), // 7: gnoi.file.StatResponse + (*StatInfo)(nil), // 8: gnoi.file.StatInfo + (*RemoveRequest)(nil), // 9: gnoi.file.RemoveRequest + (*RemoveResponse)(nil), // 10: gnoi.file.RemoveResponse + (*PutRequest_Details)(nil), // 11: gnoi.file.PutRequest.Details + (*types.HashType)(nil), // 12: gnoi.types.HashType + (*common.RemoteDownload)(nil), // 13: gnoi.common.RemoteDownload +} +var file_file_file_proto_depIdxs = []int32{ + 11, // 0: gnoi.file.PutRequest.open:type_name -> gnoi.file.PutRequest.Details + 12, // 1: gnoi.file.PutRequest.hash:type_name -> gnoi.types.HashType + 12, // 2: gnoi.file.GetResponse.hash:type_name -> gnoi.types.HashType + 13, // 3: gnoi.file.TransferToRemoteRequest.remote_download:type_name -> gnoi.common.RemoteDownload + 12, // 4: gnoi.file.TransferToRemoteResponse.hash:type_name -> gnoi.types.HashType + 8, // 5: gnoi.file.StatResponse.stats:type_name -> gnoi.file.StatInfo + 2, // 6: gnoi.file.File.Get:input_type -> gnoi.file.GetRequest + 4, // 7: gnoi.file.File.TransferToRemote:input_type -> gnoi.file.TransferToRemoteRequest + 0, // 8: gnoi.file.File.Put:input_type -> gnoi.file.PutRequest + 6, // 9: gnoi.file.File.Stat:input_type -> gnoi.file.StatRequest + 9, // 10: gnoi.file.File.Remove:input_type -> gnoi.file.RemoveRequest + 3, // 11: gnoi.file.File.Get:output_type -> gnoi.file.GetResponse + 5, // 12: gnoi.file.File.TransferToRemote:output_type -> gnoi.file.TransferToRemoteResponse + 1, // 13: gnoi.file.File.Put:output_type -> gnoi.file.PutResponse + 7, // 14: gnoi.file.File.Stat:output_type -> gnoi.file.StatResponse + 10, // 15: gnoi.file.File.Remove:output_type -> gnoi.file.RemoveResponse + 11, // [11:16] is the sub-list for method output_type + 6, // [6:11] is the sub-list for method input_type + 6, // [6:6] is the sub-list for extension type_name + 6, // [6:6] is the sub-list for extension extendee + 0, // [0:6] is the sub-list for field type_name +} + +func init() { file_file_file_proto_init() } +func file_file_file_proto_init() { + if File_file_file_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_file_file_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PutRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_file_file_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PutResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_file_file_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_file_file_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_file_file_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TransferToRemoteRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_file_file_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TransferToRemoteResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_file_file_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StatRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_file_file_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StatResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_file_file_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StatInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_file_file_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RemoveRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_file_file_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RemoveResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_file_file_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PutRequest_Details); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_file_file_proto_msgTypes[0].OneofWrappers = []interface{}{ + (*PutRequest_Open)(nil), + (*PutRequest_Contents)(nil), + (*PutRequest_Hash)(nil), + } + file_file_file_proto_msgTypes[3].OneofWrappers = []interface{}{ + (*GetResponse_Contents)(nil), + (*GetResponse_Hash)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_file_file_proto_rawDesc, + NumEnums: 0, + NumMessages: 12, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_file_file_proto_goTypes, + DependencyIndexes: file_file_file_proto_depIdxs, + MessageInfos: file_file_file_proto_msgTypes, + }.Build() + File_file_file_proto = out.File + file_file_file_proto_rawDesc = nil + file_file_file_proto_goTypes = nil + file_file_file_proto_depIdxs = nil +} diff --git a/src/sonic-framework/gnoi/file/file.proto b/src/sonic-framework/gnoi/file/file.proto new file mode 100644 index 000000000000..16c975eee7dc --- /dev/null +++ b/src/sonic-framework/gnoi/file/file.proto @@ -0,0 +1,163 @@ +// +// Copyright 2017 Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +syntax = "proto3"; + +package gnoi.file; + +import "github.com/openconfig/gnoi/common/common.proto"; +import "github.com/openconfig/gnoi/types/types.proto"; + +option go_package = "github.com/openconfig/gnoi/file"; + +option (types.gnoi_version) = "0.1.0"; + +service File { + // Get reads and streams the contents of a file from the target. + // The file is streamed by sequential messages, each containing up to + // 64KB of data. A final message is sent prior to closing the stream + // that contains the hash of the data sent. An error is returned + // if the file does not exist or there was an error reading the file. + rpc Get(GetRequest) returns (stream GetResponse) {} + + // TransferToRemote transfers the contents of a file from the target to a + // specified remote location. The response contains the hash of the data + // transferred. An error is returned if the file does not exist, the file + // transfer fails, or if there was an error reading the file. This is a + // blocking call until the file transfer is complete. + rpc TransferToRemote(TransferToRemoteRequest) + returns (TransferToRemoteResponse) {} + + // Put streams data into a file on the target. The file is sent in + // sequential messages, each message containing up to 64KB of data. A final + // message must be sent that includes the hash of the data sent. An + // error is returned if the location does not exist or there is an error + // writing the data. If no checksum is received, the target must assume the + // operation is incomplete and remove the partially transmitted file. The + // target should initially write the file to a temporary location so a failure + // does not destroy the original file. + rpc Put(stream PutRequest) returns (PutResponse) {} + + + // Stat returns metadata about a file on the target. An error is returned + // if the file does not exist of there is an error in accessing the metadata. + rpc Stat(StatRequest) returns (StatResponse) {} + + // Remove removes the specified file from the target. An error is + // returned if the file does not exist, is a directory, or the remove + // operation encounters an error (e.g., permission denied). + rpc Remove(RemoveRequest) returns (RemoveResponse) {} +} + +// A PutRequest is used to send data to be written on a file on the target. +// +// The initial message contains an Open message. The Open message contains +// information name of the file and the file's permisssions. +// +// The remote_file must be an absolute path. If remote_file already exists on +// the target, it is overwritten, otherwise it is created. If the path to +// remote_file doesn't exist it will be created. +// +// The contents to be written are streamed through multiple messages using the +// contents field. Each message may contain up to 64KB of data. +// +// The final message of the RPC contains the hash of the file contents. +message PutRequest { + message Details { + string remote_file = 1; + // Permissions are represented as the octal format of standard UNIX + // file permissions. + // ex. 775: user read/write/execute, group read/write/execute, + // global read/execute. + uint32 permissions = 2; + } + oneof request { + Details open = 1; + bytes contents = 2; + gnoi.types.HashType hash = 3; // hash of the file. + } +} + +message PutResponse { +} + +// A GetRequest specifies the remote_file to be streamed back +// to the caller. The remote_file must be an absolute path to an +// existing file. +message GetRequest { + string remote_file = 1; +} + +// A GetResponse either contains the next set of bytes read from the +// file or, as the last message, the hash of the data. +message GetResponse { + oneof response { + bytes contents = 1; + gnoi.types.HashType hash = 2; // hash of the file. + } +} + +// A TransferToRemoteRequest specifies the local path to transfer to and the +// details on where to transfer the data from. The local_path must be an +// absolute path to the file. +message TransferToRemoteRequest { + string local_path = 1; + + // Details to download the remote_file being requested to a remote location. + gnoi.common.RemoteDownload remote_download = 2; +} + +// A TransferToRemoteResponse contains the hash of the data transferred. +message TransferToRemoteResponse { + types.HashType hash = 1; // hash of the file. +} + +// StatRequest will list files at the provided path. +message StatRequest { + string path = 1; +} + +// StatResponse contains list of stat info of the provided path. +message StatResponse { + repeated StatInfo stats = 1; +} + +// StatInfo provides a file system information about a particular path. +message StatInfo { + string path = 1; + uint64 last_modified = 2; // Nanoseconds since epoch. + // Permissions are represented as the octal format of standard UNIX + // file permissions. + // ex. 775: user read/write/execute, group read/write/execute, + // global read/execute. + // The value returned in this field should be the octal number. No base + // conversion should be required to read the value. For example, 0755 + // should result in the permissions field holding the value 755, 4644 + // results in the permissions field being 4644, and so on. + uint32 permissions = 3; + uint64 size = 4; + // Default file creation mask. Represented as the octal format of + // standard UNIX mask. + uint32 umask = 5; +} + +// A RemoveRequest specifies a file to be removed from the target. +message RemoveRequest { + string remote_file = 1; +} + +message RemoveResponse { +} diff --git a/src/sonic-framework/gnoi/file/file_grpc.pb.go b/src/sonic-framework/gnoi/file/file_grpc.pb.go new file mode 100755 index 000000000000..bbcb5a74cc30 --- /dev/null +++ b/src/sonic-framework/gnoi/file/file_grpc.pb.go @@ -0,0 +1,311 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.2.0 +// - protoc v3.21.10 +// source: file/file.proto + +package file + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +// FileClient is the client API for File service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type FileClient interface { + Get(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (File_GetClient, error) + TransferToRemote(ctx context.Context, in *TransferToRemoteRequest, opts ...grpc.CallOption) (*TransferToRemoteResponse, error) + Put(ctx context.Context, opts ...grpc.CallOption) (File_PutClient, error) + Stat(ctx context.Context, in *StatRequest, opts ...grpc.CallOption) (*StatResponse, error) + Remove(ctx context.Context, in *RemoveRequest, opts ...grpc.CallOption) (*RemoveResponse, error) +} + +type fileClient struct { + cc grpc.ClientConnInterface +} + +func NewFileClient(cc grpc.ClientConnInterface) FileClient { + return &fileClient{cc} +} + +func (c *fileClient) Get(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (File_GetClient, error) { + stream, err := c.cc.NewStream(ctx, &File_ServiceDesc.Streams[0], "/gnoi.file.File/Get", opts...) + if err != nil { + return nil, err + } + x := &fileGetClient{stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +type File_GetClient interface { + Recv() (*GetResponse, error) + grpc.ClientStream +} + +type fileGetClient struct { + grpc.ClientStream +} + +func (x *fileGetClient) Recv() (*GetResponse, error) { + m := new(GetResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *fileClient) TransferToRemote(ctx context.Context, in *TransferToRemoteRequest, opts ...grpc.CallOption) (*TransferToRemoteResponse, error) { + out := new(TransferToRemoteResponse) + err := c.cc.Invoke(ctx, "/gnoi.file.File/TransferToRemote", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *fileClient) Put(ctx context.Context, opts ...grpc.CallOption) (File_PutClient, error) { + stream, err := c.cc.NewStream(ctx, &File_ServiceDesc.Streams[1], "/gnoi.file.File/Put", opts...) + if err != nil { + return nil, err + } + x := &filePutClient{stream} + return x, nil +} + +type File_PutClient interface { + Send(*PutRequest) error + CloseAndRecv() (*PutResponse, error) + grpc.ClientStream +} + +type filePutClient struct { + grpc.ClientStream +} + +func (x *filePutClient) Send(m *PutRequest) error { + return x.ClientStream.SendMsg(m) +} + +func (x *filePutClient) CloseAndRecv() (*PutResponse, error) { + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + m := new(PutResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *fileClient) Stat(ctx context.Context, in *StatRequest, opts ...grpc.CallOption) (*StatResponse, error) { + out := new(StatResponse) + err := c.cc.Invoke(ctx, "/gnoi.file.File/Stat", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *fileClient) Remove(ctx context.Context, in *RemoveRequest, opts ...grpc.CallOption) (*RemoveResponse, error) { + out := new(RemoveResponse) + err := c.cc.Invoke(ctx, "/gnoi.file.File/Remove", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// FileServer is the server API for File service. +// All implementations must embed UnimplementedFileServer +// for forward compatibility +type FileServer interface { + Get(*GetRequest, File_GetServer) error + TransferToRemote(context.Context, *TransferToRemoteRequest) (*TransferToRemoteResponse, error) + Put(File_PutServer) error + Stat(context.Context, *StatRequest) (*StatResponse, error) + Remove(context.Context, *RemoveRequest) (*RemoveResponse, error) + mustEmbedUnimplementedFileServer() +} + +// UnimplementedFileServer must be embedded to have forward compatible implementations. +type UnimplementedFileServer struct { +} + +func (UnimplementedFileServer) Get(*GetRequest, File_GetServer) error { + return status.Errorf(codes.Unimplemented, "method Get not implemented") +} +func (UnimplementedFileServer) TransferToRemote(context.Context, *TransferToRemoteRequest) (*TransferToRemoteResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method TransferToRemote not implemented") +} +func (UnimplementedFileServer) Put(File_PutServer) error { + return status.Errorf(codes.Unimplemented, "method Put not implemented") +} +func (UnimplementedFileServer) Stat(context.Context, *StatRequest) (*StatResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Stat not implemented") +} +func (UnimplementedFileServer) Remove(context.Context, *RemoveRequest) (*RemoveResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Remove not implemented") +} +func (UnimplementedFileServer) mustEmbedUnimplementedFileServer() {} + +// UnsafeFileServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to FileServer will +// result in compilation errors. +type UnsafeFileServer interface { + mustEmbedUnimplementedFileServer() +} + +func RegisterFileServer(s grpc.ServiceRegistrar, srv FileServer) { + s.RegisterService(&File_ServiceDesc, srv) +} + +func _File_Get_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(GetRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(FileServer).Get(m, &fileGetServer{stream}) +} + +type File_GetServer interface { + Send(*GetResponse) error + grpc.ServerStream +} + +type fileGetServer struct { + grpc.ServerStream +} + +func (x *fileGetServer) Send(m *GetResponse) error { + return x.ServerStream.SendMsg(m) +} + +func _File_TransferToRemote_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(TransferToRemoteRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(FileServer).TransferToRemote(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/gnoi.file.File/TransferToRemote", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(FileServer).TransferToRemote(ctx, req.(*TransferToRemoteRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _File_Put_Handler(srv interface{}, stream grpc.ServerStream) error { + return srv.(FileServer).Put(&filePutServer{stream}) +} + +type File_PutServer interface { + SendAndClose(*PutResponse) error + Recv() (*PutRequest, error) + grpc.ServerStream +} + +type filePutServer struct { + grpc.ServerStream +} + +func (x *filePutServer) SendAndClose(m *PutResponse) error { + return x.ServerStream.SendMsg(m) +} + +func (x *filePutServer) Recv() (*PutRequest, error) { + m := new(PutRequest) + if err := x.ServerStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func _File_Stat_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(StatRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(FileServer).Stat(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/gnoi.file.File/Stat", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(FileServer).Stat(ctx, req.(*StatRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _File_Remove_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(RemoveRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(FileServer).Remove(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/gnoi.file.File/Remove", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(FileServer).Remove(ctx, req.(*RemoveRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// File_ServiceDesc is the grpc.ServiceDesc for File service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var File_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "gnoi.file.File", + HandlerType: (*FileServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "TransferToRemote", + Handler: _File_TransferToRemote_Handler, + }, + { + MethodName: "Stat", + Handler: _File_Stat_Handler, + }, + { + MethodName: "Remove", + Handler: _File_Remove_Handler, + }, + }, + Streams: []grpc.StreamDesc{ + { + StreamName: "Get", + Handler: _File_Get_Handler, + ServerStreams: true, + }, + { + StreamName: "Put", + Handler: _File_Put_Handler, + ClientStreams: true, + }, + }, + Metadata: "file/file.proto", +} diff --git a/src/sonic-framework/gnoi/gnoi_deps.bzl b/src/sonic-framework/gnoi/gnoi_deps.bzl new file mode 100644 index 000000000000..dbdf1bd9dd24 --- /dev/null +++ b/src/sonic-framework/gnoi/gnoi_deps.bzl @@ -0,0 +1,476 @@ +# Copyright 2021 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +"""Dependencies to build gnoi.""" + +load("@bazel_gazelle//:deps.bzl", "go_repository") +load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") + +def gnoi_deps(): + """Declare the third-party dependencies necessary to build gnoi""" + if not native.existing_rule("rules_proto_grpc"): + http_archive( + name = "rules_proto_grpc", + sha256 = "c0d718f4d892c524025504e67a5bfe83360b3a982e654bc71fed7514eb8ac8ad", + strip_prefix = "rules_proto_grpc-4.6.0", + urls = ["https://github.com/rules-proto-grpc/rules_proto_grpc/archive/4.6.0.tar.gz"], + ) + if not native.existing_rule("com_github_grpc_grpc"): + http_archive( + name = "com_github_grpc_grpc", + url = "https://github.com/grpc/grpc/archive/refs/tags/v1.61.1.tar.gz", + strip_prefix = "grpc-1.61.1", + sha256 = "b74ce7d26fe187970d1d8e2c06a5d3391122f7bc1fdce569aff5e435fb8fe780", + ) + if not native.existing_rule("com_google_protobuf"): + http_archive( + name = "com_google_protobuf", + url = "https://github.com/protocolbuffers/protobuf/releases/download/v4.25.2/protobuf-all-25.2.tar.gz", + strip_prefix = "protobuf-", + sha256 = "ba0650be1b169d24908eeddbe6107f011d8df0da5b1a5a4449a913b10e578faf", + ) + if not native.existing_rule("com_github_openconfig_bootz"): + go_repository( + name = "com_github_openconfig_bootz", + importpath = "github.com/openconfig/bootz", + sum = "h1:Q0mThGmZiX/kht+crar6FtLVxqdjUS/deMnpcNX+F7c=", + version = "v0.3.1", + ) + if not native.existing_rule("com_github_openconfig_gnmi"): + go_repository( + name = "com_github_openconfig_gnmi", + build_directives = [ + "gazelle:proto_import_prefix github.com/openconfig/gnmi", + ], + build_file_generation = "on", + importpath = "github.com/openconfig/gnmi", + sum = "h1:H7pLIb/o3xObu3+x0Fv9DCK7TH3FUh7mNwbYe+34hFw=", + version = "v0.11.0", + ) + if not native.existing_rule("com_github_openconfig_gnsi"): + go_repository( + name = "com_github_openconfig_gnsi", + importpath = "github.com/openconfig/gnsi", + sum = "h1:PfQa9Gy0lH1sHqA2L3Gj2fEh2zPMbWxMmIRQv2Nk1T8=", + version = "v1.6.0", + ) + if not native.existing_rule("com_github_kylelemons_godebug"): + go_repository( + name = "com_github_kylelemons_godebug", + importpath = "github.com/kylelemons/godebug", + sum = "h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc=", + version = "v1.1.0", + ) + if not native.existing_rule("com_github_openconfig_goyang"): + go_repository( + name = "com_github_openconfig_goyang", + importpath = "github.com/openconfig/goyang", + sum = "h1:Z95LskKYk6nBYOxHtmJCu3YEKlr3pJLWG1tYAaNh3yU=", + version = "v0.2.9", + ) + if not native.existing_rule("com_github_openconfig_ygot"): + go_repository( + name = "com_github_openconfig_ygot", + build_directives = [ + "gazelle:proto_import_prefix github.com/openconfig/ygot", + ], + importpath = "github.com/openconfig/ygot", + sum = "h1:EKaeFhx1WwTZGsYeqipyh1mfF8y+z2StaXZtwVnXklk=", + version = "v0.13.1", + ) + go_repository( + name = "com_github_cenkalti_backoff_v4", + importpath = "github.com/cenkalti/backoff/v4", + sum = "h1:G2HAfAmvm/GcKan2oOQpBXOd2tT2G57ZnZGWa1PxPBQ=", + version = "v4.1.1", + ) + go_repository( + name = "com_github_census_instrumentation_opencensus_proto", + importpath = "github.com/census-instrumentation/opencensus-proto", + sum = "h1:iKLQ0xPNFxR/2hzXZMrBo8f1j86j5WHzznCCQxV/b8g=", + version = "v0.4.1", + ) + go_repository( + name = "com_github_cespare_xxhash_v2", + importpath = "github.com/cespare/xxhash/v2", + sum = "h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs=", + version = "v2.3.0", + ) + go_repository( + name = "com_github_chappjc_logrus_prefix", + importpath = "github.com/chappjc/logrus-prefix", + sum = "h1:aZTKxMminKeQWHtzJBbV8TttfTxzdJ+7iEJFE6FmUzg=", + version = "v0.0.0-20180227015900-3a1d64819adb", + ) + go_repository( + name = "com_github_cncf_xds_go", + importpath = "github.com/cncf/xds/go", + sum = "h1:ga8SEFjZ60pxLcmhnThWgvH2wg8376yUJmPhEH4H3kw=", + version = "v0.0.0-20240423153145-555b57ec207b", + ) + go_repository( + name = "com_github_coredhcp_coredhcp", + importpath = "github.com/coredhcp/coredhcp", + sum = "h1:8bGxpjqPoic463Lr0Uqnnz7P/xSZCPKDkxkjeywS79k=", + version = "v0.0.0-20230808195049-3e32ddb5ac86", + ) + go_repository( + name = "com_github_envoyproxy_go_control_plane", + importpath = "github.com/envoyproxy/go-control-plane", + sum = "h1:4X+VP1GHd1Mhj6IB5mMeGbLCleqxjletLK6K0rbxyZI=", + version = "v0.12.0", + ) + go_repository( + name = "com_github_envoyproxy_protoc_gen_validate", + importpath = "github.com/envoyproxy/protoc-gen-validate", + sum = "h1:gVPz/FMfvh57HdSJQyvBtF00j8JU4zdyUgIUNhlgg0A=", + version = "v1.0.4", + ) + go_repository( + name = "com_github_fsnotify_fsnotify", + importpath = "github.com/fsnotify/fsnotify", + sum = "h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY=", + version = "v1.6.0", + ) + go_repository( + name = "com_github_golang_glog", + importpath = "github.com/golang/glog", + sum = "h1:OptwRhECazUx5ix5TTWC3EZhsZEHWcYWY4FQHTIubm4=", + version = "v1.2.1", + ) + go_repository( + name = "com_github_golang_protobuf", + importpath = "github.com/golang/protobuf", + sum = "h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek=", + version = "v1.5.4", + ) + go_repository( + name = "com_github_google_go_cmp", + importpath = "github.com/google/go-cmp", + sum = "h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=", + version = "v0.6.0", + ) + go_repository( + name = "com_github_google_gopacket", + importpath = "github.com/google/gopacket", + sum = "h1:ves8RnFZPGiFnTS0uPQStjwru6uO6h+nlr9j6fL7kF8=", + version = "v1.1.19", + ) + go_repository( + name = "com_github_google_uuid", + importpath = "github.com/google/uuid", + sum = "h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=", + version = "v1.6.0", + ) + go_repository( + name = "com_github_h_fam_errdiff", + importpath = "github.com/h-fam/errdiff", + sum = "h1:rPsW4ob2fMOIulwTEoZXaaUIuud7XUudw5SLKTZj3Ss=", + version = "v1.0.2", + ) + go_repository( + name = "com_github_hashicorp_hcl", + importpath = "github.com/hashicorp/hcl", + sum = "h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4=", + version = "v1.0.0", + ) + go_repository( + name = "com_github_insomniacslk_dhcp", + importpath = "github.com/insomniacslk/dhcp", + sum = "h1:S33o3djA1nPRd+d/bf7jbbXytXuK/EoXow7+aa76grQ=", + version = "v0.0.0-20230908212754-65c27093e38a", + ) + go_repository( + name = "com_github_josharian_native", + importpath = "github.com/josharian/native", + sum = "h1:uuaP0hAbW7Y4l0ZRQ6C9zfb7Mg1mbFKry/xzDAfmtLA=", + version = "v1.1.0", + ) + go_repository( + name = "com_github_kylelemons_godebug", + importpath = "github.com/kylelemons/godebug", + sum = "h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc=", + version = "v1.1.0", + ) + go_repository( + name = "com_github_magiconair_properties", + importpath = "github.com/magiconair/properties", + sum = "h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY=", + version = "v1.8.7", + ) + go_repository( + name = "com_github_mattn_go_colorable", + importpath = "github.com/mattn/go-colorable", + sum = "h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA=", + version = "v0.1.13", + ) + go_repository( + name = "com_github_mattn_go_isatty", + importpath = "github.com/mattn/go-isatty", + sum = "h1:JITubQf0MOLdlGRuRq+jtsDlekdYPia9ZFsB8h/APPA=", + version = "v0.0.19", + ) + go_repository( + name = "com_github_mgutz_ansi", + importpath = "github.com/mgutz/ansi", + sum = "h1:5PJl274Y63IEHC+7izoQE9x6ikvDFZS2mDVS3drnohI=", + version = "v0.0.0-20200706080929-d51e80ef957d", + ) + go_repository( + name = "com_github_mitchellh_go_wordwrap", + importpath = "github.com/mitchellh/go-wordwrap", + sum = "h1:TLuKupo69TCn6TQSyGxwI1EblZZEsQ0vMlAFQflz0v0=", + version = "v1.0.1", + ) + go_repository( + name = "com_github_mitchellh_mapstructure", + importpath = "github.com/mitchellh/mapstructure", + sum = "h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY=", + version = "v1.5.0", + ) + go_repository( + name = "com_github_nxadm_tail", + importpath = "github.com/nxadm/tail", + sum = "h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE=", + version = "v1.4.8", + ) + go_repository( + name = "com_github_openconfig_bootz", + importpath = "github.com/openconfig/bootz", + sum = "h1:Q0mThGmZiX/kht+crar6FtLVxqdjUS/deMnpcNX+F7c=", + version = "v0.3.1", + ) + go_repository( + name = "com_github_openconfig_goyang", + importpath = "github.com/openconfig/goyang", + sum = "h1:5MyIz4bN4vpH6aHDN339bkWXAjTkhg1ZKMhR4aIi5Rk=", + version = "v0.0.0-20200115183954-d0a48929f0ea", + ) + go_repository( + name = "com_github_openconfig_grpctunnel", + importpath = "github.com/openconfig/grpctunnel", + sum = "h1:t6SvvdfWCMlw0XPlsdxO8EgO+q/fXnTevDjdYREKFwU=", + version = "v0.0.0-20220819142823-6f5422b8ca70", + ) + go_repository( + name = "com_github_openconfig_ygot", + importpath = "github.com/openconfig/ygot", + sum = "h1:kJJFPBrczC6TDnz/HMlFTJEdW2CuyUftV13XveIukg0=", + version = "v0.6.0", + ) + go_repository( + name = "com_github_pelletier_go_toml_v2", + importpath = "github.com/pelletier/go-toml/v2", + sum = "h1:uH2qQXheeefCCkuBBSLi7jCiSmj3VRh2+Goq2N7Xxu0=", + version = "v2.0.9", + ) + go_repository( + name = "com_github_pierrec_lz4_v4", + importpath = "github.com/pierrec/lz4/v4", + sum = "h1:xaKrnTkyoqfh1YItXl56+6KJNVYWlEEPuAQW9xsplYQ=", + version = "v4.1.18", + ) + go_repository( + name = "com_github_protocolbuffers_txtpbfmt", + importpath = "github.com/protocolbuffers/txtpbfmt", + sum = "h1:AKJY61V2SQtJ2a2PdeswKk0NM1qF77X+julRNYRxPOk=", + version = "v0.0.0-20220608084003-fc78c767cd6a", + ) + go_repository( + name = "com_github_rifflock_lfshook", + importpath = "github.com/rifflock/lfshook", + sum = "h1:mZHayPoR0lNmnHyvtYjDeq0zlVHn9K/ZXoy17ylucdo=", + version = "v0.0.0-20180920164130-b9218ef580f5", + ) + go_repository( + name = "com_github_sirupsen_logrus", + importpath = "github.com/sirupsen/logrus", + sum = "h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ=", + version = "v1.9.3", + ) + go_repository( + name = "com_github_spf13_afero", + importpath = "github.com/spf13/afero", + sum = "h1:stMpOSZFs//0Lv29HduCmli3GUfpFoF3Y1Q/aXj/wVM=", + version = "v1.9.5", + ) + go_repository( + name = "com_github_spf13_cast", + importpath = "github.com/spf13/cast", + sum = "h1:R+kOtfhWQE6TVQzY+4D7wJLBgkdVasCEFxSUBYBYIlA=", + version = "v1.5.1", + ) + go_repository( + name = "com_github_spf13_jwalterweatherman", + importpath = "github.com/spf13/jwalterweatherman", + sum = "h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk=", + version = "v1.1.0", + ) + go_repository( + name = "com_github_spf13_pflag", + importpath = "github.com/spf13/pflag", + sum = "h1:zqmyTlQyufRC65JnImJ6H1Sf7BDj8bG31EV919NVEQc=", + version = "v1.0.6-0.20201009195203-85dd5c8bc61c", + ) + go_repository( + name = "com_github_spf13_viper", + importpath = "github.com/spf13/viper", + sum = "h1:rGGH0XDZhdUOryiDWjmIvUSWpbNqisK8Wk0Vyefw8hc=", + version = "v1.16.0", + ) + go_repository( + name = "com_github_subosito_gotenv", + importpath = "github.com/subosito/gotenv", + sum = "h1:X1TuBLAMDFbaTAChgCBLu3DU3UPyELpnF2jjJ2cz/S8=", + version = "v1.4.2", + ) + go_repository( + name = "com_github_u_root_uio", + importpath = "github.com/u-root/uio", + sum = "h1:YcojQL98T/OO+rybuzn2+5KrD5dBwXIvYBvQ2cD3Avg=", + version = "v0.0.0-20230305220412-3e8cd9d6bf63", + ) + go_repository( + name = "com_google_cloud_go_compute", + importpath = "cloud.google.com/go/compute", + sum = "h1:phWcR2eWzRJaL/kOiJwfFsPs4BaKq1j6vnpZrc1YlVg=", + version = "v1.24.0", + ) + go_repository( + name = "com_google_cloud_go_compute_metadata", + importpath = "cloud.google.com/go/compute/metadata", + sum = "h1:Tz+eQXMEqDIKRsmY3cHTL6FVaynIjX2QxYC4trgAKZc=", + version = "v0.3.0", + ) + go_repository( + name = "dev_cel_expr", + importpath = "cel.dev/expr", + sum = "h1:O1jzfJCQBfL5BFoYktaxwIhuttaQPsVWerH9/EEKx0w=", + version = "v0.15.0", + ) + + go_repository( + name = "in_gopkg_ini_v1", + importpath = "gopkg.in/ini.v1", + sum = "h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA=", + version = "v1.67.0", + ) + go_repository( + name = "in_gopkg_yaml_v3", + importpath = "gopkg.in/yaml.v3", + sum = "h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=", + version = "v3.0.1", + ) + go_repository( + name = "org_golang_google_appengine", + importpath = "google.golang.org/appengine", + sum = "h1:IhEN5q69dyKagZPYMSdIjS2HqprW324FRQZJcGqPAsM=", + version = "v1.6.8", + ) + go_repository( + name = "org_golang_google_genproto", + importpath = "google.golang.org/genproto", + sum = "h1:KpwkzHKEF7B9Zxg18WzOa7djJ+Ha5DzthMyZYQfEn2A=", + version = "v0.0.0-20230410155749-daa745c078e1", + ) + go_repository( + name = "org_golang_google_genproto_googleapis_api", + importpath = "google.golang.org/genproto/googleapis/api", + sum = "h1:7whR9kGa5LUwFtpLm2ArCEejtnxlGeLbAyjFY8sGNFw=", + version = "v0.0.0-20240528184218-531527333157", + ) + go_repository( + name = "org_golang_google_genproto_googleapis_rpc", + importpath = "google.golang.org/genproto/googleapis/rpc", + sum = "h1:Zy9XzmMEflZ/MAaA7vNcoebnRAld7FsPW1EeBB7V0m8=", + version = "v0.0.0-20240528184218-531527333157", + ) + go_repository( + name = "org_golang_google_grpc", + importpath = "google.golang.org/grpc", + sum = "h1:bs/cUb4lp1G5iImFFd3u5ixQzweKizoZJAwBNLR42lc=", + version = "v1.65.0", + ) + go_repository( + name = "org_golang_google_protobuf", + importpath = "google.golang.org/protobuf", + sum = "h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg=", + version = "v1.34.2", + ) + go_repository( + name = "org_golang_x_crypto", + importpath = "golang.org/x/crypto", + sum = "h1:dIJU/v2J8Mdglj/8rJ6UUOM3Zc9zLZxVZwwxMooUSAI=", + version = "v0.23.0", + ) + go_repository( + name = "org_golang_x_mod", + importpath = "golang.org/x/mod", + sum = "h1:LUYupSeNrTNCGzR/hVBk2NHZO4hXcVaW1k4Qx7rjPx8=", + version = "v0.8.0", + ) + go_repository( + name = "org_golang_x_net", + importpath = "golang.org/x/net", + sum = "h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac=", + version = "v0.25.0", + ) + go_repository( + name = "org_golang_x_oauth2", + importpath = "golang.org/x/oauth2", + sum = "h1:4mQdhULixXKP1rwYBW0vAijoXnkTG0BLCDRzfe1idMo=", + version = "v0.20.0", + ) + go_repository( + name = "org_golang_x_sync", + importpath = "golang.org/x/sync", + sum = "h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M=", + version = "v0.7.0", + ) + go_repository( + name = "org_golang_x_sys", + importpath = "golang.org/x/sys", + sum = "h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y=", + version = "v0.20.0", + ) + go_repository( + name = "org_golang_x_term", + importpath = "golang.org/x/term", + sum = "h1:VnkxpohqXaOBYJtBmEppKUG6mXpi+4O6purfc2+sMhw=", + version = "v0.20.0", + ) + go_repository( + name = "org_golang_x_text", + importpath = "golang.org/x/text", + sum = "h1:h1V/4gjBv8v9cjcR6+AR5+/cIYK5N/WAgiv4xlsEtAk=", + version = "v0.15.0", + ) + go_repository( + name = "org_golang_x_tools", + importpath = "golang.org/x/tools", + sum = "h1:BOw41kyTf3PuCW1pVQf8+Cyg8pMlkYB1oo9iJ6D/lKM=", + version = "v0.6.0", + ) + go_repository( + name = "org_golang_x_xerrors", + importpath = "golang.org/x/xerrors", + sum = "h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE=", + version = "v0.0.0-20200804184101-5ec99f83aff1", + ) + go_repository( + name = "org_mozilla_go_pkcs7", + importpath = "go.mozilla.org/pkcs7", + sum = "h1:CCriYyAfq1Br1aIYettdHZTy8mBTIPo7We18TuO/bak=", + version = "v0.0.0-20210826202110-33d05740a352", + ) diff --git a/src/sonic-framework/gnoi/go.mod b/src/sonic-framework/gnoi/go.mod new file mode 100644 index 000000000000..1bddaf09b967 --- /dev/null +++ b/src/sonic-framework/gnoi/go.mod @@ -0,0 +1,19 @@ +module github.com/openconfig/gnoi + +go 1.21 + +require ( + github.com/golang/protobuf v1.5.4 + github.com/openconfig/bootz v0.3.1 + github.com/openconfig/gnsi v1.6.0 + google.golang.org/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157 + google.golang.org/grpc v1.65.0 + google.golang.org/protobuf v1.34.2 +) + +require ( + github.com/openconfig/gnmi v0.10.0 // indirect + golang.org/x/net v0.25.0 // indirect + golang.org/x/sys v0.20.0 // indirect + golang.org/x/text v0.15.0 // indirect +) diff --git a/src/sonic-framework/gnoi/go.sum b/src/sonic-framework/gnoi/go.sum new file mode 100644 index 000000000000..da6d2b959c9e --- /dev/null +++ b/src/sonic-framework/gnoi/go.sum @@ -0,0 +1,22 @@ +github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= +github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/openconfig/bootz v0.3.1 h1:Q0mThGmZiX/kht+crar6FtLVxqdjUS/deMnpcNX+F7c= +github.com/openconfig/bootz v0.3.1/go.mod h1:IhVtV9zS/2i8rKXHkRW9eD2UV6zGeIXYtLcEzAeyc6A= +github.com/openconfig/gnmi v0.10.0 h1:kQEZ/9ek3Vp2Y5IVuV2L/ba8/77TgjdXg505QXvYmg8= +github.com/openconfig/gnmi v0.10.0/go.mod h1:Y9os75GmSkhHw2wX8sMsxfI7qRGAEcDh8NTa5a8vj6E= +github.com/openconfig/gnsi v1.6.0 h1:PfQa9Gy0lH1sHqA2L3Gj2fEh2zPMbWxMmIRQv2Nk1T8= +github.com/openconfig/gnsi v1.6.0/go.mod h1:RiHTEIb2ruIeWOOamms6vqbZtgmajDx+g5YJlF2hZ0k= +golang.org/x/net v0.25.0 h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac= +golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= +golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y= +golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/text v0.15.0 h1:h1V/4gjBv8v9cjcR6+AR5+/cIYK5N/WAgiv4xlsEtAk= +golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157 h1:Zy9XzmMEflZ/MAaA7vNcoebnRAld7FsPW1EeBB7V0m8= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157/go.mod h1:EfXuqaE1J41VCDicxHzUDm+8rk+7ZdXzHV0IhO/I6s0= +google.golang.org/grpc v1.65.0 h1:bs/cUb4lp1G5iImFFd3u5ixQzweKizoZJAwBNLR42lc= +google.golang.org/grpc v1.65.0/go.mod h1:WgYC2ypjlB0EiQi6wdKixMqukr6lBc0Vo+oOgjrM5ZQ= +google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= +google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= diff --git a/src/sonic-framework/gnoi/healthz/BUILD.bazel b/src/sonic-framework/gnoi/healthz/BUILD.bazel new file mode 100644 index 000000000000..b6b2d5d4d161 --- /dev/null +++ b/src/sonic-framework/gnoi/healthz/BUILD.bazel @@ -0,0 +1,69 @@ +load("@com_github_grpc_grpc//bazel:cc_grpc_library.bzl", "cc_grpc_library") +load("@rules_proto//proto:defs.bzl", "proto_library") +load("@io_bazel_rules_go//go:def.bzl", "go_library") +load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library") +load("@com_github_grpc_grpc//bazel:cc_grpc_library.bzl", "cc_grpc_library") +load("//:common.bzl", "use_new_compilers") + +#Copyright 2021 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +package( + default_visibility = ["//visibility:public"], + licenses = ["notice"], +) + +use_new_compilers() + +proto_library( + name = "healthz_proto", + srcs = ["healthz.proto"], + deps = [ + "//common:common_proto", + "//types:types_proto", + "@com_google_protobuf//:any_proto", + "@com_google_protobuf//:timestamp_proto", + ], +) + +go_proto_library( + name = "healthz_go_proto", + compilers = [ + "go_protoc_gen_go", + "go_protoc_gen_go_grpc", + ], + importpath = "github.com/openconfig/gnoi/healthz", + proto = ":healthz_proto", + deps = [ + "//types", + ], +) + +go_library( + name = "healthz", + embed = [":healthz_go_proto"], + importpath = "github.com/openconfig/gnoi/healthz", +) + +cc_proto_library( + name = "healthz_cc_proto", + deps = [":healthz_proto"], +) + +cc_grpc_library( + name = "healthz_cc_grpc_proto", + srcs = [":healthz_proto"], + grpc_only = True, + deps = [":healthz_cc_proto"], +) diff --git a/src/sonic-framework/gnoi/healthz/README.md b/src/sonic-framework/gnoi/healthz/README.md new file mode 100644 index 000000000000..f6637e2567c2 --- /dev/null +++ b/src/sonic-framework/gnoi/healthz/README.md @@ -0,0 +1,305 @@ +# gNOI `Healthz` Streaming RPC Design +**Contributors**: hines@google.com, robjs@google.com, bneville@arista.com, +roman.dodin@nokia.com +**Last Updated**: 2022-11-02 + +## Background + +* [gNOI Repository](https://github.com/openconfig/gnoi) +* [gNOI `Healthz` service](https://github.com/openconfig/gnoi/tree/master/healthz) + +The purpose of `Healthz` is to allow a component inside of a system to report its +health. The concept of asking "Are you healthy?" is a general design principle +in distributed systems. + +The ability to also include "implementation specific" details about the health +of the system or component is very standard for network devices in the form for +"show tech", "diag" or "debug" commands. These are very useful for getting +diagnostics about the system state to the implementers. `Healthz` exposes these +interfaces as queryable endpoints to allow operators to validate "health" on +components and if "unhealthy" gather implementor specific data to help triage +or reproduce issues. + +## Design Background + +`Healthz` provides a means by which a user may initiate checks of health +(through the `Check` RPC) or a system may report the results of a check that it +has initiated of its own accord. + +Following a health check occurring, a caller uses the `List` or `Get` RPC to +discover the health "events" (expressed as a `ComponentStatus` message) that +are associated with a component and its corresponding subcomponents. Each event +reflects a collection of data that is required to debug or further root cause +the fault that occurs with an entity in the system. + +The `Artifact` RPC is used to retrieve specific artifacts that are listed by +the target system in the `List` or `Get` RPC. Once retrieved an event, which +corresponds to a series of artifacts, can be 'acknowledged' by the client of +the RPC. Acknowledged events are no longer returned in the list of events by +default. The device may use the acknowledged status as a hint to allow garbage +collection of artifacts that are no longer relevant. The device itself is +responsible for garbage collection any may, if necessary, garbage collect +artifacts that are not yet acknowledged. It is expected that events are +persisted across restarts of the system or its hardware and software +components, and they are removed only for resource management reasons. + +Whilst the system may initiate health checks itself, these should be safe to +perform operations that do not impact the device's functionality. Expensive +checks (e.g., pausing protocols, or dumping internal database state) that are +potentially service impacting should require use of the `Check` RPC. + +`Healthz` works in conjunction with telemetry streamed via gNMI, OpenConfig +paths for a specific component are streamed to indicate when components become +unhealthy, allowing the receiving system to determine that further inspection +of the component's health is required. The following paths (defined in the +`openconfig-platform` model) are used: + +``` +component/healthz/state/status (enumerated value) +component/healthz/state/last-unhealthy (timestamp) +component/healthz/state/unhealthy-count (int64) +``` + +### Choice of Streaming for Artifacts + +[Background comment](https://github.com/openconfig/gnoi/pull/65#issuecomment-1090547841) + +Originally, the gNOI Healthz endpoint defined single transactional API for +getting the "healthz" status of a component. As discussed in the above issue, +due to large data volume or to an interactive debug output there is a +requirement that it support the ability to stream a status from the device. + +To ensure that this can be done using a secure channel with the relevant ACL +and encryption, this streaming is implemented within the `Healthz` service. +This approach further allows the concept of a historical set of collected +artifacts to be reported by the device. + +### Collection of Artifacts + +As described above, by default health checks that are performed automatically +by the device SHOULD NOT be performance impacting. The `Check` RPC is used to +ensure the creation of artifacts that are expensive to collect. + +Thus -- a system relying on `healthz` for reporting of device status, needs +to consider the following workflow. + +1. A component of the system becomes unhealthy. The device MUST generate + a health state via telemetry that indicates that the `healthz/state/status` + of the component has transitioned to `UNHEALTHY`. It is left for the device + implementor to determine which artifacts are generated automatically by the + system immediately. The artifact collection SHOULD NOT impact the performance + of the system. +2. The responding client system observes the transition to `UNHEALTHY` and can + `List` events that have occurred on the component. The client SHOULD be aware + that not all artifacts that may be required may have automatically been + collected and a `Check` RPC may be required to collect the artifacts that + were considered performance impacting. This allows the client systems to + co-ordinate to reduce the operational risk of collecting this data (e.g, by + removing traffic from the network device). In order to specify that the + `Check` refers to a previously reported event, the `event_id` field in + the request must be populated with the ID reported in `Get` or `List`. +3. If the component becomes healthy again, even if no `Healthz` calls were made + to the system, telemetry information MUST be updated to ensure that external + clients are updated as to the current health status. + +In order that the relevant information for a particular event is collected, the +device SHOULD ensure that the non-system-impacting artifact collection that +is performed at the time of the event is sufficient that error conditions can +be understood and debugged. + +## Architecture + +### Use of gNMI paths + +Where a gNMI path (`gnoi.types.Path`) is used in `Healthz`, the path specified +should be the complete path to a specific component - i.e., +`/components/component[name=FOO]`. + +### Healthz.Get() + +```protobuf +rpc Get(GetRequest) returns (GetResponse) {} +``` + +`Get` allows a user to retrieve the latest set of health statuses that are +associated with a specific component and any of its corresponding +subcomponents. In contrast to `List` the `Get` RPC should return only the +latest event (i.e., `ComponentStatus` message). + +The `GetResponse` returned includes a `ComponentStatus` message which +corresponds to the latest health event for the component itself and each +subcomponent being reported on. Thus, multiple `ComponentStatus` messages may +be reported for a single component. Each message includes a set of +`ArtifactHeader` messages that correspond to the health event -- and provide +identifiers and types for the artifacts that can be returned by the system. + +All artifacts that are listed within the same `ComponentStatus` message are +expected to have a shared acknowledgement state, and expiry time. + +### Healthz.List() + +```protobuf +rpc List(ListRequest) returns (ListResponse) {} +``` + +`List` returns all events that are associated with a particular component. In +contrast to `Get`, it returns all events that the target has for the device. By +default, events that are acknowledged are not returned. + +`List` returns a series of `ComponentStatus` messages. These messages have the +same semantics as those that are returned by the `Get` RPC, described above. + +### Healthz.Acknowledge() + +```protobuf +rpc Acknowledge(AcknowledgeRequest) returns (AcknowledgeResponse) {} +``` + +`Acknowledge` is used by a client to indicate to the target device that a +particular (component, event) tuple has been retrieved by the client. This +allows a device to intelligently determine whether to retain artifacts. Devices +MUST ensure that artifact storage for healthz does not cause resource +exhaustion and SHOULD remove acknowledged artifacts before those that have not +yet received an acknowledgment. + +### Healthz.Artifact() + +```protobuf +rpc Artifact(ArtifactRequest) returns (stream ArtifactResponse) {} +``` + +`Artifact` allows a user to retrieve a specific artifact that is related to an +event that has occurred. Since these artifacts may be large, the `Artifact` RPC +is implemented as a server-side streaming RPC. The `Artifact` RPC ensures that +a target sends these potentially large artifacts only when explicitly requested +by the client. + +Each artifact that is returned in the `Artifact` RPC call should contain +ArtifactResponses in the following order: +- ArtifactHeader +- one or more bytes/proto +- ArtifactTrailer + +#### Healthz.Check() + +```protobuf +rpc Check(CheckRequest) returns (CheckResponse) {} +``` + +`Check` allows a client to execute a set of "validations" against the specified +component. The component, as with other operations, is specified in terms of +the gNMI path. + +The result of the `Check` produces a healthz `ComponentStatus` message which +will contain a list of the generated artifacts used in the validation process. + +A call to the `Check` endpoint will allow for "very expensive" debugging +commands such as causing the device to pause and snapshot its system database +or to examine the state of a protocol. These commands will likely be +considered "service impacting" and should have a clear security ACL restricting +their use during normal operations of the device. + +The `CheckRequest` message includes an `event_id` field. When populated this +indicates that the `Check` should be performed for an event that has already +occurred within the system. The device should trigger artifact collection of +those artifacts that were not automatically collected. A `CheckRequest` for +a previous `event_id` MUST NOT overwrite previous artifacts that were collected +at the time of the event. The artifacts that are collected MUST be returned +in the artifact list for the event when reported by the `Get` or `List` RPCs. + +## User Experience + +### A BGP routing process goes unhealthy due to a crash. + +#### Expected Action + +Write the core dump to a file system. + +A call to `Healthz.Get` should respond with the current state of the component +and provide feedback that there is an artifact available to be requested. + +A `Healthz.Artifact()` call should stream the core dump over the service back +to the caller. + +The component that is specified should correspond to the software process that +implements the BGP protocol in the system. + +### A chassis linecard goes unhealthy due to hardware failure. + +#### Expected Action + +Logs / dumps collected and the gNMI components are marked unhealthy. + +A call to Healthz.Get should respond with the current state of the component +and provide feedback that there is an artifact available to be requested. + +A `Healthz.Artifact()` call should stream the core dump over the service back +to the caller. + +A `Healthz.Artifact()` call should stream the logs over the service back to the +caller. + +The component that is reported on should be of type +[`CHASSIS`](https://openconfig.net/projects/models/schemadocs/yangdoc/openconfig-platform.html#ident-chassis). + +### A chassis file storage is over a configured capacity and reports itself unhealthy. + +Since there are no artifacts the Healthz.Get should just return the status of +the component and no other action is necessary + +The component reported on via telemetry should correspond to the device's +chassis and be of type +[`CHASSIS`](https://openconfig.net/projects/models/schemadocs/yangdoc/openconfig-platform.html#ident-chassis). + +### A user would like to stream console debugging or other shell output for collection + +For a component healthz could be used to provide an I/O dump of a specific +debugging command redirected as a byte stream. It could also be output like a +top or show interfaces where the data is periodically updated (each "frame" +would be sent over the stream as a separate message). This would allow for +show tech like information to be collected and sent to vendors in a +programmatic secure way but not completely reinventing the wheel. + +To achieve this use case, extensions to the existing specification are +required. + +### Collect a snapshot of a particular component. + +For components which can provide a "snapshot" of state the healthz artifact +endpoint can be provided to take a snapshot of state (ideally serialized as a +protobuf or other typed data structure) and provided to the caller. + +Examples: +* Get optical data from i2c bus on optical systems. +* Get system database state for the core pub/sub of a device. + +### Exporting internal or specific debug logs + +For a component in the system the developers could provide a debug log for that +specific component or other trace / dump information. The `Check()` and +`Artifact()` APIs could be used in these cases to create the setup and then +download the specific data in a secure, reliable way (rather than a general +file scp). If the device can "automatically" generate these specific data the +`Get` API can also be used to check for existence and to download the +artifacts. Note that to support this use case, additional gNMI paths are likely +required to signal existence of this type of data. + +### Event lifecycle + +An event is created internally by the system for a linecard rebooting +unexpectedly. The chassis process will take a core of the component. Snapshot +it's log for the component. Snapshot any relevant state in a system database for +the component and create a healthz event which includes pointers to these 3 +artifacts. + +The external monitoring system will receive a gNMI update reporting that the +specific component became unhealthy. + +An event monitoring agent can then call the `healthz` service specifying the +faulty component, and thus retrieve the current event and the associated +artifacts. Since the component becoming healthy is an externally reportable +event (i.e., may need to be reported to the vendor to initiate an RMA) the +system decides to retrieve the artifacts and store them within a bug tracking +system case. Once the artifacts are retrieved the system will mark the event +as acknowledged and the server can then use its local retention policy to clean +up those events. diff --git a/src/sonic-framework/gnoi/healthz/healthz.pb.go b/src/sonic-framework/gnoi/healthz/healthz.pb.go new file mode 100644 index 000000000000..2111bd286c0b --- /dev/null +++ b/src/sonic-framework/gnoi/healthz/healthz.pb.go @@ -0,0 +1,1448 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.30.0 +// protoc v3.21.10 +// source: healthz/healthz.proto + +package healthz + +import ( + types "github.com/openconfig/gnoi/types" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + anypb "google.golang.org/protobuf/types/known/anypb" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type Status int32 + +const ( + Status_STATUS_UNSPECIFIED Status = 0 + Status_STATUS_HEALTHY Status = 1 + Status_STATUS_UNHEALTHY Status = 2 +) + +// Enum value maps for Status. +var ( + Status_name = map[int32]string{ + 0: "STATUS_UNSPECIFIED", + 1: "STATUS_HEALTHY", + 2: "STATUS_UNHEALTHY", + } + Status_value = map[string]int32{ + "STATUS_UNSPECIFIED": 0, + "STATUS_HEALTHY": 1, + "STATUS_UNHEALTHY": 2, + } +) + +func (x Status) Enum() *Status { + p := new(Status) + *p = x + return p +} + +func (x Status) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Status) Descriptor() protoreflect.EnumDescriptor { + return file_healthz_healthz_proto_enumTypes[0].Descriptor() +} + +func (Status) Type() protoreflect.EnumType { + return &file_healthz_healthz_proto_enumTypes[0] +} + +func (x Status) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use Status.Descriptor instead. +func (Status) EnumDescriptor() ([]byte, []int) { + return file_healthz_healthz_proto_rawDescGZIP(), []int{0} +} + +type GetRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Path *types.Path `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"` +} + +func (x *GetRequest) Reset() { + *x = GetRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_healthz_healthz_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetRequest) ProtoMessage() {} + +func (x *GetRequest) ProtoReflect() protoreflect.Message { + mi := &file_healthz_healthz_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetRequest.ProtoReflect.Descriptor instead. +func (*GetRequest) Descriptor() ([]byte, []int) { + return file_healthz_healthz_proto_rawDescGZIP(), []int{0} +} + +func (x *GetRequest) GetPath() *types.Path { + if x != nil { + return x.Path + } + return nil +} + +type GetResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Component *ComponentStatus `protobuf:"bytes,1,opt,name=component,proto3" json:"component,omitempty"` +} + +func (x *GetResponse) Reset() { + *x = GetResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_healthz_healthz_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetResponse) ProtoMessage() {} + +func (x *GetResponse) ProtoReflect() protoreflect.Message { + mi := &file_healthz_healthz_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetResponse.ProtoReflect.Descriptor instead. +func (*GetResponse) Descriptor() ([]byte, []int) { + return file_healthz_healthz_proto_rawDescGZIP(), []int{1} +} + +func (x *GetResponse) GetComponent() *ComponentStatus { + if x != nil { + return x.Component + } + return nil +} + +type ArtifactHeader struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + // Types that are assignable to ArtifactType: + // + // *ArtifactHeader_File + // *ArtifactHeader_Proto + // *ArtifactHeader_Custom + ArtifactType isArtifactHeader_ArtifactType `protobuf_oneof:"artifact_type"` +} + +func (x *ArtifactHeader) Reset() { + *x = ArtifactHeader{} + if protoimpl.UnsafeEnabled { + mi := &file_healthz_healthz_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ArtifactHeader) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ArtifactHeader) ProtoMessage() {} + +func (x *ArtifactHeader) ProtoReflect() protoreflect.Message { + mi := &file_healthz_healthz_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ArtifactHeader.ProtoReflect.Descriptor instead. +func (*ArtifactHeader) Descriptor() ([]byte, []int) { + return file_healthz_healthz_proto_rawDescGZIP(), []int{2} +} + +func (x *ArtifactHeader) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (m *ArtifactHeader) GetArtifactType() isArtifactHeader_ArtifactType { + if m != nil { + return m.ArtifactType + } + return nil +} + +func (x *ArtifactHeader) GetFile() *FileArtifactType { + if x, ok := x.GetArtifactType().(*ArtifactHeader_File); ok { + return x.File + } + return nil +} + +func (x *ArtifactHeader) GetProto() *ProtoArtifactType { + if x, ok := x.GetArtifactType().(*ArtifactHeader_Proto); ok { + return x.Proto + } + return nil +} + +func (x *ArtifactHeader) GetCustom() *anypb.Any { + if x, ok := x.GetArtifactType().(*ArtifactHeader_Custom); ok { + return x.Custom + } + return nil +} + +type isArtifactHeader_ArtifactType interface { + isArtifactHeader_ArtifactType() +} + +type ArtifactHeader_File struct { + File *FileArtifactType `protobuf:"bytes,101,opt,name=file,proto3,oneof"` +} + +type ArtifactHeader_Proto struct { + Proto *ProtoArtifactType `protobuf:"bytes,102,opt,name=proto,proto3,oneof"` +} + +type ArtifactHeader_Custom struct { + Custom *anypb.Any `protobuf:"bytes,103,opt,name=custom,proto3,oneof"` +} + +func (*ArtifactHeader_File) isArtifactHeader_ArtifactType() {} + +func (*ArtifactHeader_Proto) isArtifactHeader_ArtifactType() {} + +func (*ArtifactHeader_Custom) isArtifactHeader_ArtifactType() {} + +type ComponentStatus struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Path *types.Path `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"` + Subcomponents []*ComponentStatus `protobuf:"bytes,2,rep,name=subcomponents,proto3" json:"subcomponents,omitempty"` + Status Status `protobuf:"varint,3,opt,name=status,proto3,enum=gnoi.healthz.Status" json:"status,omitempty"` + // Deprecated: Marked as deprecated in healthz/healthz.proto. + Healthz *anypb.Any `protobuf:"bytes,4,opt,name=healthz,proto3" json:"healthz,omitempty"` + Artifacts []*ArtifactHeader `protobuf:"bytes,5,rep,name=artifacts,proto3" json:"artifacts,omitempty"` + Id string `protobuf:"bytes,6,opt,name=id,proto3" json:"id,omitempty"` + Acknowledged bool `protobuf:"varint,7,opt,name=acknowledged,proto3" json:"acknowledged,omitempty"` + Created *timestamppb.Timestamp `protobuf:"bytes,8,opt,name=created,proto3" json:"created,omitempty"` + Expires *timestamppb.Timestamp `protobuf:"bytes,9,opt,name=expires,proto3" json:"expires,omitempty"` +} + +func (x *ComponentStatus) Reset() { + *x = ComponentStatus{} + if protoimpl.UnsafeEnabled { + mi := &file_healthz_healthz_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ComponentStatus) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ComponentStatus) ProtoMessage() {} + +func (x *ComponentStatus) ProtoReflect() protoreflect.Message { + mi := &file_healthz_healthz_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ComponentStatus.ProtoReflect.Descriptor instead. +func (*ComponentStatus) Descriptor() ([]byte, []int) { + return file_healthz_healthz_proto_rawDescGZIP(), []int{3} +} + +func (x *ComponentStatus) GetPath() *types.Path { + if x != nil { + return x.Path + } + return nil +} + +func (x *ComponentStatus) GetSubcomponents() []*ComponentStatus { + if x != nil { + return x.Subcomponents + } + return nil +} + +func (x *ComponentStatus) GetStatus() Status { + if x != nil { + return x.Status + } + return Status_STATUS_UNSPECIFIED +} + +// Deprecated: Marked as deprecated in healthz/healthz.proto. +func (x *ComponentStatus) GetHealthz() *anypb.Any { + if x != nil { + return x.Healthz + } + return nil +} + +func (x *ComponentStatus) GetArtifacts() []*ArtifactHeader { + if x != nil { + return x.Artifacts + } + return nil +} + +func (x *ComponentStatus) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *ComponentStatus) GetAcknowledged() bool { + if x != nil { + return x.Acknowledged + } + return false +} + +func (x *ComponentStatus) GetCreated() *timestamppb.Timestamp { + if x != nil { + return x.Created + } + return nil +} + +func (x *ComponentStatus) GetExpires() *timestamppb.Timestamp { + if x != nil { + return x.Expires + } + return nil +} + +type ListRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Path *types.Path `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"` + IncludeAcknowledged bool `protobuf:"varint,2,opt,name=include_acknowledged,json=includeAcknowledged,proto3" json:"include_acknowledged,omitempty"` +} + +func (x *ListRequest) Reset() { + *x = ListRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_healthz_healthz_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListRequest) ProtoMessage() {} + +func (x *ListRequest) ProtoReflect() protoreflect.Message { + mi := &file_healthz_healthz_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListRequest.ProtoReflect.Descriptor instead. +func (*ListRequest) Descriptor() ([]byte, []int) { + return file_healthz_healthz_proto_rawDescGZIP(), []int{4} +} + +func (x *ListRequest) GetPath() *types.Path { + if x != nil { + return x.Path + } + return nil +} + +func (x *ListRequest) GetIncludeAcknowledged() bool { + if x != nil { + return x.IncludeAcknowledged + } + return false +} + +type ListResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Statuses []*ComponentStatus `protobuf:"bytes,1,rep,name=statuses,proto3" json:"statuses,omitempty"` +} + +func (x *ListResponse) Reset() { + *x = ListResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_healthz_healthz_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListResponse) ProtoMessage() {} + +func (x *ListResponse) ProtoReflect() protoreflect.Message { + mi := &file_healthz_healthz_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListResponse.ProtoReflect.Descriptor instead. +func (*ListResponse) Descriptor() ([]byte, []int) { + return file_healthz_healthz_proto_rawDescGZIP(), []int{5} +} + +func (x *ListResponse) GetStatuses() []*ComponentStatus { + if x != nil { + return x.Statuses + } + return nil +} + +type AcknowledgeRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Path *types.Path `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"` + Id string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"` +} + +func (x *AcknowledgeRequest) Reset() { + *x = AcknowledgeRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_healthz_healthz_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AcknowledgeRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AcknowledgeRequest) ProtoMessage() {} + +func (x *AcknowledgeRequest) ProtoReflect() protoreflect.Message { + mi := &file_healthz_healthz_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AcknowledgeRequest.ProtoReflect.Descriptor instead. +func (*AcknowledgeRequest) Descriptor() ([]byte, []int) { + return file_healthz_healthz_proto_rawDescGZIP(), []int{6} +} + +func (x *AcknowledgeRequest) GetPath() *types.Path { + if x != nil { + return x.Path + } + return nil +} + +func (x *AcknowledgeRequest) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +type AcknowledgeResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Status *ComponentStatus `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"` +} + +func (x *AcknowledgeResponse) Reset() { + *x = AcknowledgeResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_healthz_healthz_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AcknowledgeResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AcknowledgeResponse) ProtoMessage() {} + +func (x *AcknowledgeResponse) ProtoReflect() protoreflect.Message { + mi := &file_healthz_healthz_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AcknowledgeResponse.ProtoReflect.Descriptor instead. +func (*AcknowledgeResponse) Descriptor() ([]byte, []int) { + return file_healthz_healthz_proto_rawDescGZIP(), []int{7} +} + +func (x *AcknowledgeResponse) GetStatus() *ComponentStatus { + if x != nil { + return x.Status + } + return nil +} + +type ArtifactRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` +} + +func (x *ArtifactRequest) Reset() { + *x = ArtifactRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_healthz_healthz_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ArtifactRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ArtifactRequest) ProtoMessage() {} + +func (x *ArtifactRequest) ProtoReflect() protoreflect.Message { + mi := &file_healthz_healthz_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ArtifactRequest.ProtoReflect.Descriptor instead. +func (*ArtifactRequest) Descriptor() ([]byte, []int) { + return file_healthz_healthz_proto_rawDescGZIP(), []int{8} +} + +func (x *ArtifactRequest) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +type ArtifactResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Contents: + // + // *ArtifactResponse_Header + // *ArtifactResponse_Trailer + // *ArtifactResponse_Bytes + // *ArtifactResponse_Proto + Contents isArtifactResponse_Contents `protobuf_oneof:"contents"` +} + +func (x *ArtifactResponse) Reset() { + *x = ArtifactResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_healthz_healthz_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ArtifactResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ArtifactResponse) ProtoMessage() {} + +func (x *ArtifactResponse) ProtoReflect() protoreflect.Message { + mi := &file_healthz_healthz_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ArtifactResponse.ProtoReflect.Descriptor instead. +func (*ArtifactResponse) Descriptor() ([]byte, []int) { + return file_healthz_healthz_proto_rawDescGZIP(), []int{9} +} + +func (m *ArtifactResponse) GetContents() isArtifactResponse_Contents { + if m != nil { + return m.Contents + } + return nil +} + +func (x *ArtifactResponse) GetHeader() *ArtifactHeader { + if x, ok := x.GetContents().(*ArtifactResponse_Header); ok { + return x.Header + } + return nil +} + +func (x *ArtifactResponse) GetTrailer() *ArtifactTrailer { + if x, ok := x.GetContents().(*ArtifactResponse_Trailer); ok { + return x.Trailer + } + return nil +} + +func (x *ArtifactResponse) GetBytes() []byte { + if x, ok := x.GetContents().(*ArtifactResponse_Bytes); ok { + return x.Bytes + } + return nil +} + +func (x *ArtifactResponse) GetProto() *anypb.Any { + if x, ok := x.GetContents().(*ArtifactResponse_Proto); ok { + return x.Proto + } + return nil +} + +type isArtifactResponse_Contents interface { + isArtifactResponse_Contents() +} + +type ArtifactResponse_Header struct { + Header *ArtifactHeader `protobuf:"bytes,1,opt,name=header,proto3,oneof"` +} + +type ArtifactResponse_Trailer struct { + Trailer *ArtifactTrailer `protobuf:"bytes,2,opt,name=trailer,proto3,oneof"` +} + +type ArtifactResponse_Bytes struct { + Bytes []byte `protobuf:"bytes,3,opt,name=bytes,proto3,oneof"` +} + +type ArtifactResponse_Proto struct { + Proto *anypb.Any `protobuf:"bytes,4,opt,name=proto,proto3,oneof"` +} + +func (*ArtifactResponse_Header) isArtifactResponse_Contents() {} + +func (*ArtifactResponse_Trailer) isArtifactResponse_Contents() {} + +func (*ArtifactResponse_Bytes) isArtifactResponse_Contents() {} + +func (*ArtifactResponse_Proto) isArtifactResponse_Contents() {} + +type FileArtifactType struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Path string `protobuf:"bytes,2,opt,name=path,proto3" json:"path,omitempty"` + Mimetype string `protobuf:"bytes,3,opt,name=mimetype,proto3" json:"mimetype,omitempty"` + Size int64 `protobuf:"varint,4,opt,name=size,proto3" json:"size,omitempty"` + Hash *types.HashType `protobuf:"bytes,5,opt,name=hash,proto3" json:"hash,omitempty"` +} + +func (x *FileArtifactType) Reset() { + *x = FileArtifactType{} + if protoimpl.UnsafeEnabled { + mi := &file_healthz_healthz_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FileArtifactType) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FileArtifactType) ProtoMessage() {} + +func (x *FileArtifactType) ProtoReflect() protoreflect.Message { + mi := &file_healthz_healthz_proto_msgTypes[10] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use FileArtifactType.ProtoReflect.Descriptor instead. +func (*FileArtifactType) Descriptor() ([]byte, []int) { + return file_healthz_healthz_proto_rawDescGZIP(), []int{10} +} + +func (x *FileArtifactType) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *FileArtifactType) GetPath() string { + if x != nil { + return x.Path + } + return "" +} + +func (x *FileArtifactType) GetMimetype() string { + if x != nil { + return x.Mimetype + } + return "" +} + +func (x *FileArtifactType) GetSize() int64 { + if x != nil { + return x.Size + } + return 0 +} + +func (x *FileArtifactType) GetHash() *types.HashType { + if x != nil { + return x.Hash + } + return nil +} + +type ProtoArtifactType struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *ProtoArtifactType) Reset() { + *x = ProtoArtifactType{} + if protoimpl.UnsafeEnabled { + mi := &file_healthz_healthz_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ProtoArtifactType) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ProtoArtifactType) ProtoMessage() {} + +func (x *ProtoArtifactType) ProtoReflect() protoreflect.Message { + mi := &file_healthz_healthz_proto_msgTypes[11] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ProtoArtifactType.ProtoReflect.Descriptor instead. +func (*ProtoArtifactType) Descriptor() ([]byte, []int) { + return file_healthz_healthz_proto_rawDescGZIP(), []int{11} +} + +type ArtifactTrailer struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *ArtifactTrailer) Reset() { + *x = ArtifactTrailer{} + if protoimpl.UnsafeEnabled { + mi := &file_healthz_healthz_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ArtifactTrailer) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ArtifactTrailer) ProtoMessage() {} + +func (x *ArtifactTrailer) ProtoReflect() protoreflect.Message { + mi := &file_healthz_healthz_proto_msgTypes[12] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ArtifactTrailer.ProtoReflect.Descriptor instead. +func (*ArtifactTrailer) Descriptor() ([]byte, []int) { + return file_healthz_healthz_proto_rawDescGZIP(), []int{12} +} + +type CheckRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Path *types.Path `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"` + EventId string `protobuf:"bytes,2,opt,name=event_id,json=eventId,proto3" json:"event_id,omitempty"` +} + +func (x *CheckRequest) Reset() { + *x = CheckRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_healthz_healthz_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CheckRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CheckRequest) ProtoMessage() {} + +func (x *CheckRequest) ProtoReflect() protoreflect.Message { + mi := &file_healthz_healthz_proto_msgTypes[13] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CheckRequest.ProtoReflect.Descriptor instead. +func (*CheckRequest) Descriptor() ([]byte, []int) { + return file_healthz_healthz_proto_rawDescGZIP(), []int{13} +} + +func (x *CheckRequest) GetPath() *types.Path { + if x != nil { + return x.Path + } + return nil +} + +func (x *CheckRequest) GetEventId() string { + if x != nil { + return x.EventId + } + return "" +} + +type CheckResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Status *ComponentStatus `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"` +} + +func (x *CheckResponse) Reset() { + *x = CheckResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_healthz_healthz_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CheckResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CheckResponse) ProtoMessage() {} + +func (x *CheckResponse) ProtoReflect() protoreflect.Message { + mi := &file_healthz_healthz_proto_msgTypes[14] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CheckResponse.ProtoReflect.Descriptor instead. +func (*CheckResponse) Descriptor() ([]byte, []int) { + return file_healthz_healthz_proto_rawDescGZIP(), []int{14} +} + +func (x *CheckResponse) GetStatus() *ComponentStatus { + if x != nil { + return x.Status + } + return nil +} + +var File_healthz_healthz_proto protoreflect.FileDescriptor + +var file_healthz_healthz_proto_rawDesc = []byte{ + 0x0a, 0x15, 0x68, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x7a, 0x2f, 0x68, 0x65, 0x61, 0x6c, 0x74, 0x68, + 0x7a, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0c, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x68, 0x65, + 0x61, 0x6c, 0x74, 0x68, 0x7a, 0x1a, 0x2c, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, + 0x6d, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x67, 0x6e, 0x6f, + 0x69, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6e, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, + 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, + 0x32, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x24, 0x0a, + 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x67, 0x6e, + 0x6f, 0x69, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x50, 0x61, 0x74, 0x68, 0x52, 0x04, 0x70, + 0x61, 0x74, 0x68, 0x22, 0x4a, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x3b, 0x0a, 0x09, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x68, 0x65, 0x61, + 0x6c, 0x74, 0x68, 0x7a, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x53, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x52, 0x09, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x22, + 0xd0, 0x01, 0x0a, 0x0e, 0x41, 0x72, 0x74, 0x69, 0x66, 0x61, 0x63, 0x74, 0x48, 0x65, 0x61, 0x64, + 0x65, 0x72, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, + 0x69, 0x64, 0x12, 0x34, 0x0a, 0x04, 0x66, 0x69, 0x6c, 0x65, 0x18, 0x65, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1e, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x68, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x7a, 0x2e, + 0x46, 0x69, 0x6c, 0x65, 0x41, 0x72, 0x74, 0x69, 0x66, 0x61, 0x63, 0x74, 0x54, 0x79, 0x70, 0x65, + 0x48, 0x00, 0x52, 0x04, 0x66, 0x69, 0x6c, 0x65, 0x12, 0x37, 0x0a, 0x05, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x18, 0x66, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x68, + 0x65, 0x61, 0x6c, 0x74, 0x68, 0x7a, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x41, 0x72, 0x74, 0x69, + 0x66, 0x61, 0x63, 0x74, 0x54, 0x79, 0x70, 0x65, 0x48, 0x00, 0x52, 0x05, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x12, 0x2e, 0x0a, 0x06, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x18, 0x67, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x48, 0x00, 0x52, 0x06, 0x63, 0x75, 0x73, 0x74, 0x6f, + 0x6d, 0x42, 0x0f, 0x0a, 0x0d, 0x61, 0x72, 0x74, 0x69, 0x66, 0x61, 0x63, 0x74, 0x5f, 0x74, 0x79, + 0x70, 0x65, 0x22, 0xba, 0x03, 0x0a, 0x0f, 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, + 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x24, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x74, 0x79, 0x70, 0x65, + 0x73, 0x2e, 0x50, 0x61, 0x74, 0x68, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x12, 0x43, 0x0a, 0x0d, + 0x73, 0x75, 0x62, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x02, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x68, 0x65, 0x61, 0x6c, 0x74, + 0x68, 0x7a, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x53, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x52, 0x0d, 0x73, 0x75, 0x62, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, + 0x73, 0x12, 0x2c, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x0e, 0x32, 0x14, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x68, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x7a, + 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, + 0x32, 0x0a, 0x07, 0x68, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x7a, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x42, 0x02, 0x18, 0x01, 0x52, 0x07, 0x68, 0x65, 0x61, 0x6c, + 0x74, 0x68, 0x7a, 0x12, 0x3a, 0x0a, 0x09, 0x61, 0x72, 0x74, 0x69, 0x66, 0x61, 0x63, 0x74, 0x73, + 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x68, 0x65, + 0x61, 0x6c, 0x74, 0x68, 0x7a, 0x2e, 0x41, 0x72, 0x74, 0x69, 0x66, 0x61, 0x63, 0x74, 0x48, 0x65, + 0x61, 0x64, 0x65, 0x72, 0x52, 0x09, 0x61, 0x72, 0x74, 0x69, 0x66, 0x61, 0x63, 0x74, 0x73, 0x12, + 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, + 0x22, 0x0a, 0x0c, 0x61, 0x63, 0x6b, 0x6e, 0x6f, 0x77, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x64, 0x18, + 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x61, 0x63, 0x6b, 0x6e, 0x6f, 0x77, 0x6c, 0x65, 0x64, + 0x67, 0x65, 0x64, 0x12, 0x34, 0x0a, 0x07, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x18, 0x08, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, + 0x52, 0x07, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x12, 0x34, 0x0a, 0x07, 0x65, 0x78, 0x70, + 0x69, 0x72, 0x65, 0x73, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, + 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x07, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x73, 0x22, + 0x66, 0x0a, 0x0b, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x24, + 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x67, + 0x6e, 0x6f, 0x69, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x50, 0x61, 0x74, 0x68, 0x52, 0x04, + 0x70, 0x61, 0x74, 0x68, 0x12, 0x31, 0x0a, 0x14, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x5f, + 0x61, 0x63, 0x6b, 0x6e, 0x6f, 0x77, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x13, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x41, 0x63, 0x6b, 0x6e, 0x6f, + 0x77, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x64, 0x22, 0x49, 0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x39, 0x0a, 0x08, 0x73, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x67, 0x6e, 0x6f, 0x69, + 0x2e, 0x68, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x7a, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, + 0x6e, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x08, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x65, 0x73, 0x22, 0x4a, 0x0a, 0x12, 0x41, 0x63, 0x6b, 0x6e, 0x6f, 0x77, 0x6c, 0x65, 0x64, 0x67, + 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x24, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x74, 0x79, + 0x70, 0x65, 0x73, 0x2e, 0x50, 0x61, 0x74, 0x68, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x12, 0x0e, + 0x0a, 0x02, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x22, 0x4c, + 0x0a, 0x13, 0x41, 0x63, 0x6b, 0x6e, 0x6f, 0x77, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x35, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x68, 0x65, 0x61, + 0x6c, 0x74, 0x68, 0x7a, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x53, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x21, 0x0a, 0x0f, + 0x41, 0x72, 0x74, 0x69, 0x66, 0x61, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x22, + 0xd7, 0x01, 0x0a, 0x10, 0x41, 0x72, 0x74, 0x69, 0x66, 0x61, 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x36, 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x68, 0x65, 0x61, 0x6c, + 0x74, 0x68, 0x7a, 0x2e, 0x41, 0x72, 0x74, 0x69, 0x66, 0x61, 0x63, 0x74, 0x48, 0x65, 0x61, 0x64, + 0x65, 0x72, 0x48, 0x00, 0x52, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x39, 0x0a, 0x07, + 0x74, 0x72, 0x61, 0x69, 0x6c, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, + 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x68, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x7a, 0x2e, 0x41, 0x72, 0x74, + 0x69, 0x66, 0x61, 0x63, 0x74, 0x54, 0x72, 0x61, 0x69, 0x6c, 0x65, 0x72, 0x48, 0x00, 0x52, 0x07, + 0x74, 0x72, 0x61, 0x69, 0x6c, 0x65, 0x72, 0x12, 0x16, 0x0a, 0x05, 0x62, 0x79, 0x74, 0x65, 0x73, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x48, 0x00, 0x52, 0x05, 0x62, 0x79, 0x74, 0x65, 0x73, 0x12, + 0x2c, 0x0a, 0x05, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x41, 0x6e, 0x79, 0x48, 0x00, 0x52, 0x05, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x42, 0x0a, 0x0a, + 0x08, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x22, 0x94, 0x01, 0x0a, 0x10, 0x46, 0x69, + 0x6c, 0x65, 0x41, 0x72, 0x74, 0x69, 0x66, 0x61, 0x63, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x12, + 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x12, 0x1a, 0x0a, 0x08, 0x6d, 0x69, 0x6d, 0x65, 0x74, 0x79, + 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6d, 0x69, 0x6d, 0x65, 0x74, 0x79, + 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x12, 0x28, 0x0a, 0x04, 0x68, 0x61, 0x73, 0x68, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x74, 0x79, 0x70, 0x65, + 0x73, 0x2e, 0x48, 0x61, 0x73, 0x68, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x68, 0x61, 0x73, 0x68, + 0x22, 0x13, 0x0a, 0x11, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x41, 0x72, 0x74, 0x69, 0x66, 0x61, 0x63, + 0x74, 0x54, 0x79, 0x70, 0x65, 0x22, 0x11, 0x0a, 0x0f, 0x41, 0x72, 0x74, 0x69, 0x66, 0x61, 0x63, + 0x74, 0x54, 0x72, 0x61, 0x69, 0x6c, 0x65, 0x72, 0x22, 0x4f, 0x0a, 0x0c, 0x43, 0x68, 0x65, 0x63, + 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x24, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x74, 0x79, + 0x70, 0x65, 0x73, 0x2e, 0x50, 0x61, 0x74, 0x68, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x12, 0x19, + 0x0a, 0x08, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x07, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x22, 0x46, 0x0a, 0x0d, 0x43, 0x68, 0x65, + 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x35, 0x0a, 0x06, 0x73, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x67, 0x6e, 0x6f, + 0x69, 0x2e, 0x68, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x7a, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, + 0x65, 0x6e, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x2a, 0x4a, 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x16, 0x0a, 0x12, 0x53, + 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, + 0x44, 0x10, 0x00, 0x12, 0x12, 0x0a, 0x0e, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x48, 0x45, + 0x41, 0x4c, 0x54, 0x48, 0x59, 0x10, 0x01, 0x12, 0x14, 0x0a, 0x10, 0x53, 0x54, 0x41, 0x54, 0x55, + 0x53, 0x5f, 0x55, 0x4e, 0x48, 0x45, 0x41, 0x4c, 0x54, 0x48, 0x59, 0x10, 0x02, 0x32, 0xf1, 0x02, + 0x0a, 0x07, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x7a, 0x12, 0x3c, 0x0a, 0x03, 0x47, 0x65, 0x74, + 0x12, 0x18, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x68, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x7a, 0x2e, + 0x47, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x67, 0x6e, 0x6f, + 0x69, 0x2e, 0x68, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x7a, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x3f, 0x0a, 0x04, 0x4c, 0x69, 0x73, 0x74, 0x12, + 0x19, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x68, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x7a, 0x2e, 0x4c, + 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x67, 0x6e, 0x6f, + 0x69, 0x2e, 0x68, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x7a, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x54, 0x0a, 0x0b, 0x41, 0x63, 0x6b, 0x6e, + 0x6f, 0x77, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x12, 0x20, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x68, + 0x65, 0x61, 0x6c, 0x74, 0x68, 0x7a, 0x2e, 0x41, 0x63, 0x6b, 0x6e, 0x6f, 0x77, 0x6c, 0x65, 0x64, + 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x67, 0x6e, 0x6f, 0x69, + 0x2e, 0x68, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x7a, 0x2e, 0x41, 0x63, 0x6b, 0x6e, 0x6f, 0x77, 0x6c, + 0x65, 0x64, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x4d, + 0x0a, 0x08, 0x41, 0x72, 0x74, 0x69, 0x66, 0x61, 0x63, 0x74, 0x12, 0x1d, 0x2e, 0x67, 0x6e, 0x6f, + 0x69, 0x2e, 0x68, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x7a, 0x2e, 0x41, 0x72, 0x74, 0x69, 0x66, 0x61, + 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x67, 0x6e, 0x6f, 0x69, + 0x2e, 0x68, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x7a, 0x2e, 0x41, 0x72, 0x74, 0x69, 0x66, 0x61, 0x63, + 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x30, 0x01, 0x12, 0x42, 0x0a, + 0x05, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x12, 0x1a, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x68, 0x65, + 0x61, 0x6c, 0x74, 0x68, 0x7a, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x68, 0x65, 0x61, 0x6c, 0x74, 0x68, + 0x7a, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x00, 0x42, 0x2c, 0xd2, 0x3e, 0x05, 0x31, 0x2e, 0x33, 0x2e, 0x30, 0x5a, 0x22, 0x67, 0x69, 0x74, + 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6f, 0x6e, 0x66, + 0x69, 0x67, 0x2f, 0x67, 0x6e, 0x6f, 0x69, 0x2f, 0x68, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x7a, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_healthz_healthz_proto_rawDescOnce sync.Once + file_healthz_healthz_proto_rawDescData = file_healthz_healthz_proto_rawDesc +) + +func file_healthz_healthz_proto_rawDescGZIP() []byte { + file_healthz_healthz_proto_rawDescOnce.Do(func() { + file_healthz_healthz_proto_rawDescData = protoimpl.X.CompressGZIP(file_healthz_healthz_proto_rawDescData) + }) + return file_healthz_healthz_proto_rawDescData +} + +var file_healthz_healthz_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_healthz_healthz_proto_msgTypes = make([]protoimpl.MessageInfo, 15) +var file_healthz_healthz_proto_goTypes = []interface{}{ + (Status)(0), // 0: gnoi.healthz.Status + (*GetRequest)(nil), // 1: gnoi.healthz.GetRequest + (*GetResponse)(nil), // 2: gnoi.healthz.GetResponse + (*ArtifactHeader)(nil), // 3: gnoi.healthz.ArtifactHeader + (*ComponentStatus)(nil), // 4: gnoi.healthz.ComponentStatus + (*ListRequest)(nil), // 5: gnoi.healthz.ListRequest + (*ListResponse)(nil), // 6: gnoi.healthz.ListResponse + (*AcknowledgeRequest)(nil), // 7: gnoi.healthz.AcknowledgeRequest + (*AcknowledgeResponse)(nil), // 8: gnoi.healthz.AcknowledgeResponse + (*ArtifactRequest)(nil), // 9: gnoi.healthz.ArtifactRequest + (*ArtifactResponse)(nil), // 10: gnoi.healthz.ArtifactResponse + (*FileArtifactType)(nil), // 11: gnoi.healthz.FileArtifactType + (*ProtoArtifactType)(nil), // 12: gnoi.healthz.ProtoArtifactType + (*ArtifactTrailer)(nil), // 13: gnoi.healthz.ArtifactTrailer + (*CheckRequest)(nil), // 14: gnoi.healthz.CheckRequest + (*CheckResponse)(nil), // 15: gnoi.healthz.CheckResponse + (*types.Path)(nil), // 16: gnoi.types.Path + (*anypb.Any)(nil), // 17: google.protobuf.Any + (*timestamppb.Timestamp)(nil), // 18: google.protobuf.Timestamp + (*types.HashType)(nil), // 19: gnoi.types.HashType +} +var file_healthz_healthz_proto_depIdxs = []int32{ + 16, // 0: gnoi.healthz.GetRequest.path:type_name -> gnoi.types.Path + 4, // 1: gnoi.healthz.GetResponse.component:type_name -> gnoi.healthz.ComponentStatus + 11, // 2: gnoi.healthz.ArtifactHeader.file:type_name -> gnoi.healthz.FileArtifactType + 12, // 3: gnoi.healthz.ArtifactHeader.proto:type_name -> gnoi.healthz.ProtoArtifactType + 17, // 4: gnoi.healthz.ArtifactHeader.custom:type_name -> google.protobuf.Any + 16, // 5: gnoi.healthz.ComponentStatus.path:type_name -> gnoi.types.Path + 4, // 6: gnoi.healthz.ComponentStatus.subcomponents:type_name -> gnoi.healthz.ComponentStatus + 0, // 7: gnoi.healthz.ComponentStatus.status:type_name -> gnoi.healthz.Status + 17, // 8: gnoi.healthz.ComponentStatus.healthz:type_name -> google.protobuf.Any + 3, // 9: gnoi.healthz.ComponentStatus.artifacts:type_name -> gnoi.healthz.ArtifactHeader + 18, // 10: gnoi.healthz.ComponentStatus.created:type_name -> google.protobuf.Timestamp + 18, // 11: gnoi.healthz.ComponentStatus.expires:type_name -> google.protobuf.Timestamp + 16, // 12: gnoi.healthz.ListRequest.path:type_name -> gnoi.types.Path + 4, // 13: gnoi.healthz.ListResponse.statuses:type_name -> gnoi.healthz.ComponentStatus + 16, // 14: gnoi.healthz.AcknowledgeRequest.path:type_name -> gnoi.types.Path + 4, // 15: gnoi.healthz.AcknowledgeResponse.status:type_name -> gnoi.healthz.ComponentStatus + 3, // 16: gnoi.healthz.ArtifactResponse.header:type_name -> gnoi.healthz.ArtifactHeader + 13, // 17: gnoi.healthz.ArtifactResponse.trailer:type_name -> gnoi.healthz.ArtifactTrailer + 17, // 18: gnoi.healthz.ArtifactResponse.proto:type_name -> google.protobuf.Any + 19, // 19: gnoi.healthz.FileArtifactType.hash:type_name -> gnoi.types.HashType + 16, // 20: gnoi.healthz.CheckRequest.path:type_name -> gnoi.types.Path + 4, // 21: gnoi.healthz.CheckResponse.status:type_name -> gnoi.healthz.ComponentStatus + 1, // 22: gnoi.healthz.Healthz.Get:input_type -> gnoi.healthz.GetRequest + 5, // 23: gnoi.healthz.Healthz.List:input_type -> gnoi.healthz.ListRequest + 7, // 24: gnoi.healthz.Healthz.Acknowledge:input_type -> gnoi.healthz.AcknowledgeRequest + 9, // 25: gnoi.healthz.Healthz.Artifact:input_type -> gnoi.healthz.ArtifactRequest + 14, // 26: gnoi.healthz.Healthz.Check:input_type -> gnoi.healthz.CheckRequest + 2, // 27: gnoi.healthz.Healthz.Get:output_type -> gnoi.healthz.GetResponse + 6, // 28: gnoi.healthz.Healthz.List:output_type -> gnoi.healthz.ListResponse + 8, // 29: gnoi.healthz.Healthz.Acknowledge:output_type -> gnoi.healthz.AcknowledgeResponse + 10, // 30: gnoi.healthz.Healthz.Artifact:output_type -> gnoi.healthz.ArtifactResponse + 15, // 31: gnoi.healthz.Healthz.Check:output_type -> gnoi.healthz.CheckResponse + 27, // [27:32] is the sub-list for method output_type + 22, // [22:27] is the sub-list for method input_type + 22, // [22:22] is the sub-list for extension type_name + 22, // [22:22] is the sub-list for extension extendee + 0, // [0:22] is the sub-list for field type_name +} + +func init() { file_healthz_healthz_proto_init() } +func file_healthz_healthz_proto_init() { + if File_healthz_healthz_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_healthz_healthz_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_healthz_healthz_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_healthz_healthz_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ArtifactHeader); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_healthz_healthz_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ComponentStatus); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_healthz_healthz_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_healthz_healthz_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_healthz_healthz_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AcknowledgeRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_healthz_healthz_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AcknowledgeResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_healthz_healthz_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ArtifactRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_healthz_healthz_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ArtifactResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_healthz_healthz_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FileArtifactType); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_healthz_healthz_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ProtoArtifactType); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_healthz_healthz_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ArtifactTrailer); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_healthz_healthz_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CheckRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_healthz_healthz_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CheckResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_healthz_healthz_proto_msgTypes[2].OneofWrappers = []interface{}{ + (*ArtifactHeader_File)(nil), + (*ArtifactHeader_Proto)(nil), + (*ArtifactHeader_Custom)(nil), + } + file_healthz_healthz_proto_msgTypes[9].OneofWrappers = []interface{}{ + (*ArtifactResponse_Header)(nil), + (*ArtifactResponse_Trailer)(nil), + (*ArtifactResponse_Bytes)(nil), + (*ArtifactResponse_Proto)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_healthz_healthz_proto_rawDesc, + NumEnums: 1, + NumMessages: 15, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_healthz_healthz_proto_goTypes, + DependencyIndexes: file_healthz_healthz_proto_depIdxs, + EnumInfos: file_healthz_healthz_proto_enumTypes, + MessageInfos: file_healthz_healthz_proto_msgTypes, + }.Build() + File_healthz_healthz_proto = out.File + file_healthz_healthz_proto_rawDesc = nil + file_healthz_healthz_proto_goTypes = nil + file_healthz_healthz_proto_depIdxs = nil +} diff --git a/src/sonic-framework/gnoi/healthz/healthz.proto b/src/sonic-framework/gnoi/healthz/healthz.proto new file mode 100644 index 000000000000..2e8952ece4c9 --- /dev/null +++ b/src/sonic-framework/gnoi/healthz/healthz.proto @@ -0,0 +1,208 @@ +// +// Copyright 2017 Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +// Generic Network Operation Interface, GNOI, defines a set of RPC's used for +// the operational aspects of network targets. These services are meant to be +// used in conjunction with GNMI for all target state and operational aspects +// of a network target. The gnoi.system.Service is the only mandatory vendor +// implementation. + +syntax = "proto3"; + +package gnoi.healthz; + +import "github.com/openconfig/gnoi/types/types.proto"; +import "google/protobuf/any.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "github.com/openconfig/gnoi/healthz"; + +option (types.gnoi_version) = "1.3.0"; + +// The Healthz service provides access to the status of a path on the +// system. Addtitionally it allows the implementor to provide path specific +// diagnositic data into the status return. +// +// Healthz is expected to work in conjunction with the component OC model. +service Healthz { + // Get will get the latest health status for a gNMI path. If no status is + // available for the requested path an error will be returned. + rpc Get(GetRequest) returns (GetResponse) {} + + // List returns all events for the provided component path. + rpc List(ListRequest) returns (ListResponse) {} + + // Acknowledge will set the acknowledged field for the event. + // This is an idempotent operation. + rpc Acknowledge(AcknowledgeRequest) returns (AcknowledgeResponse) {} + + // Artifact will stream the artifact contents for the provided artifact id. + rpc Artifact(ArtifactRequest) returns (stream ArtifactResponse) {} + + // Check will invoke the healthz on the provided component path. This RPC + // can be expensive depending on the vendor implementation. + rpc Check(CheckRequest) returns (CheckResponse) {} +} + +message GetRequest { + // Path defines the component to try to fetch healthz state for. Get + // retrieves the latest healthz results for a specific component + // that have been collected as a result of a call to Check, or by + // the target itself. + types.Path path = 1; +} + +message GetResponse { + ComponentStatus component = 1; +} + +enum Status { + STATUS_UNSPECIFIED = 0; // The path doesn't support healthz + STATUS_HEALTHY = 1; // The path is healthy + STATUS_UNHEALTHY = 2; // The path is unhealthy +} + +message ArtifactHeader { + // ID of the artifact. + string id = 1; + // Artifact type describes data contents in the artifact. + // File artifacts should use the defined FileArtifactType. + // Proto artifacts should either use the generic ProtoArtifactType + // which means the artifact is made up a sequence of proto.Any + // messages which can be deserialized directly into thier message + // types. Otherwise the implementer can provide a specific artifact type + // which can add any additional metadata the implementor wants and define + // a custom format for the message stream. + oneof artifact_type { + FileArtifactType file = 101; + ProtoArtifactType proto = 102; + google.protobuf.Any custom = 103; + } +} + +message ComponentStatus { + gnoi.types.Path path = 1; // path of subcomponent. + + // Subcomponents that are aggregated by this status. + repeated ComponentStatus subcomponents = 2; + + // Status of this component. + Status status = 3; + + // Opaque data for how the healthcheck is implemented. This can be any proto + // defined by the vendor. This could be the equivalent to outputs like + // "show tech" or core files or any other diagnostic data. + google.protobuf.Any healthz = 4 [deprecated=true]; + + // Artifacts provides links to all artifacts contained in this event. + // The individual artifacts can be retrieved via the Artifact() RPC. + repeated ArtifactHeader artifacts = 5; + + // ID is the unique key for this event in the system. + string id = 6; + + // Acknowledged is set when at least one caller has processed the event. + bool acknowledged = 7; + + // Created is the timestamp when this event was created. + google.protobuf.Timestamp created = 8; + + // Expires is the timestamp when the system will clean up the + // artifact. If unset, the artifact is not scheduled for garbage + // collection. + google.protobuf.Timestamp expires = 9; +} + +message ListRequest { + types.Path path = 1; + // By default only the unacknowledged events for the component will be + // returned. + bool include_acknowledged = 2; +} + +message ListResponse { + repeated ComponentStatus statuses = 1; +} + +message AcknowledgeRequest { + types.Path path = 1; + // Healthz event id. + string id = 2; +} + +message AcknowledgeResponse { + ComponentStatus status = 1; +} + +message ArtifactRequest { + // Artifact ID to be streamed. + string id = 1; +} + +message ArtifactResponse { + oneof contents { + // Header is the first message in the stream. It contains + // the id of the artifact and metadata for the artifact + // based on the type of the artifact. + // OC defines FileArtifactType and ProtoArtifactType. + ArtifactHeader header = 1; + ArtifactTrailer trailer = 2; + bytes bytes = 3; + google.protobuf.Any proto = 4; + } +} + +message FileArtifactType { + // Local file name of the artifact. + string name = 1; + // Path to file on the local file system. (optional) + string path = 2; + // Mimetype of the file. + string mimetype = 3; + // Size of the file. + int64 size = 4; + // Hash of the file. + gnoi.types.HashType hash = 5; +} + +// Generic proto message artifact stream. +// This proto tells the caller that the artifact stream +// will be a stream of proto encoded messages that make up +// the artifact. Each message must be deserialized by the caller +// and there are no other assumptions about the number of +// messages or length of the stream or how those messages are to +// be reassembled. +message ProtoArtifactType { +} + +// ArtifactTrailer is the last message in the artifact stream. +message ArtifactTrailer { +} + +message CheckRequest { + gnoi.types.Path path = 1; + + // When event_id is populated the check request refers to an + // event that has already been reported by the system. The + // device receiving the CheckRequest should populate artifacts + // that are relevant to the event that were not automatically + // collected. Previous artifacts MUST NOT be overwritten. + string event_id = 2; +} + +message CheckResponse{ + ComponentStatus status = 1; +} diff --git a/src/sonic-framework/gnoi/healthz/healthz_grpc.pb.go b/src/sonic-framework/gnoi/healthz/healthz_grpc.pb.go new file mode 100755 index 000000000000..e0cd6465b13c --- /dev/null +++ b/src/sonic-framework/gnoi/healthz/healthz_grpc.pb.go @@ -0,0 +1,277 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.2.0 +// - protoc v3.21.10 +// source: healthz/healthz.proto + +package healthz + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +// HealthzClient is the client API for Healthz service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type HealthzClient interface { + Get(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (*GetResponse, error) + List(ctx context.Context, in *ListRequest, opts ...grpc.CallOption) (*ListResponse, error) + Acknowledge(ctx context.Context, in *AcknowledgeRequest, opts ...grpc.CallOption) (*AcknowledgeResponse, error) + Artifact(ctx context.Context, in *ArtifactRequest, opts ...grpc.CallOption) (Healthz_ArtifactClient, error) + Check(ctx context.Context, in *CheckRequest, opts ...grpc.CallOption) (*CheckResponse, error) +} + +type healthzClient struct { + cc grpc.ClientConnInterface +} + +func NewHealthzClient(cc grpc.ClientConnInterface) HealthzClient { + return &healthzClient{cc} +} + +func (c *healthzClient) Get(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (*GetResponse, error) { + out := new(GetResponse) + err := c.cc.Invoke(ctx, "/gnoi.healthz.Healthz/Get", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *healthzClient) List(ctx context.Context, in *ListRequest, opts ...grpc.CallOption) (*ListResponse, error) { + out := new(ListResponse) + err := c.cc.Invoke(ctx, "/gnoi.healthz.Healthz/List", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *healthzClient) Acknowledge(ctx context.Context, in *AcknowledgeRequest, opts ...grpc.CallOption) (*AcknowledgeResponse, error) { + out := new(AcknowledgeResponse) + err := c.cc.Invoke(ctx, "/gnoi.healthz.Healthz/Acknowledge", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *healthzClient) Artifact(ctx context.Context, in *ArtifactRequest, opts ...grpc.CallOption) (Healthz_ArtifactClient, error) { + stream, err := c.cc.NewStream(ctx, &Healthz_ServiceDesc.Streams[0], "/gnoi.healthz.Healthz/Artifact", opts...) + if err != nil { + return nil, err + } + x := &healthzArtifactClient{stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +type Healthz_ArtifactClient interface { + Recv() (*ArtifactResponse, error) + grpc.ClientStream +} + +type healthzArtifactClient struct { + grpc.ClientStream +} + +func (x *healthzArtifactClient) Recv() (*ArtifactResponse, error) { + m := new(ArtifactResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *healthzClient) Check(ctx context.Context, in *CheckRequest, opts ...grpc.CallOption) (*CheckResponse, error) { + out := new(CheckResponse) + err := c.cc.Invoke(ctx, "/gnoi.healthz.Healthz/Check", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// HealthzServer is the server API for Healthz service. +// All implementations must embed UnimplementedHealthzServer +// for forward compatibility +type HealthzServer interface { + Get(context.Context, *GetRequest) (*GetResponse, error) + List(context.Context, *ListRequest) (*ListResponse, error) + Acknowledge(context.Context, *AcknowledgeRequest) (*AcknowledgeResponse, error) + Artifact(*ArtifactRequest, Healthz_ArtifactServer) error + Check(context.Context, *CheckRequest) (*CheckResponse, error) + mustEmbedUnimplementedHealthzServer() +} + +// UnimplementedHealthzServer must be embedded to have forward compatible implementations. +type UnimplementedHealthzServer struct { +} + +func (UnimplementedHealthzServer) Get(context.Context, *GetRequest) (*GetResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Get not implemented") +} +func (UnimplementedHealthzServer) List(context.Context, *ListRequest) (*ListResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method List not implemented") +} +func (UnimplementedHealthzServer) Acknowledge(context.Context, *AcknowledgeRequest) (*AcknowledgeResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Acknowledge not implemented") +} +func (UnimplementedHealthzServer) Artifact(*ArtifactRequest, Healthz_ArtifactServer) error { + return status.Errorf(codes.Unimplemented, "method Artifact not implemented") +} +func (UnimplementedHealthzServer) Check(context.Context, *CheckRequest) (*CheckResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Check not implemented") +} +func (UnimplementedHealthzServer) mustEmbedUnimplementedHealthzServer() {} + +// UnsafeHealthzServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to HealthzServer will +// result in compilation errors. +type UnsafeHealthzServer interface { + mustEmbedUnimplementedHealthzServer() +} + +func RegisterHealthzServer(s grpc.ServiceRegistrar, srv HealthzServer) { + s.RegisterService(&Healthz_ServiceDesc, srv) +} + +func _Healthz_Get_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(HealthzServer).Get(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/gnoi.healthz.Healthz/Get", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(HealthzServer).Get(ctx, req.(*GetRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Healthz_List_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(HealthzServer).List(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/gnoi.healthz.Healthz/List", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(HealthzServer).List(ctx, req.(*ListRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Healthz_Acknowledge_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AcknowledgeRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(HealthzServer).Acknowledge(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/gnoi.healthz.Healthz/Acknowledge", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(HealthzServer).Acknowledge(ctx, req.(*AcknowledgeRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Healthz_Artifact_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(ArtifactRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(HealthzServer).Artifact(m, &healthzArtifactServer{stream}) +} + +type Healthz_ArtifactServer interface { + Send(*ArtifactResponse) error + grpc.ServerStream +} + +type healthzArtifactServer struct { + grpc.ServerStream +} + +func (x *healthzArtifactServer) Send(m *ArtifactResponse) error { + return x.ServerStream.SendMsg(m) +} + +func _Healthz_Check_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CheckRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(HealthzServer).Check(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/gnoi.healthz.Healthz/Check", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(HealthzServer).Check(ctx, req.(*CheckRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// Healthz_ServiceDesc is the grpc.ServiceDesc for Healthz service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Healthz_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "gnoi.healthz.Healthz", + HandlerType: (*HealthzServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Get", + Handler: _Healthz_Get_Handler, + }, + { + MethodName: "List", + Handler: _Healthz_List_Handler, + }, + { + MethodName: "Acknowledge", + Handler: _Healthz_Acknowledge_Handler, + }, + { + MethodName: "Check", + Handler: _Healthz_Check_Handler, + }, + }, + Streams: []grpc.StreamDesc{ + { + StreamName: "Artifact", + Handler: _Healthz_Artifact_Handler, + ServerStreams: true, + }, + }, + Metadata: "healthz/healthz.proto", +} diff --git a/src/sonic-framework/gnoi/layer2/BUILD.bazel b/src/sonic-framework/gnoi/layer2/BUILD.bazel new file mode 100644 index 000000000000..4715f6c65108 --- /dev/null +++ b/src/sonic-framework/gnoi/layer2/BUILD.bazel @@ -0,0 +1,61 @@ +load("@rules_proto//proto:defs.bzl", "proto_library") +load("@io_bazel_rules_go//go:def.bzl", "go_library") +load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library") +load("@com_github_grpc_grpc//bazel:cc_grpc_library.bzl", "cc_grpc_library") +load("//:common.bzl", "use_new_compilers") + +#Copyright 2021 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +package( + default_visibility = ["//visibility:public"], + licenses = ["notice"], +) + +use_new_compilers() + +proto_library( + name = "layer2_proto", + srcs = ["layer2.proto"], + deps = ["//types:types_proto"], +) + +cc_proto_library( + name = "layer2_cc_proto", + deps = [":layer2_proto"], +) + +cc_grpc_library( + name = "layer2_cc_grpc_proto", + srcs = [":layer2_proto"], + grpc_only = True, + deps = [":layer2_cc_proto"], +) + +go_proto_library( + name = "layer2_go_proto", + compilers = [ + "go_protoc_gen_go", + "go_protoc_gen_go_grpc", + ], + importpath = "github.com/openconfig/gnoi/layer2", + proto = ":layer2_proto", + deps = ["//types"], +) + +go_library( + name = "layer2", + embed = [":layer2_go_proto"], + importpath = "github.com/openconfig/gnoi/layer2", +) diff --git a/src/sonic-framework/gnoi/layer2/layer2.pb.go b/src/sonic-framework/gnoi/layer2/layer2.pb.go new file mode 100644 index 000000000000..92cfe0aa4b97 --- /dev/null +++ b/src/sonic-framework/gnoi/layer2/layer2.pb.go @@ -0,0 +1,887 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.30.0 +// protoc v3.21.10 +// source: layer2/layer2.proto + +package layer2 + +import ( + types "github.com/openconfig/gnoi/types" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type PerformBERTResponse_BERTState int32 + +const ( + PerformBERTResponse_UNKNOWN PerformBERTResponse_BERTState = 0 + PerformBERTResponse_DISABLED PerformBERTResponse_BERTState = 1 + PerformBERTResponse_RUNNING PerformBERTResponse_BERTState = 2 + PerformBERTResponse_COMPLETE PerformBERTResponse_BERTState = 3 + PerformBERTResponse_ERROR PerformBERTResponse_BERTState = 4 +) + +// Enum value maps for PerformBERTResponse_BERTState. +var ( + PerformBERTResponse_BERTState_name = map[int32]string{ + 0: "UNKNOWN", + 1: "DISABLED", + 2: "RUNNING", + 3: "COMPLETE", + 4: "ERROR", + } + PerformBERTResponse_BERTState_value = map[string]int32{ + "UNKNOWN": 0, + "DISABLED": 1, + "RUNNING": 2, + "COMPLETE": 3, + "ERROR": 4, + } +) + +func (x PerformBERTResponse_BERTState) Enum() *PerformBERTResponse_BERTState { + p := new(PerformBERTResponse_BERTState) + *p = x + return p +} + +func (x PerformBERTResponse_BERTState) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (PerformBERTResponse_BERTState) Descriptor() protoreflect.EnumDescriptor { + return file_layer2_layer2_proto_enumTypes[0].Descriptor() +} + +func (PerformBERTResponse_BERTState) Type() protoreflect.EnumType { + return &file_layer2_layer2_proto_enumTypes[0] +} + +func (x PerformBERTResponse_BERTState) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use PerformBERTResponse_BERTState.Descriptor instead. +func (PerformBERTResponse_BERTState) EnumDescriptor() ([]byte, []int) { + return file_layer2_layer2_proto_rawDescGZIP(), []int{5, 0} +} + +type ClearNeighborDiscoveryRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Protocol types.L3Protocol `protobuf:"varint,1,opt,name=protocol,proto3,enum=gnoi.types.L3Protocol" json:"protocol,omitempty"` + Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"` +} + +func (x *ClearNeighborDiscoveryRequest) Reset() { + *x = ClearNeighborDiscoveryRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_layer2_layer2_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ClearNeighborDiscoveryRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ClearNeighborDiscoveryRequest) ProtoMessage() {} + +func (x *ClearNeighborDiscoveryRequest) ProtoReflect() protoreflect.Message { + mi := &file_layer2_layer2_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ClearNeighborDiscoveryRequest.ProtoReflect.Descriptor instead. +func (*ClearNeighborDiscoveryRequest) Descriptor() ([]byte, []int) { + return file_layer2_layer2_proto_rawDescGZIP(), []int{0} +} + +func (x *ClearNeighborDiscoveryRequest) GetProtocol() types.L3Protocol { + if x != nil { + return x.Protocol + } + return types.L3Protocol(0) +} + +func (x *ClearNeighborDiscoveryRequest) GetAddress() string { + if x != nil { + return x.Address + } + return "" +} + +type ClearNeighborDiscoveryResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *ClearNeighborDiscoveryResponse) Reset() { + *x = ClearNeighborDiscoveryResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_layer2_layer2_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ClearNeighborDiscoveryResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ClearNeighborDiscoveryResponse) ProtoMessage() {} + +func (x *ClearNeighborDiscoveryResponse) ProtoReflect() protoreflect.Message { + mi := &file_layer2_layer2_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ClearNeighborDiscoveryResponse.ProtoReflect.Descriptor instead. +func (*ClearNeighborDiscoveryResponse) Descriptor() ([]byte, []int) { + return file_layer2_layer2_proto_rawDescGZIP(), []int{1} +} + +type ClearSpanningTreeRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Interface *types.Path `protobuf:"bytes,1,opt,name=interface,proto3" json:"interface,omitempty"` +} + +func (x *ClearSpanningTreeRequest) Reset() { + *x = ClearSpanningTreeRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_layer2_layer2_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ClearSpanningTreeRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ClearSpanningTreeRequest) ProtoMessage() {} + +func (x *ClearSpanningTreeRequest) ProtoReflect() protoreflect.Message { + mi := &file_layer2_layer2_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ClearSpanningTreeRequest.ProtoReflect.Descriptor instead. +func (*ClearSpanningTreeRequest) Descriptor() ([]byte, []int) { + return file_layer2_layer2_proto_rawDescGZIP(), []int{2} +} + +func (x *ClearSpanningTreeRequest) GetInterface() *types.Path { + if x != nil { + return x.Interface + } + return nil +} + +type ClearSpanningTreeResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *ClearSpanningTreeResponse) Reset() { + *x = ClearSpanningTreeResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_layer2_layer2_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ClearSpanningTreeResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ClearSpanningTreeResponse) ProtoMessage() {} + +func (x *ClearSpanningTreeResponse) ProtoReflect() protoreflect.Message { + mi := &file_layer2_layer2_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ClearSpanningTreeResponse.ProtoReflect.Descriptor instead. +func (*ClearSpanningTreeResponse) Descriptor() ([]byte, []int) { + return file_layer2_layer2_proto_rawDescGZIP(), []int{3} +} + +type PerformBERTRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Interface *types.Path `protobuf:"bytes,2,opt,name=interface,proto3" json:"interface,omitempty"` +} + +func (x *PerformBERTRequest) Reset() { + *x = PerformBERTRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_layer2_layer2_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PerformBERTRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PerformBERTRequest) ProtoMessage() {} + +func (x *PerformBERTRequest) ProtoReflect() protoreflect.Message { + mi := &file_layer2_layer2_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PerformBERTRequest.ProtoReflect.Descriptor instead. +func (*PerformBERTRequest) Descriptor() ([]byte, []int) { + return file_layer2_layer2_proto_rawDescGZIP(), []int{4} +} + +func (x *PerformBERTRequest) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *PerformBERTRequest) GetInterface() *types.Path { + if x != nil { + return x.Interface + } + return nil +} + +type PerformBERTResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + State PerformBERTResponse_BERTState `protobuf:"varint,2,opt,name=state,proto3,enum=gnoi.layer2.PerformBERTResponse_BERTState" json:"state,omitempty"` + ElapsedPeriod int64 `protobuf:"varint,3,opt,name=elapsed_period,json=elapsedPeriod,proto3" json:"elapsed_period,omitempty"` + Pattern []byte `protobuf:"bytes,4,opt,name=pattern,proto3" json:"pattern,omitempty"` + Errors int64 `protobuf:"varint,5,opt,name=errors,proto3" json:"errors,omitempty"` + ReceivedBits int64 `protobuf:"varint,6,opt,name=received_bits,json=receivedBits,proto3" json:"received_bits,omitempty"` +} + +func (x *PerformBERTResponse) Reset() { + *x = PerformBERTResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_layer2_layer2_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PerformBERTResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PerformBERTResponse) ProtoMessage() {} + +func (x *PerformBERTResponse) ProtoReflect() protoreflect.Message { + mi := &file_layer2_layer2_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PerformBERTResponse.ProtoReflect.Descriptor instead. +func (*PerformBERTResponse) Descriptor() ([]byte, []int) { + return file_layer2_layer2_proto_rawDescGZIP(), []int{5} +} + +func (x *PerformBERTResponse) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *PerformBERTResponse) GetState() PerformBERTResponse_BERTState { + if x != nil { + return x.State + } + return PerformBERTResponse_UNKNOWN +} + +func (x *PerformBERTResponse) GetElapsedPeriod() int64 { + if x != nil { + return x.ElapsedPeriod + } + return 0 +} + +func (x *PerformBERTResponse) GetPattern() []byte { + if x != nil { + return x.Pattern + } + return nil +} + +func (x *PerformBERTResponse) GetErrors() int64 { + if x != nil { + return x.Errors + } + return 0 +} + +func (x *PerformBERTResponse) GetReceivedBits() int64 { + if x != nil { + return x.ReceivedBits + } + return 0 +} + +type ClearLLDPInterfaceRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Interface *types.Path `protobuf:"bytes,1,opt,name=interface,proto3" json:"interface,omitempty"` +} + +func (x *ClearLLDPInterfaceRequest) Reset() { + *x = ClearLLDPInterfaceRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_layer2_layer2_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ClearLLDPInterfaceRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ClearLLDPInterfaceRequest) ProtoMessage() {} + +func (x *ClearLLDPInterfaceRequest) ProtoReflect() protoreflect.Message { + mi := &file_layer2_layer2_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ClearLLDPInterfaceRequest.ProtoReflect.Descriptor instead. +func (*ClearLLDPInterfaceRequest) Descriptor() ([]byte, []int) { + return file_layer2_layer2_proto_rawDescGZIP(), []int{6} +} + +func (x *ClearLLDPInterfaceRequest) GetInterface() *types.Path { + if x != nil { + return x.Interface + } + return nil +} + +type ClearLLDPInterfaceResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *ClearLLDPInterfaceResponse) Reset() { + *x = ClearLLDPInterfaceResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_layer2_layer2_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ClearLLDPInterfaceResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ClearLLDPInterfaceResponse) ProtoMessage() {} + +func (x *ClearLLDPInterfaceResponse) ProtoReflect() protoreflect.Message { + mi := &file_layer2_layer2_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ClearLLDPInterfaceResponse.ProtoReflect.Descriptor instead. +func (*ClearLLDPInterfaceResponse) Descriptor() ([]byte, []int) { + return file_layer2_layer2_proto_rawDescGZIP(), []int{7} +} + +type SendWakeOnLANRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Interface *types.Path `protobuf:"bytes,1,opt,name=interface,proto3" json:"interface,omitempty"` + Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"` + MacAddress []byte `protobuf:"bytes,3,opt,name=mac_address,json=macAddress,proto3" json:"mac_address,omitempty"` +} + +func (x *SendWakeOnLANRequest) Reset() { + *x = SendWakeOnLANRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_layer2_layer2_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SendWakeOnLANRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SendWakeOnLANRequest) ProtoMessage() {} + +func (x *SendWakeOnLANRequest) ProtoReflect() protoreflect.Message { + mi := &file_layer2_layer2_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SendWakeOnLANRequest.ProtoReflect.Descriptor instead. +func (*SendWakeOnLANRequest) Descriptor() ([]byte, []int) { + return file_layer2_layer2_proto_rawDescGZIP(), []int{8} +} + +func (x *SendWakeOnLANRequest) GetInterface() *types.Path { + if x != nil { + return x.Interface + } + return nil +} + +func (x *SendWakeOnLANRequest) GetAddress() string { + if x != nil { + return x.Address + } + return "" +} + +func (x *SendWakeOnLANRequest) GetMacAddress() []byte { + if x != nil { + return x.MacAddress + } + return nil +} + +type SendWakeOnLANResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *SendWakeOnLANResponse) Reset() { + *x = SendWakeOnLANResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_layer2_layer2_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SendWakeOnLANResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SendWakeOnLANResponse) ProtoMessage() {} + +func (x *SendWakeOnLANResponse) ProtoReflect() protoreflect.Message { + mi := &file_layer2_layer2_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SendWakeOnLANResponse.ProtoReflect.Descriptor instead. +func (*SendWakeOnLANResponse) Descriptor() ([]byte, []int) { + return file_layer2_layer2_proto_rawDescGZIP(), []int{9} +} + +var File_layer2_layer2_proto protoreflect.FileDescriptor + +var file_layer2_layer2_proto_rawDesc = []byte{ + 0x0a, 0x13, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x32, 0x2f, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x32, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0b, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x6c, 0x61, 0x79, 0x65, + 0x72, 0x32, 0x1a, 0x2c, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, + 0x70, 0x65, 0x6e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x67, 0x6e, 0x6f, 0x69, 0x2f, 0x74, + 0x79, 0x70, 0x65, 0x73, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x22, 0x6d, 0x0a, 0x1d, 0x43, 0x6c, 0x65, 0x61, 0x72, 0x4e, 0x65, 0x69, 0x67, 0x68, 0x62, 0x6f, + 0x72, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x32, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0e, 0x32, 0x16, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, + 0x2e, 0x4c, 0x33, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x52, 0x08, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, + 0x20, 0x0a, 0x1e, 0x43, 0x6c, 0x65, 0x61, 0x72, 0x4e, 0x65, 0x69, 0x67, 0x68, 0x62, 0x6f, 0x72, + 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x4a, 0x0a, 0x18, 0x43, 0x6c, 0x65, 0x61, 0x72, 0x53, 0x70, 0x61, 0x6e, 0x6e, 0x69, + 0x6e, 0x67, 0x54, 0x72, 0x65, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2e, 0x0a, + 0x09, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x10, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x50, 0x61, + 0x74, 0x68, 0x52, 0x09, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x22, 0x1b, 0x0a, + 0x19, 0x43, 0x6c, 0x65, 0x61, 0x72, 0x53, 0x70, 0x61, 0x6e, 0x6e, 0x69, 0x6e, 0x67, 0x54, 0x72, + 0x65, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x54, 0x0a, 0x12, 0x50, 0x65, + 0x72, 0x66, 0x6f, 0x72, 0x6d, 0x42, 0x45, 0x52, 0x54, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, + 0x12, 0x2e, 0x0a, 0x09, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, + 0x2e, 0x50, 0x61, 0x74, 0x68, 0x52, 0x09, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, + 0x22, 0xb3, 0x02, 0x0a, 0x13, 0x50, 0x65, 0x72, 0x66, 0x6f, 0x72, 0x6d, 0x42, 0x45, 0x52, 0x54, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x40, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2a, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x6c, + 0x61, 0x79, 0x65, 0x72, 0x32, 0x2e, 0x50, 0x65, 0x72, 0x66, 0x6f, 0x72, 0x6d, 0x42, 0x45, 0x52, + 0x54, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x42, 0x45, 0x52, 0x54, 0x53, 0x74, + 0x61, 0x74, 0x65, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x65, 0x6c, + 0x61, 0x70, 0x73, 0x65, 0x64, 0x5f, 0x70, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x0d, 0x65, 0x6c, 0x61, 0x70, 0x73, 0x65, 0x64, 0x50, 0x65, 0x72, 0x69, 0x6f, + 0x64, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, 0x74, 0x74, 0x65, 0x72, 0x6e, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x0c, 0x52, 0x07, 0x70, 0x61, 0x74, 0x74, 0x65, 0x72, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x65, + 0x72, 0x72, 0x6f, 0x72, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x65, 0x72, 0x72, + 0x6f, 0x72, 0x73, 0x12, 0x23, 0x0a, 0x0d, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x64, 0x5f, + 0x62, 0x69, 0x74, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0c, 0x72, 0x65, 0x63, 0x65, + 0x69, 0x76, 0x65, 0x64, 0x42, 0x69, 0x74, 0x73, 0x22, 0x4c, 0x0a, 0x09, 0x42, 0x45, 0x52, 0x54, + 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, + 0x10, 0x00, 0x12, 0x0c, 0x0a, 0x08, 0x44, 0x49, 0x53, 0x41, 0x42, 0x4c, 0x45, 0x44, 0x10, 0x01, + 0x12, 0x0b, 0x0a, 0x07, 0x52, 0x55, 0x4e, 0x4e, 0x49, 0x4e, 0x47, 0x10, 0x02, 0x12, 0x0c, 0x0a, + 0x08, 0x43, 0x4f, 0x4d, 0x50, 0x4c, 0x45, 0x54, 0x45, 0x10, 0x03, 0x12, 0x09, 0x0a, 0x05, 0x45, + 0x52, 0x52, 0x4f, 0x52, 0x10, 0x04, 0x22, 0x4b, 0x0a, 0x19, 0x43, 0x6c, 0x65, 0x61, 0x72, 0x4c, + 0x4c, 0x44, 0x50, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x2e, 0x0a, 0x09, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x74, 0x79, + 0x70, 0x65, 0x73, 0x2e, 0x50, 0x61, 0x74, 0x68, 0x52, 0x09, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x66, + 0x61, 0x63, 0x65, 0x22, 0x1c, 0x0a, 0x1a, 0x43, 0x6c, 0x65, 0x61, 0x72, 0x4c, 0x4c, 0x44, 0x50, + 0x49, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x81, 0x01, 0x0a, 0x14, 0x53, 0x65, 0x6e, 0x64, 0x57, 0x61, 0x6b, 0x65, 0x4f, 0x6e, + 0x4c, 0x41, 0x4e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2e, 0x0a, 0x09, 0x69, 0x6e, + 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, + 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x50, 0x61, 0x74, 0x68, 0x52, + 0x09, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, + 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, + 0x72, 0x65, 0x73, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x6d, 0x61, 0x63, 0x5f, 0x61, 0x64, 0x64, 0x72, + 0x65, 0x73, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0a, 0x6d, 0x61, 0x63, 0x41, 0x64, + 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x17, 0x0a, 0x15, 0x53, 0x65, 0x6e, 0x64, 0x57, 0x61, 0x6b, + 0x65, 0x4f, 0x6e, 0x4c, 0x41, 0x4e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0xfc, + 0x03, 0x0a, 0x06, 0x4c, 0x61, 0x79, 0x65, 0x72, 0x32, 0x12, 0x73, 0x0a, 0x16, 0x43, 0x6c, 0x65, + 0x61, 0x72, 0x4e, 0x65, 0x69, 0x67, 0x68, 0x62, 0x6f, 0x72, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, + 0x65, 0x72, 0x79, 0x12, 0x2a, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x6c, 0x61, 0x79, 0x65, 0x72, + 0x32, 0x2e, 0x43, 0x6c, 0x65, 0x61, 0x72, 0x4e, 0x65, 0x69, 0x67, 0x68, 0x62, 0x6f, 0x72, 0x44, + 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x2b, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x32, 0x2e, 0x43, 0x6c, + 0x65, 0x61, 0x72, 0x4e, 0x65, 0x69, 0x67, 0x68, 0x62, 0x6f, 0x72, 0x44, 0x69, 0x73, 0x63, 0x6f, + 0x76, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x64, + 0x0a, 0x11, 0x43, 0x6c, 0x65, 0x61, 0x72, 0x53, 0x70, 0x61, 0x6e, 0x6e, 0x69, 0x6e, 0x67, 0x54, + 0x72, 0x65, 0x65, 0x12, 0x25, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x6c, 0x61, 0x79, 0x65, 0x72, + 0x32, 0x2e, 0x43, 0x6c, 0x65, 0x61, 0x72, 0x53, 0x70, 0x61, 0x6e, 0x6e, 0x69, 0x6e, 0x67, 0x54, + 0x72, 0x65, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x67, 0x6e, 0x6f, + 0x69, 0x2e, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x32, 0x2e, 0x43, 0x6c, 0x65, 0x61, 0x72, 0x53, 0x70, + 0x61, 0x6e, 0x6e, 0x69, 0x6e, 0x67, 0x54, 0x72, 0x65, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x00, 0x12, 0x54, 0x0a, 0x0b, 0x50, 0x65, 0x72, 0x66, 0x6f, 0x72, 0x6d, 0x42, + 0x45, 0x52, 0x54, 0x12, 0x1f, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x6c, 0x61, 0x79, 0x65, 0x72, + 0x32, 0x2e, 0x50, 0x65, 0x72, 0x66, 0x6f, 0x72, 0x6d, 0x42, 0x45, 0x52, 0x54, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x6c, 0x61, 0x79, 0x65, + 0x72, 0x32, 0x2e, 0x50, 0x65, 0x72, 0x66, 0x6f, 0x72, 0x6d, 0x42, 0x45, 0x52, 0x54, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x30, 0x01, 0x12, 0x67, 0x0a, 0x12, 0x43, 0x6c, + 0x65, 0x61, 0x72, 0x4c, 0x4c, 0x44, 0x50, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, + 0x12, 0x26, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x32, 0x2e, 0x43, + 0x6c, 0x65, 0x61, 0x72, 0x4c, 0x4c, 0x44, 0x50, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, + 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, + 0x6c, 0x61, 0x79, 0x65, 0x72, 0x32, 0x2e, 0x43, 0x6c, 0x65, 0x61, 0x72, 0x4c, 0x4c, 0x44, 0x50, + 0x49, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x00, 0x12, 0x58, 0x0a, 0x0d, 0x53, 0x65, 0x6e, 0x64, 0x57, 0x61, 0x6b, 0x65, 0x4f, + 0x6e, 0x4c, 0x41, 0x4e, 0x12, 0x21, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x6c, 0x61, 0x79, 0x65, + 0x72, 0x32, 0x2e, 0x53, 0x65, 0x6e, 0x64, 0x57, 0x61, 0x6b, 0x65, 0x4f, 0x6e, 0x4c, 0x41, 0x4e, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x6c, + 0x61, 0x79, 0x65, 0x72, 0x32, 0x2e, 0x53, 0x65, 0x6e, 0x64, 0x57, 0x61, 0x6b, 0x65, 0x4f, 0x6e, + 0x4c, 0x41, 0x4e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x2b, 0xd2, + 0x3e, 0x05, 0x30, 0x2e, 0x31, 0x2e, 0x30, 0x5a, 0x21, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, + 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x67, + 0x6e, 0x6f, 0x69, 0x2f, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x32, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, +} + +var ( + file_layer2_layer2_proto_rawDescOnce sync.Once + file_layer2_layer2_proto_rawDescData = file_layer2_layer2_proto_rawDesc +) + +func file_layer2_layer2_proto_rawDescGZIP() []byte { + file_layer2_layer2_proto_rawDescOnce.Do(func() { + file_layer2_layer2_proto_rawDescData = protoimpl.X.CompressGZIP(file_layer2_layer2_proto_rawDescData) + }) + return file_layer2_layer2_proto_rawDescData +} + +var file_layer2_layer2_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_layer2_layer2_proto_msgTypes = make([]protoimpl.MessageInfo, 10) +var file_layer2_layer2_proto_goTypes = []interface{}{ + (PerformBERTResponse_BERTState)(0), // 0: gnoi.layer2.PerformBERTResponse.BERTState + (*ClearNeighborDiscoveryRequest)(nil), // 1: gnoi.layer2.ClearNeighborDiscoveryRequest + (*ClearNeighborDiscoveryResponse)(nil), // 2: gnoi.layer2.ClearNeighborDiscoveryResponse + (*ClearSpanningTreeRequest)(nil), // 3: gnoi.layer2.ClearSpanningTreeRequest + (*ClearSpanningTreeResponse)(nil), // 4: gnoi.layer2.ClearSpanningTreeResponse + (*PerformBERTRequest)(nil), // 5: gnoi.layer2.PerformBERTRequest + (*PerformBERTResponse)(nil), // 6: gnoi.layer2.PerformBERTResponse + (*ClearLLDPInterfaceRequest)(nil), // 7: gnoi.layer2.ClearLLDPInterfaceRequest + (*ClearLLDPInterfaceResponse)(nil), // 8: gnoi.layer2.ClearLLDPInterfaceResponse + (*SendWakeOnLANRequest)(nil), // 9: gnoi.layer2.SendWakeOnLANRequest + (*SendWakeOnLANResponse)(nil), // 10: gnoi.layer2.SendWakeOnLANResponse + (types.L3Protocol)(0), // 11: gnoi.types.L3Protocol + (*types.Path)(nil), // 12: gnoi.types.Path +} +var file_layer2_layer2_proto_depIdxs = []int32{ + 11, // 0: gnoi.layer2.ClearNeighborDiscoveryRequest.protocol:type_name -> gnoi.types.L3Protocol + 12, // 1: gnoi.layer2.ClearSpanningTreeRequest.interface:type_name -> gnoi.types.Path + 12, // 2: gnoi.layer2.PerformBERTRequest.interface:type_name -> gnoi.types.Path + 0, // 3: gnoi.layer2.PerformBERTResponse.state:type_name -> gnoi.layer2.PerformBERTResponse.BERTState + 12, // 4: gnoi.layer2.ClearLLDPInterfaceRequest.interface:type_name -> gnoi.types.Path + 12, // 5: gnoi.layer2.SendWakeOnLANRequest.interface:type_name -> gnoi.types.Path + 1, // 6: gnoi.layer2.Layer2.ClearNeighborDiscovery:input_type -> gnoi.layer2.ClearNeighborDiscoveryRequest + 3, // 7: gnoi.layer2.Layer2.ClearSpanningTree:input_type -> gnoi.layer2.ClearSpanningTreeRequest + 5, // 8: gnoi.layer2.Layer2.PerformBERT:input_type -> gnoi.layer2.PerformBERTRequest + 7, // 9: gnoi.layer2.Layer2.ClearLLDPInterface:input_type -> gnoi.layer2.ClearLLDPInterfaceRequest + 9, // 10: gnoi.layer2.Layer2.SendWakeOnLAN:input_type -> gnoi.layer2.SendWakeOnLANRequest + 2, // 11: gnoi.layer2.Layer2.ClearNeighborDiscovery:output_type -> gnoi.layer2.ClearNeighborDiscoveryResponse + 4, // 12: gnoi.layer2.Layer2.ClearSpanningTree:output_type -> gnoi.layer2.ClearSpanningTreeResponse + 6, // 13: gnoi.layer2.Layer2.PerformBERT:output_type -> gnoi.layer2.PerformBERTResponse + 8, // 14: gnoi.layer2.Layer2.ClearLLDPInterface:output_type -> gnoi.layer2.ClearLLDPInterfaceResponse + 10, // 15: gnoi.layer2.Layer2.SendWakeOnLAN:output_type -> gnoi.layer2.SendWakeOnLANResponse + 11, // [11:16] is the sub-list for method output_type + 6, // [6:11] is the sub-list for method input_type + 6, // [6:6] is the sub-list for extension type_name + 6, // [6:6] is the sub-list for extension extendee + 0, // [0:6] is the sub-list for field type_name +} + +func init() { file_layer2_layer2_proto_init() } +func file_layer2_layer2_proto_init() { + if File_layer2_layer2_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_layer2_layer2_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ClearNeighborDiscoveryRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_layer2_layer2_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ClearNeighborDiscoveryResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_layer2_layer2_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ClearSpanningTreeRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_layer2_layer2_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ClearSpanningTreeResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_layer2_layer2_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PerformBERTRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_layer2_layer2_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PerformBERTResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_layer2_layer2_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ClearLLDPInterfaceRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_layer2_layer2_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ClearLLDPInterfaceResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_layer2_layer2_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SendWakeOnLANRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_layer2_layer2_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SendWakeOnLANResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_layer2_layer2_proto_rawDesc, + NumEnums: 1, + NumMessages: 10, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_layer2_layer2_proto_goTypes, + DependencyIndexes: file_layer2_layer2_proto_depIdxs, + EnumInfos: file_layer2_layer2_proto_enumTypes, + MessageInfos: file_layer2_layer2_proto_msgTypes, + }.Build() + File_layer2_layer2_proto = out.File + file_layer2_layer2_proto_rawDesc = nil + file_layer2_layer2_proto_goTypes = nil + file_layer2_layer2_proto_depIdxs = nil +} diff --git a/src/sonic-framework/gnoi/layer2/layer2.proto b/src/sonic-framework/gnoi/layer2/layer2.proto new file mode 100644 index 000000000000..552ac29c3cac --- /dev/null +++ b/src/sonic-framework/gnoi/layer2/layer2.proto @@ -0,0 +1,112 @@ +// +// Copyright 2017 Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +syntax = "proto3"; + +package gnoi.layer2; + +import "github.com/openconfig/gnoi/types/types.proto"; + +option go_package = "github.com/openconfig/gnoi/layer2"; + +option (types.gnoi_version) = "0.1.0"; + +service Layer2 { + // ClearNeighborDiscovery will clear either a specific neighbor entry or + // clear the entire table based on parameters provided. + // TODO: This method is subject to deprecation once OpenConfig models this + // state. + rpc ClearNeighborDiscovery(ClearNeighborDiscoveryRequest) + returns (ClearNeighborDiscoveryResponse) {} + + // ClearSpanningTree will reset a blocked spanning tree interface. + // TODO: This method is subject to deprecation once OpenConfig models this + // state. + rpc ClearSpanningTree(ClearSpanningTreeRequest) + returns (ClearSpanningTreeResponse) {} + + // PerformBERT will perform a BERT operation on a port. The stream will + // return the current state of the operation as well as the ID for the + // operation. + rpc PerformBERT(PerformBERTRequest) + returns (stream PerformBERTResponse) {} + + // ClearLLDPInterface will clear all LLDP adjacencies on the provided + // interface. + rpc ClearLLDPInterface(ClearLLDPInterfaceRequest) + returns (ClearLLDPInterfaceResponse) {} + + // SendWakeOnLAN will send a WOL event on the requested interface. + rpc SendWakeOnLAN(SendWakeOnLANRequest) + returns (SendWakeOnLANResponse) {} + +} + +message ClearNeighborDiscoveryRequest { + types.L3Protocol protocol = 1; + string address = 2; +} + +message ClearNeighborDiscoveryResponse { +} + + +message ClearSpanningTreeRequest { + types.Path interface = 1; +} + +message ClearSpanningTreeResponse { +} + +message PerformBERTRequest { + // ID for retrieving a previous BERT run data - optional. + string id = 1; + types.Path interface = 2; +} + +message PerformBERTResponse { + string id = 1; + enum BERTState { + UNKNOWN = 0; + DISABLED = 1; + RUNNING = 2; + COMPLETE = 3; + ERROR = 4; + } + BERTState state = 2; + int64 elapsed_period = 3; // BERT test length in nanoseconds. + bytes pattern = 4; // Pattern used for the BERT test. + // Number of errors experienced since the start of the BERT test. + int64 errors = 5; + // Number of bits received since the start of the BERT test. + int64 received_bits = 6; +} + +message ClearLLDPInterfaceRequest { + types.Path interface = 1; +} + +message ClearLLDPInterfaceResponse { +} + +message SendWakeOnLANRequest { + types.Path interface = 1; + string address = 2; // IP address of the WOL target. + bytes mac_address = 3; // MAC address of the target. +} + +message SendWakeOnLANResponse { +} diff --git a/src/sonic-framework/gnoi/layer2/layer2_grpc.pb.go b/src/sonic-framework/gnoi/layer2/layer2_grpc.pb.go new file mode 100755 index 000000000000..1690a8c590d3 --- /dev/null +++ b/src/sonic-framework/gnoi/layer2/layer2_grpc.pb.go @@ -0,0 +1,277 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.2.0 +// - protoc v3.21.10 +// source: layer2/layer2.proto + +package layer2 + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +// Layer2Client is the client API for Layer2 service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type Layer2Client interface { + ClearNeighborDiscovery(ctx context.Context, in *ClearNeighborDiscoveryRequest, opts ...grpc.CallOption) (*ClearNeighborDiscoveryResponse, error) + ClearSpanningTree(ctx context.Context, in *ClearSpanningTreeRequest, opts ...grpc.CallOption) (*ClearSpanningTreeResponse, error) + PerformBERT(ctx context.Context, in *PerformBERTRequest, opts ...grpc.CallOption) (Layer2_PerformBERTClient, error) + ClearLLDPInterface(ctx context.Context, in *ClearLLDPInterfaceRequest, opts ...grpc.CallOption) (*ClearLLDPInterfaceResponse, error) + SendWakeOnLAN(ctx context.Context, in *SendWakeOnLANRequest, opts ...grpc.CallOption) (*SendWakeOnLANResponse, error) +} + +type layer2Client struct { + cc grpc.ClientConnInterface +} + +func NewLayer2Client(cc grpc.ClientConnInterface) Layer2Client { + return &layer2Client{cc} +} + +func (c *layer2Client) ClearNeighborDiscovery(ctx context.Context, in *ClearNeighborDiscoveryRequest, opts ...grpc.CallOption) (*ClearNeighborDiscoveryResponse, error) { + out := new(ClearNeighborDiscoveryResponse) + err := c.cc.Invoke(ctx, "/gnoi.layer2.Layer2/ClearNeighborDiscovery", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *layer2Client) ClearSpanningTree(ctx context.Context, in *ClearSpanningTreeRequest, opts ...grpc.CallOption) (*ClearSpanningTreeResponse, error) { + out := new(ClearSpanningTreeResponse) + err := c.cc.Invoke(ctx, "/gnoi.layer2.Layer2/ClearSpanningTree", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *layer2Client) PerformBERT(ctx context.Context, in *PerformBERTRequest, opts ...grpc.CallOption) (Layer2_PerformBERTClient, error) { + stream, err := c.cc.NewStream(ctx, &Layer2_ServiceDesc.Streams[0], "/gnoi.layer2.Layer2/PerformBERT", opts...) + if err != nil { + return nil, err + } + x := &layer2PerformBERTClient{stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +type Layer2_PerformBERTClient interface { + Recv() (*PerformBERTResponse, error) + grpc.ClientStream +} + +type layer2PerformBERTClient struct { + grpc.ClientStream +} + +func (x *layer2PerformBERTClient) Recv() (*PerformBERTResponse, error) { + m := new(PerformBERTResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *layer2Client) ClearLLDPInterface(ctx context.Context, in *ClearLLDPInterfaceRequest, opts ...grpc.CallOption) (*ClearLLDPInterfaceResponse, error) { + out := new(ClearLLDPInterfaceResponse) + err := c.cc.Invoke(ctx, "/gnoi.layer2.Layer2/ClearLLDPInterface", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *layer2Client) SendWakeOnLAN(ctx context.Context, in *SendWakeOnLANRequest, opts ...grpc.CallOption) (*SendWakeOnLANResponse, error) { + out := new(SendWakeOnLANResponse) + err := c.cc.Invoke(ctx, "/gnoi.layer2.Layer2/SendWakeOnLAN", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Layer2Server is the server API for Layer2 service. +// All implementations must embed UnimplementedLayer2Server +// for forward compatibility +type Layer2Server interface { + ClearNeighborDiscovery(context.Context, *ClearNeighborDiscoveryRequest) (*ClearNeighborDiscoveryResponse, error) + ClearSpanningTree(context.Context, *ClearSpanningTreeRequest) (*ClearSpanningTreeResponse, error) + PerformBERT(*PerformBERTRequest, Layer2_PerformBERTServer) error + ClearLLDPInterface(context.Context, *ClearLLDPInterfaceRequest) (*ClearLLDPInterfaceResponse, error) + SendWakeOnLAN(context.Context, *SendWakeOnLANRequest) (*SendWakeOnLANResponse, error) + mustEmbedUnimplementedLayer2Server() +} + +// UnimplementedLayer2Server must be embedded to have forward compatible implementations. +type UnimplementedLayer2Server struct { +} + +func (UnimplementedLayer2Server) ClearNeighborDiscovery(context.Context, *ClearNeighborDiscoveryRequest) (*ClearNeighborDiscoveryResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ClearNeighborDiscovery not implemented") +} +func (UnimplementedLayer2Server) ClearSpanningTree(context.Context, *ClearSpanningTreeRequest) (*ClearSpanningTreeResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ClearSpanningTree not implemented") +} +func (UnimplementedLayer2Server) PerformBERT(*PerformBERTRequest, Layer2_PerformBERTServer) error { + return status.Errorf(codes.Unimplemented, "method PerformBERT not implemented") +} +func (UnimplementedLayer2Server) ClearLLDPInterface(context.Context, *ClearLLDPInterfaceRequest) (*ClearLLDPInterfaceResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ClearLLDPInterface not implemented") +} +func (UnimplementedLayer2Server) SendWakeOnLAN(context.Context, *SendWakeOnLANRequest) (*SendWakeOnLANResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SendWakeOnLAN not implemented") +} +func (UnimplementedLayer2Server) mustEmbedUnimplementedLayer2Server() {} + +// UnsafeLayer2Server may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to Layer2Server will +// result in compilation errors. +type UnsafeLayer2Server interface { + mustEmbedUnimplementedLayer2Server() +} + +func RegisterLayer2Server(s grpc.ServiceRegistrar, srv Layer2Server) { + s.RegisterService(&Layer2_ServiceDesc, srv) +} + +func _Layer2_ClearNeighborDiscovery_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ClearNeighborDiscoveryRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(Layer2Server).ClearNeighborDiscovery(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/gnoi.layer2.Layer2/ClearNeighborDiscovery", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(Layer2Server).ClearNeighborDiscovery(ctx, req.(*ClearNeighborDiscoveryRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Layer2_ClearSpanningTree_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ClearSpanningTreeRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(Layer2Server).ClearSpanningTree(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/gnoi.layer2.Layer2/ClearSpanningTree", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(Layer2Server).ClearSpanningTree(ctx, req.(*ClearSpanningTreeRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Layer2_PerformBERT_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(PerformBERTRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(Layer2Server).PerformBERT(m, &layer2PerformBERTServer{stream}) +} + +type Layer2_PerformBERTServer interface { + Send(*PerformBERTResponse) error + grpc.ServerStream +} + +type layer2PerformBERTServer struct { + grpc.ServerStream +} + +func (x *layer2PerformBERTServer) Send(m *PerformBERTResponse) error { + return x.ServerStream.SendMsg(m) +} + +func _Layer2_ClearLLDPInterface_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ClearLLDPInterfaceRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(Layer2Server).ClearLLDPInterface(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/gnoi.layer2.Layer2/ClearLLDPInterface", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(Layer2Server).ClearLLDPInterface(ctx, req.(*ClearLLDPInterfaceRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Layer2_SendWakeOnLAN_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SendWakeOnLANRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(Layer2Server).SendWakeOnLAN(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/gnoi.layer2.Layer2/SendWakeOnLAN", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(Layer2Server).SendWakeOnLAN(ctx, req.(*SendWakeOnLANRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// Layer2_ServiceDesc is the grpc.ServiceDesc for Layer2 service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Layer2_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "gnoi.layer2.Layer2", + HandlerType: (*Layer2Server)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "ClearNeighborDiscovery", + Handler: _Layer2_ClearNeighborDiscovery_Handler, + }, + { + MethodName: "ClearSpanningTree", + Handler: _Layer2_ClearSpanningTree_Handler, + }, + { + MethodName: "ClearLLDPInterface", + Handler: _Layer2_ClearLLDPInterface_Handler, + }, + { + MethodName: "SendWakeOnLAN", + Handler: _Layer2_SendWakeOnLAN_Handler, + }, + }, + Streams: []grpc.StreamDesc{ + { + StreamName: "PerformBERT", + Handler: _Layer2_PerformBERT_Handler, + ServerStreams: true, + }, + }, + Metadata: "layer2/layer2.proto", +} diff --git a/src/sonic-framework/gnoi/mpls/BUILD.bazel b/src/sonic-framework/gnoi/mpls/BUILD.bazel new file mode 100644 index 000000000000..3406775e9a95 --- /dev/null +++ b/src/sonic-framework/gnoi/mpls/BUILD.bazel @@ -0,0 +1,61 @@ +load("@rules_proto//proto:defs.bzl", "proto_library") +load("@io_bazel_rules_go//go:def.bzl", "go_library") +load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library") +load("@com_github_grpc_grpc//bazel:cc_grpc_library.bzl", "cc_grpc_library") +load("//:common.bzl", "use_new_compilers") + +#Copyright 2021 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +package( + default_visibility = ["//visibility:public"], + licenses = ["notice"], +) + +use_new_compilers() + +proto_library( + name = "mpls_proto", + srcs = ["mpls.proto"], + deps = ["//types:types_proto"], +) + +cc_proto_library( + name = "mpls_cc_proto", + deps = [":mpls_proto"], +) + +cc_grpc_library( + name = "mpls_cc_grpc_proto", + srcs = [":mpls_proto"], + grpc_only = True, + deps = [":mpls_cc_proto"], +) + +go_proto_library( + name = "mpls_go_proto", + compilers = [ + "go_protoc_gen_go", + "go_protoc_gen_go_grpc", + ], + importpath = "github.com/openconfig/gnoi/mpls", + proto = ":mpls_proto", + deps = ["//types"], +) + +go_library( + name = "mpls", + embed = [":mpls_go_proto"], + importpath = "github.com/openconfig/gnoi/mpls", +) diff --git a/src/sonic-framework/gnoi/mpls/mpls.pb.go b/src/sonic-framework/gnoi/mpls/mpls.pb.go new file mode 100644 index 000000000000..d87f09ce54ec --- /dev/null +++ b/src/sonic-framework/gnoi/mpls/mpls.pb.go @@ -0,0 +1,970 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.30.0 +// protoc v3.21.10 +// source: mpls/mpls.proto + +package mpls + +import ( + _ "github.com/openconfig/gnoi/types" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type ClearLSPRequest_Mode int32 + +const ( + ClearLSPRequest_DEFAULT ClearLSPRequest_Mode = 0 + ClearLSPRequest_NONAGGRESSIVE ClearLSPRequest_Mode = 0 + ClearLSPRequest_AGGRESSIVE ClearLSPRequest_Mode = 1 + ClearLSPRequest_RESET ClearLSPRequest_Mode = 2 + ClearLSPRequest_AUTOBW_AGGRESSIVE ClearLSPRequest_Mode = 3 + ClearLSPRequest_AUTOBW_NONAGGRESSIVE ClearLSPRequest_Mode = 4 +) + +// Enum value maps for ClearLSPRequest_Mode. +var ( + ClearLSPRequest_Mode_name = map[int32]string{ + 0: "DEFAULT", + // Duplicate value: 0: "NONAGGRESSIVE", + 1: "AGGRESSIVE", + 2: "RESET", + 3: "AUTOBW_AGGRESSIVE", + 4: "AUTOBW_NONAGGRESSIVE", + } + ClearLSPRequest_Mode_value = map[string]int32{ + "DEFAULT": 0, + "NONAGGRESSIVE": 0, + "AGGRESSIVE": 1, + "RESET": 2, + "AUTOBW_AGGRESSIVE": 3, + "AUTOBW_NONAGGRESSIVE": 4, + } +) + +func (x ClearLSPRequest_Mode) Enum() *ClearLSPRequest_Mode { + p := new(ClearLSPRequest_Mode) + *p = x + return p +} + +func (x ClearLSPRequest_Mode) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (ClearLSPRequest_Mode) Descriptor() protoreflect.EnumDescriptor { + return file_mpls_mpls_proto_enumTypes[0].Descriptor() +} + +func (ClearLSPRequest_Mode) Type() protoreflect.EnumType { + return &file_mpls_mpls_proto_enumTypes[0] +} + +func (x ClearLSPRequest_Mode) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use ClearLSPRequest_Mode.Descriptor instead. +func (ClearLSPRequest_Mode) EnumDescriptor() ([]byte, []int) { + return file_mpls_mpls_proto_rawDescGZIP(), []int{0, 0} +} + +type MPLSPingRequest_ReplyMode int32 + +const ( + MPLSPingRequest_IPV4 MPLSPingRequest_ReplyMode = 0 + MPLSPingRequest_ROUTER_ALERT MPLSPingRequest_ReplyMode = 1 +) + +// Enum value maps for MPLSPingRequest_ReplyMode. +var ( + MPLSPingRequest_ReplyMode_name = map[int32]string{ + 0: "IPV4", + 1: "ROUTER_ALERT", + } + MPLSPingRequest_ReplyMode_value = map[string]int32{ + "IPV4": 0, + "ROUTER_ALERT": 1, + } +) + +func (x MPLSPingRequest_ReplyMode) Enum() *MPLSPingRequest_ReplyMode { + p := new(MPLSPingRequest_ReplyMode) + *p = x + return p +} + +func (x MPLSPingRequest_ReplyMode) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (MPLSPingRequest_ReplyMode) Descriptor() protoreflect.EnumDescriptor { + return file_mpls_mpls_proto_enumTypes[1].Descriptor() +} + +func (MPLSPingRequest_ReplyMode) Type() protoreflect.EnumType { + return &file_mpls_mpls_proto_enumTypes[1] +} + +func (x MPLSPingRequest_ReplyMode) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use MPLSPingRequest_ReplyMode.Descriptor instead. +func (MPLSPingRequest_ReplyMode) EnumDescriptor() ([]byte, []int) { + return file_mpls_mpls_proto_rawDescGZIP(), []int{6, 0} +} + +type MPLSPingResponse_EchoResponseCode int32 + +const ( + MPLSPingResponse_SUCCESS MPLSPingResponse_EchoResponseCode = 0 + MPLSPingResponse_NOT_SENT MPLSPingResponse_EchoResponseCode = 1 + MPLSPingResponse_TIMEOUT MPLSPingResponse_EchoResponseCode = 2 +) + +// Enum value maps for MPLSPingResponse_EchoResponseCode. +var ( + MPLSPingResponse_EchoResponseCode_name = map[int32]string{ + 0: "SUCCESS", + 1: "NOT_SENT", + 2: "TIMEOUT", + } + MPLSPingResponse_EchoResponseCode_value = map[string]int32{ + "SUCCESS": 0, + "NOT_SENT": 1, + "TIMEOUT": 2, + } +) + +func (x MPLSPingResponse_EchoResponseCode) Enum() *MPLSPingResponse_EchoResponseCode { + p := new(MPLSPingResponse_EchoResponseCode) + *p = x + return p +} + +func (x MPLSPingResponse_EchoResponseCode) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (MPLSPingResponse_EchoResponseCode) Descriptor() protoreflect.EnumDescriptor { + return file_mpls_mpls_proto_enumTypes[2].Descriptor() +} + +func (MPLSPingResponse_EchoResponseCode) Type() protoreflect.EnumType { + return &file_mpls_mpls_proto_enumTypes[2] +} + +func (x MPLSPingResponse_EchoResponseCode) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use MPLSPingResponse_EchoResponseCode.Descriptor instead. +func (MPLSPingResponse_EchoResponseCode) EnumDescriptor() ([]byte, []int) { + return file_mpls_mpls_proto_rawDescGZIP(), []int{7, 0} +} + +type ClearLSPRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + Mode ClearLSPRequest_Mode `protobuf:"varint,3,opt,name=mode,proto3,enum=gnoi.mpls.ClearLSPRequest_Mode" json:"mode,omitempty"` +} + +func (x *ClearLSPRequest) Reset() { + *x = ClearLSPRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_mpls_mpls_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ClearLSPRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ClearLSPRequest) ProtoMessage() {} + +func (x *ClearLSPRequest) ProtoReflect() protoreflect.Message { + mi := &file_mpls_mpls_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ClearLSPRequest.ProtoReflect.Descriptor instead. +func (*ClearLSPRequest) Descriptor() ([]byte, []int) { + return file_mpls_mpls_proto_rawDescGZIP(), []int{0} +} + +func (x *ClearLSPRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *ClearLSPRequest) GetMode() ClearLSPRequest_Mode { + if x != nil { + return x.Mode + } + return ClearLSPRequest_DEFAULT +} + +type ClearLSPResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *ClearLSPResponse) Reset() { + *x = ClearLSPResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_mpls_mpls_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ClearLSPResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ClearLSPResponse) ProtoMessage() {} + +func (x *ClearLSPResponse) ProtoReflect() protoreflect.Message { + mi := &file_mpls_mpls_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ClearLSPResponse.ProtoReflect.Descriptor instead. +func (*ClearLSPResponse) Descriptor() ([]byte, []int) { + return file_mpls_mpls_proto_rawDescGZIP(), []int{1} +} + +type ClearLSPCountersRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` +} + +func (x *ClearLSPCountersRequest) Reset() { + *x = ClearLSPCountersRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_mpls_mpls_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ClearLSPCountersRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ClearLSPCountersRequest) ProtoMessage() {} + +func (x *ClearLSPCountersRequest) ProtoReflect() protoreflect.Message { + mi := &file_mpls_mpls_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ClearLSPCountersRequest.ProtoReflect.Descriptor instead. +func (*ClearLSPCountersRequest) Descriptor() ([]byte, []int) { + return file_mpls_mpls_proto_rawDescGZIP(), []int{2} +} + +func (x *ClearLSPCountersRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +type ClearLSPCountersResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *ClearLSPCountersResponse) Reset() { + *x = ClearLSPCountersResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_mpls_mpls_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ClearLSPCountersResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ClearLSPCountersResponse) ProtoMessage() {} + +func (x *ClearLSPCountersResponse) ProtoReflect() protoreflect.Message { + mi := &file_mpls_mpls_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ClearLSPCountersResponse.ProtoReflect.Descriptor instead. +func (*ClearLSPCountersResponse) Descriptor() ([]byte, []int) { + return file_mpls_mpls_proto_rawDescGZIP(), []int{3} +} + +type MPLSPingPWEDestination struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Eler string `protobuf:"bytes,1,opt,name=eler,proto3" json:"eler,omitempty"` + Vcid uint32 `protobuf:"varint,2,opt,name=vcid,proto3" json:"vcid,omitempty"` +} + +func (x *MPLSPingPWEDestination) Reset() { + *x = MPLSPingPWEDestination{} + if protoimpl.UnsafeEnabled { + mi := &file_mpls_mpls_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MPLSPingPWEDestination) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MPLSPingPWEDestination) ProtoMessage() {} + +func (x *MPLSPingPWEDestination) ProtoReflect() protoreflect.Message { + mi := &file_mpls_mpls_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MPLSPingPWEDestination.ProtoReflect.Descriptor instead. +func (*MPLSPingPWEDestination) Descriptor() ([]byte, []int) { + return file_mpls_mpls_proto_rawDescGZIP(), []int{4} +} + +func (x *MPLSPingPWEDestination) GetEler() string { + if x != nil { + return x.Eler + } + return "" +} + +func (x *MPLSPingPWEDestination) GetVcid() uint32 { + if x != nil { + return x.Vcid + } + return 0 +} + +type MPLSPingRSVPTEDestination struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Src string `protobuf:"bytes,1,opt,name=src,proto3" json:"src,omitempty"` + Dst string `protobuf:"bytes,2,opt,name=dst,proto3" json:"dst,omitempty"` + ExtendedTunnelId uint32 `protobuf:"varint,3,opt,name=extended_tunnel_id,json=extendedTunnelId,proto3" json:"extended_tunnel_id,omitempty"` +} + +func (x *MPLSPingRSVPTEDestination) Reset() { + *x = MPLSPingRSVPTEDestination{} + if protoimpl.UnsafeEnabled { + mi := &file_mpls_mpls_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MPLSPingRSVPTEDestination) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MPLSPingRSVPTEDestination) ProtoMessage() {} + +func (x *MPLSPingRSVPTEDestination) ProtoReflect() protoreflect.Message { + mi := &file_mpls_mpls_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MPLSPingRSVPTEDestination.ProtoReflect.Descriptor instead. +func (*MPLSPingRSVPTEDestination) Descriptor() ([]byte, []int) { + return file_mpls_mpls_proto_rawDescGZIP(), []int{5} +} + +func (x *MPLSPingRSVPTEDestination) GetSrc() string { + if x != nil { + return x.Src + } + return "" +} + +func (x *MPLSPingRSVPTEDestination) GetDst() string { + if x != nil { + return x.Dst + } + return "" +} + +func (x *MPLSPingRSVPTEDestination) GetExtendedTunnelId() uint32 { + if x != nil { + return x.ExtendedTunnelId + } + return 0 +} + +type MPLSPingRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Destination: + // + // *MPLSPingRequest_LdpFec + // *MPLSPingRequest_Fec129Pwe + // *MPLSPingRequest_RsvpteLspName + // *MPLSPingRequest_RsvpteLsp + Destination isMPLSPingRequest_Destination `protobuf_oneof:"destination"` + ReplyMode MPLSPingRequest_ReplyMode `protobuf:"varint,6,opt,name=reply_mode,json=replyMode,proto3,enum=gnoi.mpls.MPLSPingRequest_ReplyMode" json:"reply_mode,omitempty"` + Count uint32 `protobuf:"varint,7,opt,name=count,proto3" json:"count,omitempty"` + Size uint32 `protobuf:"varint,8,opt,name=size,proto3" json:"size,omitempty"` + SourceAddress string `protobuf:"bytes,9,opt,name=source_address,json=sourceAddress,proto3" json:"source_address,omitempty"` + MplsTtl uint32 `protobuf:"varint,10,opt,name=mpls_ttl,json=mplsTtl,proto3" json:"mpls_ttl,omitempty"` + TrafficClass uint32 `protobuf:"varint,11,opt,name=traffic_class,json=trafficClass,proto3" json:"traffic_class,omitempty"` +} + +func (x *MPLSPingRequest) Reset() { + *x = MPLSPingRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_mpls_mpls_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MPLSPingRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MPLSPingRequest) ProtoMessage() {} + +func (x *MPLSPingRequest) ProtoReflect() protoreflect.Message { + mi := &file_mpls_mpls_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MPLSPingRequest.ProtoReflect.Descriptor instead. +func (*MPLSPingRequest) Descriptor() ([]byte, []int) { + return file_mpls_mpls_proto_rawDescGZIP(), []int{6} +} + +func (m *MPLSPingRequest) GetDestination() isMPLSPingRequest_Destination { + if m != nil { + return m.Destination + } + return nil +} + +func (x *MPLSPingRequest) GetLdpFec() string { + if x, ok := x.GetDestination().(*MPLSPingRequest_LdpFec); ok { + return x.LdpFec + } + return "" +} + +func (x *MPLSPingRequest) GetFec129Pwe() *MPLSPingPWEDestination { + if x, ok := x.GetDestination().(*MPLSPingRequest_Fec129Pwe); ok { + return x.Fec129Pwe + } + return nil +} + +func (x *MPLSPingRequest) GetRsvpteLspName() string { + if x, ok := x.GetDestination().(*MPLSPingRequest_RsvpteLspName); ok { + return x.RsvpteLspName + } + return "" +} + +func (x *MPLSPingRequest) GetRsvpteLsp() *MPLSPingRSVPTEDestination { + if x, ok := x.GetDestination().(*MPLSPingRequest_RsvpteLsp); ok { + return x.RsvpteLsp + } + return nil +} + +func (x *MPLSPingRequest) GetReplyMode() MPLSPingRequest_ReplyMode { + if x != nil { + return x.ReplyMode + } + return MPLSPingRequest_IPV4 +} + +func (x *MPLSPingRequest) GetCount() uint32 { + if x != nil { + return x.Count + } + return 0 +} + +func (x *MPLSPingRequest) GetSize() uint32 { + if x != nil { + return x.Size + } + return 0 +} + +func (x *MPLSPingRequest) GetSourceAddress() string { + if x != nil { + return x.SourceAddress + } + return "" +} + +func (x *MPLSPingRequest) GetMplsTtl() uint32 { + if x != nil { + return x.MplsTtl + } + return 0 +} + +func (x *MPLSPingRequest) GetTrafficClass() uint32 { + if x != nil { + return x.TrafficClass + } + return 0 +} + +type isMPLSPingRequest_Destination interface { + isMPLSPingRequest_Destination() +} + +type MPLSPingRequest_LdpFec struct { + LdpFec string `protobuf:"bytes,1,opt,name=ldp_fec,json=ldpFec,proto3,oneof"` +} + +type MPLSPingRequest_Fec129Pwe struct { + Fec129Pwe *MPLSPingPWEDestination `protobuf:"bytes,2,opt,name=fec129_pwe,json=fec129Pwe,proto3,oneof"` +} + +type MPLSPingRequest_RsvpteLspName struct { + RsvpteLspName string `protobuf:"bytes,4,opt,name=rsvpte_lsp_name,json=rsvpteLspName,proto3,oneof"` +} + +type MPLSPingRequest_RsvpteLsp struct { + RsvpteLsp *MPLSPingRSVPTEDestination `protobuf:"bytes,5,opt,name=rsvpte_lsp,json=rsvpteLsp,proto3,oneof"` +} + +func (*MPLSPingRequest_LdpFec) isMPLSPingRequest_Destination() {} + +func (*MPLSPingRequest_Fec129Pwe) isMPLSPingRequest_Destination() {} + +func (*MPLSPingRequest_RsvpteLspName) isMPLSPingRequest_Destination() {} + +func (*MPLSPingRequest_RsvpteLsp) isMPLSPingRequest_Destination() {} + +type MPLSPingResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Seq uint32 `protobuf:"varint,1,opt,name=seq,proto3" json:"seq,omitempty"` + Response MPLSPingResponse_EchoResponseCode `protobuf:"varint,2,opt,name=response,proto3,enum=gnoi.mpls.MPLSPingResponse_EchoResponseCode" json:"response,omitempty"` + ResponseTime uint64 `protobuf:"varint,3,opt,name=response_time,json=responseTime,proto3" json:"response_time,omitempty"` +} + +func (x *MPLSPingResponse) Reset() { + *x = MPLSPingResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_mpls_mpls_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MPLSPingResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MPLSPingResponse) ProtoMessage() {} + +func (x *MPLSPingResponse) ProtoReflect() protoreflect.Message { + mi := &file_mpls_mpls_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MPLSPingResponse.ProtoReflect.Descriptor instead. +func (*MPLSPingResponse) Descriptor() ([]byte, []int) { + return file_mpls_mpls_proto_rawDescGZIP(), []int{7} +} + +func (x *MPLSPingResponse) GetSeq() uint32 { + if x != nil { + return x.Seq + } + return 0 +} + +func (x *MPLSPingResponse) GetResponse() MPLSPingResponse_EchoResponseCode { + if x != nil { + return x.Response + } + return MPLSPingResponse_SUCCESS +} + +func (x *MPLSPingResponse) GetResponseTime() uint64 { + if x != nil { + return x.ResponseTime + } + return 0 +} + +var File_mpls_mpls_proto protoreflect.FileDescriptor + +var file_mpls_mpls_proto_rawDesc = []byte{ + 0x0a, 0x0f, 0x6d, 0x70, 0x6c, 0x73, 0x2f, 0x6d, 0x70, 0x6c, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x12, 0x09, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x6d, 0x70, 0x6c, 0x73, 0x1a, 0x2c, 0x67, 0x69, + 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6f, 0x6e, + 0x66, 0x69, 0x67, 0x2f, 0x67, 0x6e, 0x6f, 0x69, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x74, + 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xd2, 0x01, 0x0a, 0x0f, 0x43, + 0x6c, 0x65, 0x61, 0x72, 0x4c, 0x53, 0x50, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, + 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x12, 0x33, 0x0a, 0x04, 0x6d, 0x6f, 0x64, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, + 0x32, 0x1f, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x6d, 0x70, 0x6c, 0x73, 0x2e, 0x43, 0x6c, 0x65, + 0x61, 0x72, 0x4c, 0x53, 0x50, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x6f, 0x64, + 0x65, 0x52, 0x04, 0x6d, 0x6f, 0x64, 0x65, 0x22, 0x76, 0x0a, 0x04, 0x4d, 0x6f, 0x64, 0x65, 0x12, + 0x0b, 0x0a, 0x07, 0x44, 0x45, 0x46, 0x41, 0x55, 0x4c, 0x54, 0x10, 0x00, 0x12, 0x11, 0x0a, 0x0d, + 0x4e, 0x4f, 0x4e, 0x41, 0x47, 0x47, 0x52, 0x45, 0x53, 0x53, 0x49, 0x56, 0x45, 0x10, 0x00, 0x12, + 0x0e, 0x0a, 0x0a, 0x41, 0x47, 0x47, 0x52, 0x45, 0x53, 0x53, 0x49, 0x56, 0x45, 0x10, 0x01, 0x12, + 0x09, 0x0a, 0x05, 0x52, 0x45, 0x53, 0x45, 0x54, 0x10, 0x02, 0x12, 0x15, 0x0a, 0x11, 0x41, 0x55, + 0x54, 0x4f, 0x42, 0x57, 0x5f, 0x41, 0x47, 0x47, 0x52, 0x45, 0x53, 0x53, 0x49, 0x56, 0x45, 0x10, + 0x03, 0x12, 0x18, 0x0a, 0x14, 0x41, 0x55, 0x54, 0x4f, 0x42, 0x57, 0x5f, 0x4e, 0x4f, 0x4e, 0x41, + 0x47, 0x47, 0x52, 0x45, 0x53, 0x53, 0x49, 0x56, 0x45, 0x10, 0x04, 0x1a, 0x02, 0x10, 0x01, 0x22, + 0x12, 0x0a, 0x10, 0x43, 0x6c, 0x65, 0x61, 0x72, 0x4c, 0x53, 0x50, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x2d, 0x0a, 0x17, 0x43, 0x6c, 0x65, 0x61, 0x72, 0x4c, 0x53, 0x50, 0x43, + 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, + 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x22, 0x1a, 0x0a, 0x18, 0x43, 0x6c, 0x65, 0x61, 0x72, 0x4c, 0x53, 0x50, 0x43, 0x6f, + 0x75, 0x6e, 0x74, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x40, + 0x0a, 0x16, 0x4d, 0x50, 0x4c, 0x53, 0x50, 0x69, 0x6e, 0x67, 0x50, 0x57, 0x45, 0x44, 0x65, 0x73, + 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x65, 0x6c, 0x65, 0x72, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x65, 0x6c, 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, + 0x76, 0x63, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x04, 0x76, 0x63, 0x69, 0x64, + 0x22, 0x6d, 0x0a, 0x19, 0x4d, 0x50, 0x4c, 0x53, 0x50, 0x69, 0x6e, 0x67, 0x52, 0x53, 0x56, 0x50, + 0x54, 0x45, 0x44, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x10, 0x0a, + 0x03, 0x73, 0x72, 0x63, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x73, 0x72, 0x63, 0x12, + 0x10, 0x0a, 0x03, 0x64, 0x73, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x64, 0x73, + 0x74, 0x12, 0x2c, 0x0a, 0x12, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x64, 0x5f, 0x74, 0x75, + 0x6e, 0x6e, 0x65, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x10, 0x65, + 0x78, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x64, 0x54, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x49, 0x64, 0x22, + 0xef, 0x03, 0x0a, 0x0f, 0x4d, 0x50, 0x4c, 0x53, 0x50, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x19, 0x0a, 0x07, 0x6c, 0x64, 0x70, 0x5f, 0x66, 0x65, 0x63, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x06, 0x6c, 0x64, 0x70, 0x46, 0x65, 0x63, 0x12, 0x42, + 0x0a, 0x0a, 0x66, 0x65, 0x63, 0x31, 0x32, 0x39, 0x5f, 0x70, 0x77, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x6d, 0x70, 0x6c, 0x73, 0x2e, 0x4d, + 0x50, 0x4c, 0x53, 0x50, 0x69, 0x6e, 0x67, 0x50, 0x57, 0x45, 0x44, 0x65, 0x73, 0x74, 0x69, 0x6e, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x09, 0x66, 0x65, 0x63, 0x31, 0x32, 0x39, 0x50, + 0x77, 0x65, 0x12, 0x28, 0x0a, 0x0f, 0x72, 0x73, 0x76, 0x70, 0x74, 0x65, 0x5f, 0x6c, 0x73, 0x70, + 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x0d, 0x72, + 0x73, 0x76, 0x70, 0x74, 0x65, 0x4c, 0x73, 0x70, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x45, 0x0a, 0x0a, + 0x72, 0x73, 0x76, 0x70, 0x74, 0x65, 0x5f, 0x6c, 0x73, 0x70, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x24, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x6d, 0x70, 0x6c, 0x73, 0x2e, 0x4d, 0x50, 0x4c, + 0x53, 0x50, 0x69, 0x6e, 0x67, 0x52, 0x53, 0x56, 0x50, 0x54, 0x45, 0x44, 0x65, 0x73, 0x74, 0x69, + 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x09, 0x72, 0x73, 0x76, 0x70, 0x74, 0x65, + 0x4c, 0x73, 0x70, 0x12, 0x43, 0x0a, 0x0a, 0x72, 0x65, 0x70, 0x6c, 0x79, 0x5f, 0x6d, 0x6f, 0x64, + 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x24, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x6d, + 0x70, 0x6c, 0x73, 0x2e, 0x4d, 0x50, 0x4c, 0x53, 0x50, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x2e, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x4d, 0x6f, 0x64, 0x65, 0x52, 0x09, 0x72, + 0x65, 0x70, 0x6c, 0x79, 0x4d, 0x6f, 0x64, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x12, + 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x04, 0x73, 0x69, + 0x7a, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x61, 0x64, 0x64, + 0x72, 0x65, 0x73, 0x73, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x19, 0x0a, 0x08, 0x6d, 0x70, 0x6c, + 0x73, 0x5f, 0x74, 0x74, 0x6c, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, 0x6d, 0x70, 0x6c, + 0x73, 0x54, 0x74, 0x6c, 0x12, 0x23, 0x0a, 0x0d, 0x74, 0x72, 0x61, 0x66, 0x66, 0x69, 0x63, 0x5f, + 0x63, 0x6c, 0x61, 0x73, 0x73, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0c, 0x74, 0x72, 0x61, + 0x66, 0x66, 0x69, 0x63, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x22, 0x27, 0x0a, 0x09, 0x52, 0x65, 0x70, + 0x6c, 0x79, 0x4d, 0x6f, 0x64, 0x65, 0x12, 0x08, 0x0a, 0x04, 0x49, 0x50, 0x56, 0x34, 0x10, 0x00, + 0x12, 0x10, 0x0a, 0x0c, 0x52, 0x4f, 0x55, 0x54, 0x45, 0x52, 0x5f, 0x41, 0x4c, 0x45, 0x52, 0x54, + 0x10, 0x01, 0x42, 0x0d, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x22, 0xcf, 0x01, 0x0a, 0x10, 0x4d, 0x50, 0x4c, 0x53, 0x50, 0x69, 0x6e, 0x67, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x73, 0x65, 0x71, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0d, 0x52, 0x03, 0x73, 0x65, 0x71, 0x12, 0x48, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2c, 0x2e, 0x67, 0x6e, 0x6f, + 0x69, 0x2e, 0x6d, 0x70, 0x6c, 0x73, 0x2e, 0x4d, 0x50, 0x4c, 0x53, 0x50, 0x69, 0x6e, 0x67, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x45, 0x63, 0x68, 0x6f, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x5f, 0x74, + 0x69, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0c, 0x72, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x22, 0x3a, 0x0a, 0x10, 0x45, 0x63, 0x68, 0x6f, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x53, + 0x55, 0x43, 0x43, 0x45, 0x53, 0x53, 0x10, 0x00, 0x12, 0x0c, 0x0a, 0x08, 0x4e, 0x4f, 0x54, 0x5f, + 0x53, 0x45, 0x4e, 0x54, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x54, 0x49, 0x4d, 0x45, 0x4f, 0x55, + 0x54, 0x10, 0x02, 0x32, 0xf5, 0x01, 0x0a, 0x04, 0x4d, 0x50, 0x4c, 0x53, 0x12, 0x45, 0x0a, 0x08, + 0x43, 0x6c, 0x65, 0x61, 0x72, 0x4c, 0x53, 0x50, 0x12, 0x1a, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, + 0x6d, 0x70, 0x6c, 0x73, 0x2e, 0x43, 0x6c, 0x65, 0x61, 0x72, 0x4c, 0x53, 0x50, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x6d, 0x70, 0x6c, 0x73, + 0x2e, 0x43, 0x6c, 0x65, 0x61, 0x72, 0x4c, 0x53, 0x50, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x00, 0x12, 0x5d, 0x0a, 0x10, 0x43, 0x6c, 0x65, 0x61, 0x72, 0x4c, 0x53, 0x50, 0x43, + 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x73, 0x12, 0x22, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x6d, + 0x70, 0x6c, 0x73, 0x2e, 0x43, 0x6c, 0x65, 0x61, 0x72, 0x4c, 0x53, 0x50, 0x43, 0x6f, 0x75, 0x6e, + 0x74, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x67, 0x6e, + 0x6f, 0x69, 0x2e, 0x6d, 0x70, 0x6c, 0x73, 0x2e, 0x43, 0x6c, 0x65, 0x61, 0x72, 0x4c, 0x53, 0x50, + 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x00, 0x12, 0x47, 0x0a, 0x08, 0x4d, 0x50, 0x4c, 0x53, 0x50, 0x69, 0x6e, 0x67, 0x12, 0x1a, + 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x6d, 0x70, 0x6c, 0x73, 0x2e, 0x4d, 0x50, 0x4c, 0x53, 0x50, + 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x67, 0x6e, 0x6f, + 0x69, 0x2e, 0x6d, 0x70, 0x6c, 0x73, 0x2e, 0x4d, 0x50, 0x4c, 0x53, 0x50, 0x69, 0x6e, 0x67, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x30, 0x01, 0x42, 0x29, 0xd2, 0x3e, 0x05, + 0x30, 0x2e, 0x31, 0x2e, 0x30, 0x5a, 0x1f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, + 0x6d, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x67, 0x6e, 0x6f, + 0x69, 0x2f, 0x6d, 0x70, 0x6c, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_mpls_mpls_proto_rawDescOnce sync.Once + file_mpls_mpls_proto_rawDescData = file_mpls_mpls_proto_rawDesc +) + +func file_mpls_mpls_proto_rawDescGZIP() []byte { + file_mpls_mpls_proto_rawDescOnce.Do(func() { + file_mpls_mpls_proto_rawDescData = protoimpl.X.CompressGZIP(file_mpls_mpls_proto_rawDescData) + }) + return file_mpls_mpls_proto_rawDescData +} + +var file_mpls_mpls_proto_enumTypes = make([]protoimpl.EnumInfo, 3) +var file_mpls_mpls_proto_msgTypes = make([]protoimpl.MessageInfo, 8) +var file_mpls_mpls_proto_goTypes = []interface{}{ + (ClearLSPRequest_Mode)(0), // 0: gnoi.mpls.ClearLSPRequest.Mode + (MPLSPingRequest_ReplyMode)(0), // 1: gnoi.mpls.MPLSPingRequest.ReplyMode + (MPLSPingResponse_EchoResponseCode)(0), // 2: gnoi.mpls.MPLSPingResponse.EchoResponseCode + (*ClearLSPRequest)(nil), // 3: gnoi.mpls.ClearLSPRequest + (*ClearLSPResponse)(nil), // 4: gnoi.mpls.ClearLSPResponse + (*ClearLSPCountersRequest)(nil), // 5: gnoi.mpls.ClearLSPCountersRequest + (*ClearLSPCountersResponse)(nil), // 6: gnoi.mpls.ClearLSPCountersResponse + (*MPLSPingPWEDestination)(nil), // 7: gnoi.mpls.MPLSPingPWEDestination + (*MPLSPingRSVPTEDestination)(nil), // 8: gnoi.mpls.MPLSPingRSVPTEDestination + (*MPLSPingRequest)(nil), // 9: gnoi.mpls.MPLSPingRequest + (*MPLSPingResponse)(nil), // 10: gnoi.mpls.MPLSPingResponse +} +var file_mpls_mpls_proto_depIdxs = []int32{ + 0, // 0: gnoi.mpls.ClearLSPRequest.mode:type_name -> gnoi.mpls.ClearLSPRequest.Mode + 7, // 1: gnoi.mpls.MPLSPingRequest.fec129_pwe:type_name -> gnoi.mpls.MPLSPingPWEDestination + 8, // 2: gnoi.mpls.MPLSPingRequest.rsvpte_lsp:type_name -> gnoi.mpls.MPLSPingRSVPTEDestination + 1, // 3: gnoi.mpls.MPLSPingRequest.reply_mode:type_name -> gnoi.mpls.MPLSPingRequest.ReplyMode + 2, // 4: gnoi.mpls.MPLSPingResponse.response:type_name -> gnoi.mpls.MPLSPingResponse.EchoResponseCode + 3, // 5: gnoi.mpls.MPLS.ClearLSP:input_type -> gnoi.mpls.ClearLSPRequest + 5, // 6: gnoi.mpls.MPLS.ClearLSPCounters:input_type -> gnoi.mpls.ClearLSPCountersRequest + 9, // 7: gnoi.mpls.MPLS.MPLSPing:input_type -> gnoi.mpls.MPLSPingRequest + 4, // 8: gnoi.mpls.MPLS.ClearLSP:output_type -> gnoi.mpls.ClearLSPResponse + 6, // 9: gnoi.mpls.MPLS.ClearLSPCounters:output_type -> gnoi.mpls.ClearLSPCountersResponse + 10, // 10: gnoi.mpls.MPLS.MPLSPing:output_type -> gnoi.mpls.MPLSPingResponse + 8, // [8:11] is the sub-list for method output_type + 5, // [5:8] is the sub-list for method input_type + 5, // [5:5] is the sub-list for extension type_name + 5, // [5:5] is the sub-list for extension extendee + 0, // [0:5] is the sub-list for field type_name +} + +func init() { file_mpls_mpls_proto_init() } +func file_mpls_mpls_proto_init() { + if File_mpls_mpls_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_mpls_mpls_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ClearLSPRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_mpls_mpls_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ClearLSPResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_mpls_mpls_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ClearLSPCountersRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_mpls_mpls_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ClearLSPCountersResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_mpls_mpls_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MPLSPingPWEDestination); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_mpls_mpls_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MPLSPingRSVPTEDestination); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_mpls_mpls_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MPLSPingRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_mpls_mpls_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MPLSPingResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_mpls_mpls_proto_msgTypes[6].OneofWrappers = []interface{}{ + (*MPLSPingRequest_LdpFec)(nil), + (*MPLSPingRequest_Fec129Pwe)(nil), + (*MPLSPingRequest_RsvpteLspName)(nil), + (*MPLSPingRequest_RsvpteLsp)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_mpls_mpls_proto_rawDesc, + NumEnums: 3, + NumMessages: 8, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_mpls_mpls_proto_goTypes, + DependencyIndexes: file_mpls_mpls_proto_depIdxs, + EnumInfos: file_mpls_mpls_proto_enumTypes, + MessageInfos: file_mpls_mpls_proto_msgTypes, + }.Build() + File_mpls_mpls_proto = out.File + file_mpls_mpls_proto_rawDesc = nil + file_mpls_mpls_proto_goTypes = nil + file_mpls_mpls_proto_depIdxs = nil +} diff --git a/src/sonic-framework/gnoi/mpls/mpls.proto b/src/sonic-framework/gnoi/mpls/mpls.proto new file mode 100644 index 000000000000..fe7136e57dff --- /dev/null +++ b/src/sonic-framework/gnoi/mpls/mpls.proto @@ -0,0 +1,159 @@ +// +// Copyright 2017 Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package gnoi.mpls; + +import "github.com/openconfig/gnoi/types/types.proto"; + +option go_package = "github.com/openconfig/gnoi/mpls"; + +option (types.gnoi_version) = "0.1.0"; + +service MPLS { + // ClearLSP clears a single tunnel (requests for it's route to be + // recalculated). + rpc ClearLSP(ClearLSPRequest) returns (ClearLSPResponse) {} + + // ClearLSPCounters will clear the MPLS counters for the provided LSP. + rpc ClearLSPCounters(ClearLSPCountersRequest) + returns (ClearLSPCountersResponse) {} + + // An MPLS ping, specified as per RFC4379. + rpc MPLSPing(MPLSPingRequest) returns (stream MPLSPingResponse) {} + +} + +// Request to clear a single tunnel on a target device. +message ClearLSPRequest { + string name = 2; // Name of the tunnel to clear. + Mode mode = 3; // Tunnel clearing mode. + + enum Mode { + option allow_alias = true; + DEFAULT = 0; // Same as NONAGGRESSIVE. + // Reoptimize the LSP using the current bandwidth. + NONAGGRESSIVE = 0; + // Reoptimize the LSP using the current bandwidth. Only use IGP metric in + // calcuation. + AGGRESSIVE = 1; + // Reset and restart all LSPs that originated from this routing device. + RESET = 2; + // Apply the highest bandwidth collected on a tunnel without waiting for + // the current application period to end. Only use IGP metric in + // calcuation. + AUTOBW_AGGRESSIVE = 3; + // Apply the highest bandwidth collected on a tunnel without waiting for + // the current application period to end. + AUTOBW_NONAGGRESSIVE = 4; + } +} + +message ClearLSPResponse { +} + +// Request to clear a single tunnel counters on a target device. +message ClearLSPCountersRequest { + string name = 2; // Name of the tunnel to clear. +} + +message ClearLSPCountersResponse { +} + + +message MPLSPingPWEDestination { + // The address of the egress LER that the MPLS ping should be sent on when + // destined to a PWE service. + string eler = 1; + // The virtual circuit ID for the PWE via which the ping should be sent. + uint32 vcid = 2; +} + +// MPLSPingRSVPTEDestination specifies the destination for an MPLS Ping in +// terms of an absolute specification of an RSVP-TE LSP. It can be used to +// identify an individual RSVP-TE session via which a ping should be sent. +message MPLSPingRSVPTEDestination { + // The IPv4 or IPv6 address used by the system initiating (acting as the + // head-end) of the RSVP-TE LSP. + string src = 1; + // The IPv4 or IPv6 address used by the system terminating (acting as the + // tail-end) of the RSVP-TE LSP. + string dst = 2; + // The extended tunnel ID of the RSVP-TE LSP, expressed as an unsigned, 32b + // integer. + uint32 extended_tunnel_id = 3; +} + +// MPLSPingRequest specifies the parameters that should be used as input from +// the client, to a system that is initiating an RFC4379 MPLS ping request. +message MPLSPingRequest { + // One field within the destination field should be specified to determine + // the destination of the LSP ping. + oneof destination { + // The LDP forwarding equivalence class that the ping should be sent to + // expressed as an IPv4 or IPv6 prefix. + string ldp_fec = 1; + // The FEC129 PWE to which the LSP ping should be sent. + MPLSPingPWEDestination fec129_pwe = 2; + // The name of an RSVP-TE LSP via which the ping should be sent. The system + // should locally resolve the name to a particular RSVP-TE session. + string rsvpte_lsp_name = 4; + // An exact specification of an RSVP-TE LSP to which the system should send + // an MPLS ping message. + MPLSPingRSVPTEDestination rsvpte_lsp = 5; + // TODO(robjs): L3VPN, BGP-LU destination types. See RFC4379. + } + enum ReplyMode { + // Reply via an IPv4 packet to this system. + IPV4 = 0; + // Reply with a labeled packet with the router alert bit set. + ROUTER_ALERT = 1; + } + // How the target LER should respond to the LSP ping. + ReplyMode reply_mode = 6; + // The number of MPLS echo request packets to send. + uint32 count = 7; // default=3 + // The size (in bytes) of each MPLS echo request packet. + uint32 size = 8; // default=64 + // The source IPv4 address that should be used in the request packet. + string source_address = 9; + // The MPLS TTL that should be set in the packets sent. + uint32 mpls_ttl = 10; + // The value of the traffic class (TC, formerly known as EXP) bits that + // should be set in the MPLS ping packets. + uint32 traffic_class = 11; +} + +// MPLSPingResponse (MPLSPong?) is sent from the target to the client based on +// each MPLS Echo Response packet it receives associated with an input MPLSPing +// RPC. +message MPLSPingResponse { + uint32 seq = 1; // The sequence number of the MPLS Echo Reply. + enum EchoResponseCode { + // A successful echo response was received. + SUCCESS = 0; + // The MPLS ping packet was not sent, for an unknown reason. + NOT_SENT = 1; + // The local system timed out waiting for an LSP ping response. + TIMEOUT = 2; + // TODO(robjs): Add additional error codes. + } + // The response that was received from the egress LER. + EchoResponseCode response = 2; + // The time (in nanoseconds) between transmission of the Echo Response, + // and the echo reply. + uint64 response_time = 3; +} diff --git a/src/sonic-framework/gnoi/mpls/mpls_grpc.pb.go b/src/sonic-framework/gnoi/mpls/mpls_grpc.pb.go new file mode 100755 index 000000000000..8d354e0f87b7 --- /dev/null +++ b/src/sonic-framework/gnoi/mpls/mpls_grpc.pb.go @@ -0,0 +1,205 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.2.0 +// - protoc v3.21.10 +// source: mpls/mpls.proto + +package mpls + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +// MPLSClient is the client API for MPLS service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type MPLSClient interface { + ClearLSP(ctx context.Context, in *ClearLSPRequest, opts ...grpc.CallOption) (*ClearLSPResponse, error) + ClearLSPCounters(ctx context.Context, in *ClearLSPCountersRequest, opts ...grpc.CallOption) (*ClearLSPCountersResponse, error) + MPLSPing(ctx context.Context, in *MPLSPingRequest, opts ...grpc.CallOption) (MPLS_MPLSPingClient, error) +} + +type mPLSClient struct { + cc grpc.ClientConnInterface +} + +func NewMPLSClient(cc grpc.ClientConnInterface) MPLSClient { + return &mPLSClient{cc} +} + +func (c *mPLSClient) ClearLSP(ctx context.Context, in *ClearLSPRequest, opts ...grpc.CallOption) (*ClearLSPResponse, error) { + out := new(ClearLSPResponse) + err := c.cc.Invoke(ctx, "/gnoi.mpls.MPLS/ClearLSP", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *mPLSClient) ClearLSPCounters(ctx context.Context, in *ClearLSPCountersRequest, opts ...grpc.CallOption) (*ClearLSPCountersResponse, error) { + out := new(ClearLSPCountersResponse) + err := c.cc.Invoke(ctx, "/gnoi.mpls.MPLS/ClearLSPCounters", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *mPLSClient) MPLSPing(ctx context.Context, in *MPLSPingRequest, opts ...grpc.CallOption) (MPLS_MPLSPingClient, error) { + stream, err := c.cc.NewStream(ctx, &MPLS_ServiceDesc.Streams[0], "/gnoi.mpls.MPLS/MPLSPing", opts...) + if err != nil { + return nil, err + } + x := &mPLSMPLSPingClient{stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +type MPLS_MPLSPingClient interface { + Recv() (*MPLSPingResponse, error) + grpc.ClientStream +} + +type mPLSMPLSPingClient struct { + grpc.ClientStream +} + +func (x *mPLSMPLSPingClient) Recv() (*MPLSPingResponse, error) { + m := new(MPLSPingResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +// MPLSServer is the server API for MPLS service. +// All implementations must embed UnimplementedMPLSServer +// for forward compatibility +type MPLSServer interface { + ClearLSP(context.Context, *ClearLSPRequest) (*ClearLSPResponse, error) + ClearLSPCounters(context.Context, *ClearLSPCountersRequest) (*ClearLSPCountersResponse, error) + MPLSPing(*MPLSPingRequest, MPLS_MPLSPingServer) error + mustEmbedUnimplementedMPLSServer() +} + +// UnimplementedMPLSServer must be embedded to have forward compatible implementations. +type UnimplementedMPLSServer struct { +} + +func (UnimplementedMPLSServer) ClearLSP(context.Context, *ClearLSPRequest) (*ClearLSPResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ClearLSP not implemented") +} +func (UnimplementedMPLSServer) ClearLSPCounters(context.Context, *ClearLSPCountersRequest) (*ClearLSPCountersResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ClearLSPCounters not implemented") +} +func (UnimplementedMPLSServer) MPLSPing(*MPLSPingRequest, MPLS_MPLSPingServer) error { + return status.Errorf(codes.Unimplemented, "method MPLSPing not implemented") +} +func (UnimplementedMPLSServer) mustEmbedUnimplementedMPLSServer() {} + +// UnsafeMPLSServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to MPLSServer will +// result in compilation errors. +type UnsafeMPLSServer interface { + mustEmbedUnimplementedMPLSServer() +} + +func RegisterMPLSServer(s grpc.ServiceRegistrar, srv MPLSServer) { + s.RegisterService(&MPLS_ServiceDesc, srv) +} + +func _MPLS_ClearLSP_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ClearLSPRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MPLSServer).ClearLSP(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/gnoi.mpls.MPLS/ClearLSP", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MPLSServer).ClearLSP(ctx, req.(*ClearLSPRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _MPLS_ClearLSPCounters_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ClearLSPCountersRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MPLSServer).ClearLSPCounters(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/gnoi.mpls.MPLS/ClearLSPCounters", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MPLSServer).ClearLSPCounters(ctx, req.(*ClearLSPCountersRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _MPLS_MPLSPing_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(MPLSPingRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(MPLSServer).MPLSPing(m, &mPLSMPLSPingServer{stream}) +} + +type MPLS_MPLSPingServer interface { + Send(*MPLSPingResponse) error + grpc.ServerStream +} + +type mPLSMPLSPingServer struct { + grpc.ServerStream +} + +func (x *mPLSMPLSPingServer) Send(m *MPLSPingResponse) error { + return x.ServerStream.SendMsg(m) +} + +// MPLS_ServiceDesc is the grpc.ServiceDesc for MPLS service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var MPLS_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "gnoi.mpls.MPLS", + HandlerType: (*MPLSServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "ClearLSP", + Handler: _MPLS_ClearLSP_Handler, + }, + { + MethodName: "ClearLSPCounters", + Handler: _MPLS_ClearLSPCounters_Handler, + }, + }, + Streams: []grpc.StreamDesc{ + { + StreamName: "MPLSPing", + Handler: _MPLS_MPLSPing_Handler, + ServerStreams: true, + }, + }, + Metadata: "mpls/mpls.proto", +} diff --git a/src/sonic-framework/gnoi/os/BUILD.bazel b/src/sonic-framework/gnoi/os/BUILD.bazel new file mode 100644 index 000000000000..fdca6f31c80d --- /dev/null +++ b/src/sonic-framework/gnoi/os/BUILD.bazel @@ -0,0 +1,61 @@ +load("@rules_proto//proto:defs.bzl", "proto_library") +load("@io_bazel_rules_go//go:def.bzl", "go_library") +load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library") +load("@com_github_grpc_grpc//bazel:cc_grpc_library.bzl", "cc_grpc_library") +load("//:common.bzl", "use_new_compilers") + +#Copyright 2021 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +package( + default_visibility = ["//visibility:public"], + licenses = ["notice"], +) + +use_new_compilers() + +proto_library( + name = "os_proto", + srcs = ["os.proto"], + deps = ["//types:types_proto"], +) + +cc_proto_library( + name = "os_cc_proto", + deps = [":os_proto"], +) + +cc_grpc_library( + name = "os_cc_grpc_proto", + srcs = [":os_proto"], + grpc_only = True, + deps = [":os_cc_proto"], +) + +go_proto_library( + name = "os_go_proto", + compilers = [ + "go_protoc_gen_go", + "go_protoc_gen_go_grpc", + ], + importpath = "github.com/openconfig/gnoi/os", + proto = ":os_proto", + deps = ["//types"], +) + +go_library( + name = "os", + embed = [":os_go_proto"], + importpath = "github.com/openconfig/gnoi/os", +) diff --git a/src/sonic-framework/gnoi/os/os.pb.go b/src/sonic-framework/gnoi/os/os.pb.go new file mode 100644 index 000000000000..66e80774ae95 --- /dev/null +++ b/src/sonic-framework/gnoi/os/os.pb.go @@ -0,0 +1,1793 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.30.0 +// protoc v3.21.10 +// source: os/os.proto + +package os + +import ( + _ "github.com/openconfig/gnoi/types" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type InstallError_Type int32 + +const ( + InstallError_UNSPECIFIED InstallError_Type = 0 + InstallError_INCOMPATIBLE InstallError_Type = 1 + InstallError_TOO_LARGE InstallError_Type = 2 + InstallError_PARSE_FAIL InstallError_Type = 3 + InstallError_INTEGRITY_FAIL InstallError_Type = 4 + InstallError_INSTALL_RUN_PACKAGE InstallError_Type = 5 + InstallError_INSTALL_IN_PROGRESS InstallError_Type = 6 + InstallError_UNEXPECTED_SWITCHOVER InstallError_Type = 7 + InstallError_SYNC_FAIL InstallError_Type = 8 + InstallError_NOT_SUPPORTED_ON_BACKUP InstallError_Type = 9 +) + +// Enum value maps for InstallError_Type. +var ( + InstallError_Type_name = map[int32]string{ + 0: "UNSPECIFIED", + 1: "INCOMPATIBLE", + 2: "TOO_LARGE", + 3: "PARSE_FAIL", + 4: "INTEGRITY_FAIL", + 5: "INSTALL_RUN_PACKAGE", + 6: "INSTALL_IN_PROGRESS", + 7: "UNEXPECTED_SWITCHOVER", + 8: "SYNC_FAIL", + 9: "NOT_SUPPORTED_ON_BACKUP", + } + InstallError_Type_value = map[string]int32{ + "UNSPECIFIED": 0, + "INCOMPATIBLE": 1, + "TOO_LARGE": 2, + "PARSE_FAIL": 3, + "INTEGRITY_FAIL": 4, + "INSTALL_RUN_PACKAGE": 5, + "INSTALL_IN_PROGRESS": 6, + "UNEXPECTED_SWITCHOVER": 7, + "SYNC_FAIL": 8, + "NOT_SUPPORTED_ON_BACKUP": 9, + } +) + +func (x InstallError_Type) Enum() *InstallError_Type { + p := new(InstallError_Type) + *p = x + return p +} + +func (x InstallError_Type) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (InstallError_Type) Descriptor() protoreflect.EnumDescriptor { + return file_os_os_proto_enumTypes[0].Descriptor() +} + +func (InstallError_Type) Type() protoreflect.EnumType { + return &file_os_os_proto_enumTypes[0] +} + +func (x InstallError_Type) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use InstallError_Type.Descriptor instead. +func (InstallError_Type) EnumDescriptor() ([]byte, []int) { + return file_os_os_proto_rawDescGZIP(), []int{8, 0} +} + +type ActivateError_Type int32 + +const ( + ActivateError_UNSPECIFIED ActivateError_Type = 0 + ActivateError_NON_EXISTENT_VERSION ActivateError_Type = 1 + ActivateError_NOT_SUPPORTED_ON_BACKUP ActivateError_Type = 2 +) + +// Enum value maps for ActivateError_Type. +var ( + ActivateError_Type_name = map[int32]string{ + 0: "UNSPECIFIED", + 1: "NON_EXISTENT_VERSION", + 2: "NOT_SUPPORTED_ON_BACKUP", + } + ActivateError_Type_value = map[string]int32{ + "UNSPECIFIED": 0, + "NON_EXISTENT_VERSION": 1, + "NOT_SUPPORTED_ON_BACKUP": 2, + } +) + +func (x ActivateError_Type) Enum() *ActivateError_Type { + p := new(ActivateError_Type) + *p = x + return p +} + +func (x ActivateError_Type) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (ActivateError_Type) Descriptor() protoreflect.EnumDescriptor { + return file_os_os_proto_enumTypes[1].Descriptor() +} + +func (ActivateError_Type) Type() protoreflect.EnumType { + return &file_os_os_proto_enumTypes[1] +} + +func (x ActivateError_Type) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use ActivateError_Type.Descriptor instead. +func (ActivateError_Type) EnumDescriptor() ([]byte, []int) { + return file_os_os_proto_rawDescGZIP(), []int{12, 0} +} + +type StandbyState_State int32 + +const ( + StandbyState_UNSPECIFIED StandbyState_State = 0 + StandbyState_UNSUPPORTED StandbyState_State = 1 + StandbyState_NON_EXISTENT StandbyState_State = 2 + StandbyState_UNAVAILABLE StandbyState_State = 3 +) + +// Enum value maps for StandbyState_State. +var ( + StandbyState_State_name = map[int32]string{ + 0: "UNSPECIFIED", + 1: "UNSUPPORTED", + 2: "NON_EXISTENT", + 3: "UNAVAILABLE", + } + StandbyState_State_value = map[string]int32{ + "UNSPECIFIED": 0, + "UNSUPPORTED": 1, + "NON_EXISTENT": 2, + "UNAVAILABLE": 3, + } +) + +func (x StandbyState_State) Enum() *StandbyState_State { + p := new(StandbyState_State) + *p = x + return p +} + +func (x StandbyState_State) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (StandbyState_State) Descriptor() protoreflect.EnumDescriptor { + return file_os_os_proto_enumTypes[2].Descriptor() +} + +func (StandbyState_State) Type() protoreflect.EnumType { + return &file_os_os_proto_enumTypes[2] +} + +func (x StandbyState_State) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use StandbyState_State.Descriptor instead. +func (StandbyState_State) EnumDescriptor() ([]byte, []int) { + return file_os_os_proto_rawDescGZIP(), []int{16, 0} +} + +type InstallRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Request: + // + // *InstallRequest_TransferRequest + // *InstallRequest_TransferContent + // *InstallRequest_TransferEnd + Request isInstallRequest_Request `protobuf_oneof:"request"` +} + +func (x *InstallRequest) Reset() { + *x = InstallRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_os_os_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *InstallRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*InstallRequest) ProtoMessage() {} + +func (x *InstallRequest) ProtoReflect() protoreflect.Message { + mi := &file_os_os_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use InstallRequest.ProtoReflect.Descriptor instead. +func (*InstallRequest) Descriptor() ([]byte, []int) { + return file_os_os_proto_rawDescGZIP(), []int{0} +} + +func (m *InstallRequest) GetRequest() isInstallRequest_Request { + if m != nil { + return m.Request + } + return nil +} + +func (x *InstallRequest) GetTransferRequest() *TransferRequest { + if x, ok := x.GetRequest().(*InstallRequest_TransferRequest); ok { + return x.TransferRequest + } + return nil +} + +func (x *InstallRequest) GetTransferContent() []byte { + if x, ok := x.GetRequest().(*InstallRequest_TransferContent); ok { + return x.TransferContent + } + return nil +} + +func (x *InstallRequest) GetTransferEnd() *TransferEnd { + if x, ok := x.GetRequest().(*InstallRequest_TransferEnd); ok { + return x.TransferEnd + } + return nil +} + +type isInstallRequest_Request interface { + isInstallRequest_Request() +} + +type InstallRequest_TransferRequest struct { + TransferRequest *TransferRequest `protobuf:"bytes,1,opt,name=transfer_request,json=transferRequest,proto3,oneof"` +} + +type InstallRequest_TransferContent struct { + TransferContent []byte `protobuf:"bytes,2,opt,name=transfer_content,json=transferContent,proto3,oneof"` +} + +type InstallRequest_TransferEnd struct { + TransferEnd *TransferEnd `protobuf:"bytes,3,opt,name=transfer_end,json=transferEnd,proto3,oneof"` +} + +func (*InstallRequest_TransferRequest) isInstallRequest_Request() {} + +func (*InstallRequest_TransferContent) isInstallRequest_Request() {} + +func (*InstallRequest_TransferEnd) isInstallRequest_Request() {} + +type TransferRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Version string `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"` + StandbySupervisor bool `protobuf:"varint,2,opt,name=standby_supervisor,json=standbySupervisor,proto3" json:"standby_supervisor,omitempty"` + PackageSize uint64 `protobuf:"varint,3,opt,name=package_size,json=packageSize,proto3" json:"package_size,omitempty"` +} + +func (x *TransferRequest) Reset() { + *x = TransferRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_os_os_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TransferRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TransferRequest) ProtoMessage() {} + +func (x *TransferRequest) ProtoReflect() protoreflect.Message { + mi := &file_os_os_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TransferRequest.ProtoReflect.Descriptor instead. +func (*TransferRequest) Descriptor() ([]byte, []int) { + return file_os_os_proto_rawDescGZIP(), []int{1} +} + +func (x *TransferRequest) GetVersion() string { + if x != nil { + return x.Version + } + return "" +} + +func (x *TransferRequest) GetStandbySupervisor() bool { + if x != nil { + return x.StandbySupervisor + } + return false +} + +func (x *TransferRequest) GetPackageSize() uint64 { + if x != nil { + return x.PackageSize + } + return 0 +} + +type TransferEnd struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *TransferEnd) Reset() { + *x = TransferEnd{} + if protoimpl.UnsafeEnabled { + mi := &file_os_os_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TransferEnd) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TransferEnd) ProtoMessage() {} + +func (x *TransferEnd) ProtoReflect() protoreflect.Message { + mi := &file_os_os_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TransferEnd.ProtoReflect.Descriptor instead. +func (*TransferEnd) Descriptor() ([]byte, []int) { + return file_os_os_proto_rawDescGZIP(), []int{2} +} + +type InstallResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Response: + // + // *InstallResponse_TransferReady + // *InstallResponse_TransferProgress + // *InstallResponse_SyncProgress + // *InstallResponse_Validated + // *InstallResponse_InstallError + Response isInstallResponse_Response `protobuf_oneof:"response"` +} + +func (x *InstallResponse) Reset() { + *x = InstallResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_os_os_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *InstallResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*InstallResponse) ProtoMessage() {} + +func (x *InstallResponse) ProtoReflect() protoreflect.Message { + mi := &file_os_os_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use InstallResponse.ProtoReflect.Descriptor instead. +func (*InstallResponse) Descriptor() ([]byte, []int) { + return file_os_os_proto_rawDescGZIP(), []int{3} +} + +func (m *InstallResponse) GetResponse() isInstallResponse_Response { + if m != nil { + return m.Response + } + return nil +} + +func (x *InstallResponse) GetTransferReady() *TransferReady { + if x, ok := x.GetResponse().(*InstallResponse_TransferReady); ok { + return x.TransferReady + } + return nil +} + +func (x *InstallResponse) GetTransferProgress() *TransferProgress { + if x, ok := x.GetResponse().(*InstallResponse_TransferProgress); ok { + return x.TransferProgress + } + return nil +} + +func (x *InstallResponse) GetSyncProgress() *SyncProgress { + if x, ok := x.GetResponse().(*InstallResponse_SyncProgress); ok { + return x.SyncProgress + } + return nil +} + +func (x *InstallResponse) GetValidated() *Validated { + if x, ok := x.GetResponse().(*InstallResponse_Validated); ok { + return x.Validated + } + return nil +} + +func (x *InstallResponse) GetInstallError() *InstallError { + if x, ok := x.GetResponse().(*InstallResponse_InstallError); ok { + return x.InstallError + } + return nil +} + +type isInstallResponse_Response interface { + isInstallResponse_Response() +} + +type InstallResponse_TransferReady struct { + TransferReady *TransferReady `protobuf:"bytes,1,opt,name=transfer_ready,json=transferReady,proto3,oneof"` +} + +type InstallResponse_TransferProgress struct { + TransferProgress *TransferProgress `protobuf:"bytes,2,opt,name=transfer_progress,json=transferProgress,proto3,oneof"` +} + +type InstallResponse_SyncProgress struct { + SyncProgress *SyncProgress `protobuf:"bytes,3,opt,name=sync_progress,json=syncProgress,proto3,oneof"` +} + +type InstallResponse_Validated struct { + Validated *Validated `protobuf:"bytes,4,opt,name=validated,proto3,oneof"` +} + +type InstallResponse_InstallError struct { + InstallError *InstallError `protobuf:"bytes,5,opt,name=install_error,json=installError,proto3,oneof"` +} + +func (*InstallResponse_TransferReady) isInstallResponse_Response() {} + +func (*InstallResponse_TransferProgress) isInstallResponse_Response() {} + +func (*InstallResponse_SyncProgress) isInstallResponse_Response() {} + +func (*InstallResponse_Validated) isInstallResponse_Response() {} + +func (*InstallResponse_InstallError) isInstallResponse_Response() {} + +type TransferReady struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *TransferReady) Reset() { + *x = TransferReady{} + if protoimpl.UnsafeEnabled { + mi := &file_os_os_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TransferReady) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TransferReady) ProtoMessage() {} + +func (x *TransferReady) ProtoReflect() protoreflect.Message { + mi := &file_os_os_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TransferReady.ProtoReflect.Descriptor instead. +func (*TransferReady) Descriptor() ([]byte, []int) { + return file_os_os_proto_rawDescGZIP(), []int{4} +} + +type TransferProgress struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + BytesReceived uint64 `protobuf:"varint,1,opt,name=bytes_received,json=bytesReceived,proto3" json:"bytes_received,omitempty"` +} + +func (x *TransferProgress) Reset() { + *x = TransferProgress{} + if protoimpl.UnsafeEnabled { + mi := &file_os_os_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TransferProgress) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TransferProgress) ProtoMessage() {} + +func (x *TransferProgress) ProtoReflect() protoreflect.Message { + mi := &file_os_os_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TransferProgress.ProtoReflect.Descriptor instead. +func (*TransferProgress) Descriptor() ([]byte, []int) { + return file_os_os_proto_rawDescGZIP(), []int{5} +} + +func (x *TransferProgress) GetBytesReceived() uint64 { + if x != nil { + return x.BytesReceived + } + return 0 +} + +type SyncProgress struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + PercentageTransferred uint32 `protobuf:"varint,1,opt,name=percentage_transferred,json=percentageTransferred,proto3" json:"percentage_transferred,omitempty"` +} + +func (x *SyncProgress) Reset() { + *x = SyncProgress{} + if protoimpl.UnsafeEnabled { + mi := &file_os_os_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SyncProgress) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SyncProgress) ProtoMessage() {} + +func (x *SyncProgress) ProtoReflect() protoreflect.Message { + mi := &file_os_os_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SyncProgress.ProtoReflect.Descriptor instead. +func (*SyncProgress) Descriptor() ([]byte, []int) { + return file_os_os_proto_rawDescGZIP(), []int{6} +} + +func (x *SyncProgress) GetPercentageTransferred() uint32 { + if x != nil { + return x.PercentageTransferred + } + return 0 +} + +type Validated struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Version string `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"` + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` +} + +func (x *Validated) Reset() { + *x = Validated{} + if protoimpl.UnsafeEnabled { + mi := &file_os_os_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Validated) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Validated) ProtoMessage() {} + +func (x *Validated) ProtoReflect() protoreflect.Message { + mi := &file_os_os_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Validated.ProtoReflect.Descriptor instead. +func (*Validated) Descriptor() ([]byte, []int) { + return file_os_os_proto_rawDescGZIP(), []int{7} +} + +func (x *Validated) GetVersion() string { + if x != nil { + return x.Version + } + return "" +} + +func (x *Validated) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +type InstallError struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Type InstallError_Type `protobuf:"varint,1,opt,name=type,proto3,enum=gnoi.os.InstallError_Type" json:"type,omitempty"` + Detail string `protobuf:"bytes,2,opt,name=detail,proto3" json:"detail,omitempty"` +} + +func (x *InstallError) Reset() { + *x = InstallError{} + if protoimpl.UnsafeEnabled { + mi := &file_os_os_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *InstallError) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*InstallError) ProtoMessage() {} + +func (x *InstallError) ProtoReflect() protoreflect.Message { + mi := &file_os_os_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use InstallError.ProtoReflect.Descriptor instead. +func (*InstallError) Descriptor() ([]byte, []int) { + return file_os_os_proto_rawDescGZIP(), []int{8} +} + +func (x *InstallError) GetType() InstallError_Type { + if x != nil { + return x.Type + } + return InstallError_UNSPECIFIED +} + +func (x *InstallError) GetDetail() string { + if x != nil { + return x.Detail + } + return "" +} + +type ActivateRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Version string `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"` + StandbySupervisor bool `protobuf:"varint,2,opt,name=standby_supervisor,json=standbySupervisor,proto3" json:"standby_supervisor,omitempty"` + NoReboot bool `protobuf:"varint,3,opt,name=no_reboot,json=noReboot,proto3" json:"no_reboot,omitempty"` +} + +func (x *ActivateRequest) Reset() { + *x = ActivateRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_os_os_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ActivateRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ActivateRequest) ProtoMessage() {} + +func (x *ActivateRequest) ProtoReflect() protoreflect.Message { + mi := &file_os_os_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ActivateRequest.ProtoReflect.Descriptor instead. +func (*ActivateRequest) Descriptor() ([]byte, []int) { + return file_os_os_proto_rawDescGZIP(), []int{9} +} + +func (x *ActivateRequest) GetVersion() string { + if x != nil { + return x.Version + } + return "" +} + +func (x *ActivateRequest) GetStandbySupervisor() bool { + if x != nil { + return x.StandbySupervisor + } + return false +} + +func (x *ActivateRequest) GetNoReboot() bool { + if x != nil { + return x.NoReboot + } + return false +} + +type ActivateResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Response: + // + // *ActivateResponse_ActivateOk + // *ActivateResponse_ActivateError + Response isActivateResponse_Response `protobuf_oneof:"response"` +} + +func (x *ActivateResponse) Reset() { + *x = ActivateResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_os_os_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ActivateResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ActivateResponse) ProtoMessage() {} + +func (x *ActivateResponse) ProtoReflect() protoreflect.Message { + mi := &file_os_os_proto_msgTypes[10] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ActivateResponse.ProtoReflect.Descriptor instead. +func (*ActivateResponse) Descriptor() ([]byte, []int) { + return file_os_os_proto_rawDescGZIP(), []int{10} +} + +func (m *ActivateResponse) GetResponse() isActivateResponse_Response { + if m != nil { + return m.Response + } + return nil +} + +func (x *ActivateResponse) GetActivateOk() *ActivateOK { + if x, ok := x.GetResponse().(*ActivateResponse_ActivateOk); ok { + return x.ActivateOk + } + return nil +} + +func (x *ActivateResponse) GetActivateError() *ActivateError { + if x, ok := x.GetResponse().(*ActivateResponse_ActivateError); ok { + return x.ActivateError + } + return nil +} + +type isActivateResponse_Response interface { + isActivateResponse_Response() +} + +type ActivateResponse_ActivateOk struct { + ActivateOk *ActivateOK `protobuf:"bytes,1,opt,name=activate_ok,json=activateOk,proto3,oneof"` +} + +type ActivateResponse_ActivateError struct { + ActivateError *ActivateError `protobuf:"bytes,2,opt,name=activate_error,json=activateError,proto3,oneof"` +} + +func (*ActivateResponse_ActivateOk) isActivateResponse_Response() {} + +func (*ActivateResponse_ActivateError) isActivateResponse_Response() {} + +type ActivateOK struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *ActivateOK) Reset() { + *x = ActivateOK{} + if protoimpl.UnsafeEnabled { + mi := &file_os_os_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ActivateOK) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ActivateOK) ProtoMessage() {} + +func (x *ActivateOK) ProtoReflect() protoreflect.Message { + mi := &file_os_os_proto_msgTypes[11] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ActivateOK.ProtoReflect.Descriptor instead. +func (*ActivateOK) Descriptor() ([]byte, []int) { + return file_os_os_proto_rawDescGZIP(), []int{11} +} + +type ActivateError struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Type ActivateError_Type `protobuf:"varint,1,opt,name=type,proto3,enum=gnoi.os.ActivateError_Type" json:"type,omitempty"` + Detail string `protobuf:"bytes,2,opt,name=detail,proto3" json:"detail,omitempty"` +} + +func (x *ActivateError) Reset() { + *x = ActivateError{} + if protoimpl.UnsafeEnabled { + mi := &file_os_os_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ActivateError) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ActivateError) ProtoMessage() {} + +func (x *ActivateError) ProtoReflect() protoreflect.Message { + mi := &file_os_os_proto_msgTypes[12] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ActivateError.ProtoReflect.Descriptor instead. +func (*ActivateError) Descriptor() ([]byte, []int) { + return file_os_os_proto_rawDescGZIP(), []int{12} +} + +func (x *ActivateError) GetType() ActivateError_Type { + if x != nil { + return x.Type + } + return ActivateError_UNSPECIFIED +} + +func (x *ActivateError) GetDetail() string { + if x != nil { + return x.Detail + } + return "" +} + +type VerifyRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *VerifyRequest) Reset() { + *x = VerifyRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_os_os_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *VerifyRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*VerifyRequest) ProtoMessage() {} + +func (x *VerifyRequest) ProtoReflect() protoreflect.Message { + mi := &file_os_os_proto_msgTypes[13] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use VerifyRequest.ProtoReflect.Descriptor instead. +func (*VerifyRequest) Descriptor() ([]byte, []int) { + return file_os_os_proto_rawDescGZIP(), []int{13} +} + +type VerifyResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Version string `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"` + ActivationFailMessage string `protobuf:"bytes,2,opt,name=activation_fail_message,json=activationFailMessage,proto3" json:"activation_fail_message,omitempty"` + VerifyStandby *VerifyStandby `protobuf:"bytes,3,opt,name=verify_standby,json=verifyStandby,proto3" json:"verify_standby,omitempty"` + IndividualSupervisorInstall bool `protobuf:"varint,4,opt,name=individual_supervisor_install,json=individualSupervisorInstall,proto3" json:"individual_supervisor_install,omitempty"` +} + +func (x *VerifyResponse) Reset() { + *x = VerifyResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_os_os_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *VerifyResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*VerifyResponse) ProtoMessage() {} + +func (x *VerifyResponse) ProtoReflect() protoreflect.Message { + mi := &file_os_os_proto_msgTypes[14] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use VerifyResponse.ProtoReflect.Descriptor instead. +func (*VerifyResponse) Descriptor() ([]byte, []int) { + return file_os_os_proto_rawDescGZIP(), []int{14} +} + +func (x *VerifyResponse) GetVersion() string { + if x != nil { + return x.Version + } + return "" +} + +func (x *VerifyResponse) GetActivationFailMessage() string { + if x != nil { + return x.ActivationFailMessage + } + return "" +} + +func (x *VerifyResponse) GetVerifyStandby() *VerifyStandby { + if x != nil { + return x.VerifyStandby + } + return nil +} + +func (x *VerifyResponse) GetIndividualSupervisorInstall() bool { + if x != nil { + return x.IndividualSupervisorInstall + } + return false +} + +type VerifyStandby struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to State: + // + // *VerifyStandby_StandbyState + // *VerifyStandby_VerifyResponse + State isVerifyStandby_State `protobuf_oneof:"state"` +} + +func (x *VerifyStandby) Reset() { + *x = VerifyStandby{} + if protoimpl.UnsafeEnabled { + mi := &file_os_os_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *VerifyStandby) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*VerifyStandby) ProtoMessage() {} + +func (x *VerifyStandby) ProtoReflect() protoreflect.Message { + mi := &file_os_os_proto_msgTypes[15] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use VerifyStandby.ProtoReflect.Descriptor instead. +func (*VerifyStandby) Descriptor() ([]byte, []int) { + return file_os_os_proto_rawDescGZIP(), []int{15} +} + +func (m *VerifyStandby) GetState() isVerifyStandby_State { + if m != nil { + return m.State + } + return nil +} + +func (x *VerifyStandby) GetStandbyState() *StandbyState { + if x, ok := x.GetState().(*VerifyStandby_StandbyState); ok { + return x.StandbyState + } + return nil +} + +func (x *VerifyStandby) GetVerifyResponse() *StandbyResponse { + if x, ok := x.GetState().(*VerifyStandby_VerifyResponse); ok { + return x.VerifyResponse + } + return nil +} + +type isVerifyStandby_State interface { + isVerifyStandby_State() +} + +type VerifyStandby_StandbyState struct { + StandbyState *StandbyState `protobuf:"bytes,1,opt,name=standby_state,json=standbyState,proto3,oneof"` +} + +type VerifyStandby_VerifyResponse struct { + VerifyResponse *StandbyResponse `protobuf:"bytes,2,opt,name=verify_response,json=verifyResponse,proto3,oneof"` +} + +func (*VerifyStandby_StandbyState) isVerifyStandby_State() {} + +func (*VerifyStandby_VerifyResponse) isVerifyStandby_State() {} + +type StandbyState struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + State StandbyState_State `protobuf:"varint,1,opt,name=state,proto3,enum=gnoi.os.StandbyState_State" json:"state,omitempty"` +} + +func (x *StandbyState) Reset() { + *x = StandbyState{} + if protoimpl.UnsafeEnabled { + mi := &file_os_os_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StandbyState) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StandbyState) ProtoMessage() {} + +func (x *StandbyState) ProtoReflect() protoreflect.Message { + mi := &file_os_os_proto_msgTypes[16] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use StandbyState.ProtoReflect.Descriptor instead. +func (*StandbyState) Descriptor() ([]byte, []int) { + return file_os_os_proto_rawDescGZIP(), []int{16} +} + +func (x *StandbyState) GetState() StandbyState_State { + if x != nil { + return x.State + } + return StandbyState_UNSPECIFIED +} + +type StandbyResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` + ActivationFailMessage string `protobuf:"bytes,3,opt,name=activation_fail_message,json=activationFailMessage,proto3" json:"activation_fail_message,omitempty"` +} + +func (x *StandbyResponse) Reset() { + *x = StandbyResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_os_os_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StandbyResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StandbyResponse) ProtoMessage() {} + +func (x *StandbyResponse) ProtoReflect() protoreflect.Message { + mi := &file_os_os_proto_msgTypes[17] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use StandbyResponse.ProtoReflect.Descriptor instead. +func (*StandbyResponse) Descriptor() ([]byte, []int) { + return file_os_os_proto_rawDescGZIP(), []int{17} +} + +func (x *StandbyResponse) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *StandbyResponse) GetVersion() string { + if x != nil { + return x.Version + } + return "" +} + +func (x *StandbyResponse) GetActivationFailMessage() string { + if x != nil { + return x.ActivationFailMessage + } + return "" +} + +var File_os_os_proto protoreflect.FileDescriptor + +var file_os_os_proto_rawDesc = []byte{ + 0x0a, 0x0b, 0x6f, 0x73, 0x2f, 0x6f, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x07, 0x67, + 0x6e, 0x6f, 0x69, 0x2e, 0x6f, 0x73, 0x1a, 0x2c, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, + 0x6f, 0x6d, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x67, 0x6e, + 0x6f, 0x69, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xca, 0x01, 0x0a, 0x0e, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x45, 0x0a, 0x10, 0x74, 0x72, 0x61, 0x6e, 0x73, + 0x66, 0x65, 0x72, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x18, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x6f, 0x73, 0x2e, 0x54, 0x72, 0x61, 0x6e, + 0x73, 0x66, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x0f, 0x74, + 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2b, + 0x0a, 0x10, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, + 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x48, 0x00, 0x52, 0x0f, 0x74, 0x72, 0x61, 0x6e, + 0x73, 0x66, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x39, 0x0a, 0x0c, 0x74, + 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x5f, 0x65, 0x6e, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x6f, 0x73, 0x2e, 0x54, 0x72, 0x61, 0x6e, + 0x73, 0x66, 0x65, 0x72, 0x45, 0x6e, 0x64, 0x48, 0x00, 0x52, 0x0b, 0x74, 0x72, 0x61, 0x6e, 0x73, + 0x66, 0x65, 0x72, 0x45, 0x6e, 0x64, 0x42, 0x09, 0x0a, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x22, 0x7d, 0x0a, 0x0f, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x2d, + 0x0a, 0x12, 0x73, 0x74, 0x61, 0x6e, 0x64, 0x62, 0x79, 0x5f, 0x73, 0x75, 0x70, 0x65, 0x72, 0x76, + 0x69, 0x73, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x11, 0x73, 0x74, 0x61, 0x6e, + 0x64, 0x62, 0x79, 0x53, 0x75, 0x70, 0x65, 0x72, 0x76, 0x69, 0x73, 0x6f, 0x72, 0x12, 0x21, 0x0a, + 0x0c, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x04, 0x52, 0x0b, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, + 0x22, 0x0d, 0x0a, 0x0b, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x45, 0x6e, 0x64, 0x22, + 0xd8, 0x02, 0x0a, 0x0f, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x3f, 0x0a, 0x0e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x5f, + 0x72, 0x65, 0x61, 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x67, 0x6e, + 0x6f, 0x69, 0x2e, 0x6f, 0x73, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x52, 0x65, + 0x61, 0x64, 0x79, 0x48, 0x00, 0x52, 0x0d, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x52, + 0x65, 0x61, 0x64, 0x79, 0x12, 0x48, 0x0a, 0x11, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, + 0x5f, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x19, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x6f, 0x73, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, + 0x65, 0x72, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x48, 0x00, 0x52, 0x10, 0x74, 0x72, + 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x12, 0x3c, + 0x0a, 0x0d, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x6f, 0x73, 0x2e, + 0x53, 0x79, 0x6e, 0x63, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x48, 0x00, 0x52, 0x0c, + 0x73, 0x79, 0x6e, 0x63, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x12, 0x32, 0x0a, 0x09, + 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x12, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x6f, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, + 0x74, 0x65, 0x64, 0x48, 0x00, 0x52, 0x09, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x64, + 0x12, 0x3c, 0x0a, 0x0d, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x5f, 0x65, 0x72, 0x72, 0x6f, + 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x6f, + 0x73, 0x2e, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x48, 0x00, + 0x52, 0x0c, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x42, 0x0a, + 0x0a, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x0f, 0x0a, 0x0d, 0x54, 0x72, + 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x52, 0x65, 0x61, 0x64, 0x79, 0x22, 0x39, 0x0a, 0x10, 0x54, + 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x12, + 0x25, 0x0a, 0x0e, 0x62, 0x79, 0x74, 0x65, 0x73, 0x5f, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0d, 0x62, 0x79, 0x74, 0x65, 0x73, 0x52, 0x65, + 0x63, 0x65, 0x69, 0x76, 0x65, 0x64, 0x22, 0x45, 0x0a, 0x0c, 0x53, 0x79, 0x6e, 0x63, 0x50, 0x72, + 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x12, 0x35, 0x0a, 0x16, 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, + 0x74, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x72, 0x65, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x15, 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x61, + 0x67, 0x65, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x72, 0x65, 0x64, 0x22, 0x47, 0x0a, + 0x09, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, + 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, + 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, + 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, + 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0xae, 0x02, 0x0a, 0x0c, 0x49, 0x6e, 0x73, 0x74, 0x61, + 0x6c, 0x6c, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x2e, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1a, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x6f, 0x73, 0x2e, + 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x2e, 0x54, 0x79, 0x70, + 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x64, 0x65, 0x74, 0x61, 0x69, + 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x22, + 0xd5, 0x01, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0f, 0x0a, 0x0b, 0x55, 0x4e, 0x53, 0x50, + 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x10, 0x0a, 0x0c, 0x49, 0x4e, 0x43, + 0x4f, 0x4d, 0x50, 0x41, 0x54, 0x49, 0x42, 0x4c, 0x45, 0x10, 0x01, 0x12, 0x0d, 0x0a, 0x09, 0x54, + 0x4f, 0x4f, 0x5f, 0x4c, 0x41, 0x52, 0x47, 0x45, 0x10, 0x02, 0x12, 0x0e, 0x0a, 0x0a, 0x50, 0x41, + 0x52, 0x53, 0x45, 0x5f, 0x46, 0x41, 0x49, 0x4c, 0x10, 0x03, 0x12, 0x12, 0x0a, 0x0e, 0x49, 0x4e, + 0x54, 0x45, 0x47, 0x52, 0x49, 0x54, 0x59, 0x5f, 0x46, 0x41, 0x49, 0x4c, 0x10, 0x04, 0x12, 0x17, + 0x0a, 0x13, 0x49, 0x4e, 0x53, 0x54, 0x41, 0x4c, 0x4c, 0x5f, 0x52, 0x55, 0x4e, 0x5f, 0x50, 0x41, + 0x43, 0x4b, 0x41, 0x47, 0x45, 0x10, 0x05, 0x12, 0x17, 0x0a, 0x13, 0x49, 0x4e, 0x53, 0x54, 0x41, + 0x4c, 0x4c, 0x5f, 0x49, 0x4e, 0x5f, 0x50, 0x52, 0x4f, 0x47, 0x52, 0x45, 0x53, 0x53, 0x10, 0x06, + 0x12, 0x19, 0x0a, 0x15, 0x55, 0x4e, 0x45, 0x58, 0x50, 0x45, 0x43, 0x54, 0x45, 0x44, 0x5f, 0x53, + 0x57, 0x49, 0x54, 0x43, 0x48, 0x4f, 0x56, 0x45, 0x52, 0x10, 0x07, 0x12, 0x0d, 0x0a, 0x09, 0x53, + 0x59, 0x4e, 0x43, 0x5f, 0x46, 0x41, 0x49, 0x4c, 0x10, 0x08, 0x12, 0x1b, 0x0a, 0x17, 0x4e, 0x4f, + 0x54, 0x5f, 0x53, 0x55, 0x50, 0x50, 0x4f, 0x52, 0x54, 0x45, 0x44, 0x5f, 0x4f, 0x4e, 0x5f, 0x42, + 0x41, 0x43, 0x4b, 0x55, 0x50, 0x10, 0x09, 0x22, 0x77, 0x0a, 0x0f, 0x41, 0x63, 0x74, 0x69, 0x76, + 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, + 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, + 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x2d, 0x0a, 0x12, 0x73, 0x74, 0x61, 0x6e, 0x64, 0x62, 0x79, 0x5f, + 0x73, 0x75, 0x70, 0x65, 0x72, 0x76, 0x69, 0x73, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, + 0x52, 0x11, 0x73, 0x74, 0x61, 0x6e, 0x64, 0x62, 0x79, 0x53, 0x75, 0x70, 0x65, 0x72, 0x76, 0x69, + 0x73, 0x6f, 0x72, 0x12, 0x1b, 0x0a, 0x09, 0x6e, 0x6f, 0x5f, 0x72, 0x65, 0x62, 0x6f, 0x6f, 0x74, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x6e, 0x6f, 0x52, 0x65, 0x62, 0x6f, 0x6f, 0x74, + 0x22, 0x97, 0x01, 0x0a, 0x10, 0x41, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x36, 0x0a, 0x0b, 0x61, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, + 0x65, 0x5f, 0x6f, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x67, 0x6e, 0x6f, + 0x69, 0x2e, 0x6f, 0x73, 0x2e, 0x41, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x65, 0x4f, 0x4b, 0x48, + 0x00, 0x52, 0x0a, 0x61, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x65, 0x4f, 0x6b, 0x12, 0x3f, 0x0a, + 0x0e, 0x61, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x65, 0x5f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x6f, 0x73, 0x2e, + 0x41, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x65, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x48, 0x00, 0x52, + 0x0d, 0x61, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x65, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x42, 0x0a, + 0x0a, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x0c, 0x0a, 0x0a, 0x41, 0x63, + 0x74, 0x69, 0x76, 0x61, 0x74, 0x65, 0x4f, 0x4b, 0x22, 0xa8, 0x01, 0x0a, 0x0d, 0x41, 0x63, 0x74, + 0x69, 0x76, 0x61, 0x74, 0x65, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x2f, 0x0a, 0x04, 0x74, 0x79, + 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1b, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, + 0x6f, 0x73, 0x2e, 0x41, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x65, 0x45, 0x72, 0x72, 0x6f, 0x72, + 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x64, + 0x65, 0x74, 0x61, 0x69, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x65, 0x74, + 0x61, 0x69, 0x6c, 0x22, 0x4e, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0f, 0x0a, 0x0b, 0x55, + 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x18, 0x0a, 0x14, + 0x4e, 0x4f, 0x4e, 0x5f, 0x45, 0x58, 0x49, 0x53, 0x54, 0x45, 0x4e, 0x54, 0x5f, 0x56, 0x45, 0x52, + 0x53, 0x49, 0x4f, 0x4e, 0x10, 0x01, 0x12, 0x1b, 0x0a, 0x17, 0x4e, 0x4f, 0x54, 0x5f, 0x53, 0x55, + 0x50, 0x50, 0x4f, 0x52, 0x54, 0x45, 0x44, 0x5f, 0x4f, 0x4e, 0x5f, 0x42, 0x41, 0x43, 0x4b, 0x55, + 0x50, 0x10, 0x02, 0x22, 0x0f, 0x0a, 0x0d, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x22, 0xe5, 0x01, 0x0a, 0x0e, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, + 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, + 0x6e, 0x12, 0x36, 0x0a, 0x17, 0x61, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, + 0x66, 0x61, 0x69, 0x6c, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x15, 0x61, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x46, 0x61, + 0x69, 0x6c, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x3d, 0x0a, 0x0e, 0x76, 0x65, 0x72, + 0x69, 0x66, 0x79, 0x5f, 0x73, 0x74, 0x61, 0x6e, 0x64, 0x62, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x16, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x6f, 0x73, 0x2e, 0x56, 0x65, 0x72, 0x69, + 0x66, 0x79, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x62, 0x79, 0x52, 0x0d, 0x76, 0x65, 0x72, 0x69, 0x66, + 0x79, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x62, 0x79, 0x12, 0x42, 0x0a, 0x1d, 0x69, 0x6e, 0x64, 0x69, + 0x76, 0x69, 0x64, 0x75, 0x61, 0x6c, 0x5f, 0x73, 0x75, 0x70, 0x65, 0x72, 0x76, 0x69, 0x73, 0x6f, + 0x72, 0x5f, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x1b, 0x69, 0x6e, 0x64, 0x69, 0x76, 0x69, 0x64, 0x75, 0x61, 0x6c, 0x53, 0x75, 0x70, 0x65, 0x72, + 0x76, 0x69, 0x73, 0x6f, 0x72, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x22, 0x9b, 0x01, 0x0a, + 0x0d, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x62, 0x79, 0x12, 0x3c, + 0x0a, 0x0d, 0x73, 0x74, 0x61, 0x6e, 0x64, 0x62, 0x79, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x6f, 0x73, 0x2e, + 0x53, 0x74, 0x61, 0x6e, 0x64, 0x62, 0x79, 0x53, 0x74, 0x61, 0x74, 0x65, 0x48, 0x00, 0x52, 0x0c, + 0x73, 0x74, 0x61, 0x6e, 0x64, 0x62, 0x79, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x43, 0x0a, 0x0f, + 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x6f, 0x73, 0x2e, + 0x53, 0x74, 0x61, 0x6e, 0x64, 0x62, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, + 0x00, 0x52, 0x0e, 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x42, 0x07, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x22, 0x8f, 0x01, 0x0a, 0x0c, 0x53, + 0x74, 0x61, 0x6e, 0x64, 0x62, 0x79, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x31, 0x0a, 0x05, 0x73, + 0x74, 0x61, 0x74, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1b, 0x2e, 0x67, 0x6e, 0x6f, + 0x69, 0x2e, 0x6f, 0x73, 0x2e, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x62, 0x79, 0x53, 0x74, 0x61, 0x74, + 0x65, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x22, 0x4c, + 0x0a, 0x05, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x0f, 0x0a, 0x0b, 0x55, 0x4e, 0x53, 0x50, 0x45, + 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0f, 0x0a, 0x0b, 0x55, 0x4e, 0x53, 0x55, + 0x50, 0x50, 0x4f, 0x52, 0x54, 0x45, 0x44, 0x10, 0x01, 0x12, 0x10, 0x0a, 0x0c, 0x4e, 0x4f, 0x4e, + 0x5f, 0x45, 0x58, 0x49, 0x53, 0x54, 0x45, 0x4e, 0x54, 0x10, 0x02, 0x12, 0x0f, 0x0a, 0x0b, 0x55, + 0x4e, 0x41, 0x56, 0x41, 0x49, 0x4c, 0x41, 0x42, 0x4c, 0x45, 0x10, 0x03, 0x22, 0x73, 0x0a, 0x0f, + 0x53, 0x74, 0x61, 0x6e, 0x64, 0x62, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, + 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x36, 0x0a, 0x17, 0x61, 0x63, 0x74, + 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x66, 0x61, 0x69, 0x6c, 0x5f, 0x6d, 0x65, 0x73, + 0x73, 0x61, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x15, 0x61, 0x63, 0x74, 0x69, + 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x46, 0x61, 0x69, 0x6c, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x32, 0xc2, 0x01, 0x0a, 0x02, 0x4f, 0x53, 0x12, 0x40, 0x0a, 0x07, 0x49, 0x6e, 0x73, 0x74, + 0x61, 0x6c, 0x6c, 0x12, 0x17, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x6f, 0x73, 0x2e, 0x49, 0x6e, + 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x67, + 0x6e, 0x6f, 0x69, 0x2e, 0x6f, 0x73, 0x2e, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x28, 0x01, 0x30, 0x01, 0x12, 0x3f, 0x0a, 0x08, 0x41, 0x63, + 0x74, 0x69, 0x76, 0x61, 0x74, 0x65, 0x12, 0x18, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x6f, 0x73, + 0x2e, 0x41, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x19, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x6f, 0x73, 0x2e, 0x41, 0x63, 0x74, 0x69, 0x76, + 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x39, 0x0a, 0x06, 0x56, + 0x65, 0x72, 0x69, 0x66, 0x79, 0x12, 0x16, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x6f, 0x73, 0x2e, + 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, + 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x6f, 0x73, 0x2e, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x27, 0xd2, 0x3e, 0x05, 0x30, 0x2e, 0x31, 0x2e, 0x34, + 0x5a, 0x1d, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x70, 0x65, + 0x6e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x67, 0x6e, 0x6f, 0x69, 0x2f, 0x6f, 0x73, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_os_os_proto_rawDescOnce sync.Once + file_os_os_proto_rawDescData = file_os_os_proto_rawDesc +) + +func file_os_os_proto_rawDescGZIP() []byte { + file_os_os_proto_rawDescOnce.Do(func() { + file_os_os_proto_rawDescData = protoimpl.X.CompressGZIP(file_os_os_proto_rawDescData) + }) + return file_os_os_proto_rawDescData +} + +var file_os_os_proto_enumTypes = make([]protoimpl.EnumInfo, 3) +var file_os_os_proto_msgTypes = make([]protoimpl.MessageInfo, 18) +var file_os_os_proto_goTypes = []interface{}{ + (InstallError_Type)(0), // 0: gnoi.os.InstallError.Type + (ActivateError_Type)(0), // 1: gnoi.os.ActivateError.Type + (StandbyState_State)(0), // 2: gnoi.os.StandbyState.State + (*InstallRequest)(nil), // 3: gnoi.os.InstallRequest + (*TransferRequest)(nil), // 4: gnoi.os.TransferRequest + (*TransferEnd)(nil), // 5: gnoi.os.TransferEnd + (*InstallResponse)(nil), // 6: gnoi.os.InstallResponse + (*TransferReady)(nil), // 7: gnoi.os.TransferReady + (*TransferProgress)(nil), // 8: gnoi.os.TransferProgress + (*SyncProgress)(nil), // 9: gnoi.os.SyncProgress + (*Validated)(nil), // 10: gnoi.os.Validated + (*InstallError)(nil), // 11: gnoi.os.InstallError + (*ActivateRequest)(nil), // 12: gnoi.os.ActivateRequest + (*ActivateResponse)(nil), // 13: gnoi.os.ActivateResponse + (*ActivateOK)(nil), // 14: gnoi.os.ActivateOK + (*ActivateError)(nil), // 15: gnoi.os.ActivateError + (*VerifyRequest)(nil), // 16: gnoi.os.VerifyRequest + (*VerifyResponse)(nil), // 17: gnoi.os.VerifyResponse + (*VerifyStandby)(nil), // 18: gnoi.os.VerifyStandby + (*StandbyState)(nil), // 19: gnoi.os.StandbyState + (*StandbyResponse)(nil), // 20: gnoi.os.StandbyResponse +} +var file_os_os_proto_depIdxs = []int32{ + 4, // 0: gnoi.os.InstallRequest.transfer_request:type_name -> gnoi.os.TransferRequest + 5, // 1: gnoi.os.InstallRequest.transfer_end:type_name -> gnoi.os.TransferEnd + 7, // 2: gnoi.os.InstallResponse.transfer_ready:type_name -> gnoi.os.TransferReady + 8, // 3: gnoi.os.InstallResponse.transfer_progress:type_name -> gnoi.os.TransferProgress + 9, // 4: gnoi.os.InstallResponse.sync_progress:type_name -> gnoi.os.SyncProgress + 10, // 5: gnoi.os.InstallResponse.validated:type_name -> gnoi.os.Validated + 11, // 6: gnoi.os.InstallResponse.install_error:type_name -> gnoi.os.InstallError + 0, // 7: gnoi.os.InstallError.type:type_name -> gnoi.os.InstallError.Type + 14, // 8: gnoi.os.ActivateResponse.activate_ok:type_name -> gnoi.os.ActivateOK + 15, // 9: gnoi.os.ActivateResponse.activate_error:type_name -> gnoi.os.ActivateError + 1, // 10: gnoi.os.ActivateError.type:type_name -> gnoi.os.ActivateError.Type + 18, // 11: gnoi.os.VerifyResponse.verify_standby:type_name -> gnoi.os.VerifyStandby + 19, // 12: gnoi.os.VerifyStandby.standby_state:type_name -> gnoi.os.StandbyState + 20, // 13: gnoi.os.VerifyStandby.verify_response:type_name -> gnoi.os.StandbyResponse + 2, // 14: gnoi.os.StandbyState.state:type_name -> gnoi.os.StandbyState.State + 3, // 15: gnoi.os.OS.Install:input_type -> gnoi.os.InstallRequest + 12, // 16: gnoi.os.OS.Activate:input_type -> gnoi.os.ActivateRequest + 16, // 17: gnoi.os.OS.Verify:input_type -> gnoi.os.VerifyRequest + 6, // 18: gnoi.os.OS.Install:output_type -> gnoi.os.InstallResponse + 13, // 19: gnoi.os.OS.Activate:output_type -> gnoi.os.ActivateResponse + 17, // 20: gnoi.os.OS.Verify:output_type -> gnoi.os.VerifyResponse + 18, // [18:21] is the sub-list for method output_type + 15, // [15:18] is the sub-list for method input_type + 15, // [15:15] is the sub-list for extension type_name + 15, // [15:15] is the sub-list for extension extendee + 0, // [0:15] is the sub-list for field type_name +} + +func init() { file_os_os_proto_init() } +func file_os_os_proto_init() { + if File_os_os_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_os_os_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*InstallRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_os_os_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TransferRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_os_os_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TransferEnd); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_os_os_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*InstallResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_os_os_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TransferReady); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_os_os_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TransferProgress); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_os_os_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SyncProgress); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_os_os_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Validated); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_os_os_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*InstallError); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_os_os_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ActivateRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_os_os_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ActivateResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_os_os_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ActivateOK); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_os_os_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ActivateError); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_os_os_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*VerifyRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_os_os_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*VerifyResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_os_os_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*VerifyStandby); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_os_os_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StandbyState); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_os_os_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StandbyResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_os_os_proto_msgTypes[0].OneofWrappers = []interface{}{ + (*InstallRequest_TransferRequest)(nil), + (*InstallRequest_TransferContent)(nil), + (*InstallRequest_TransferEnd)(nil), + } + file_os_os_proto_msgTypes[3].OneofWrappers = []interface{}{ + (*InstallResponse_TransferReady)(nil), + (*InstallResponse_TransferProgress)(nil), + (*InstallResponse_SyncProgress)(nil), + (*InstallResponse_Validated)(nil), + (*InstallResponse_InstallError)(nil), + } + file_os_os_proto_msgTypes[10].OneofWrappers = []interface{}{ + (*ActivateResponse_ActivateOk)(nil), + (*ActivateResponse_ActivateError)(nil), + } + file_os_os_proto_msgTypes[15].OneofWrappers = []interface{}{ + (*VerifyStandby_StandbyState)(nil), + (*VerifyStandby_VerifyResponse)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_os_os_proto_rawDesc, + NumEnums: 3, + NumMessages: 18, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_os_os_proto_goTypes, + DependencyIndexes: file_os_os_proto_depIdxs, + EnumInfos: file_os_os_proto_enumTypes, + MessageInfos: file_os_os_proto_msgTypes, + }.Build() + File_os_os_proto = out.File + file_os_os_proto_rawDesc = nil + file_os_os_proto_goTypes = nil + file_os_os_proto_depIdxs = nil +} diff --git a/src/sonic-framework/gnoi/os/os.proto b/src/sonic-framework/gnoi/os/os.proto new file mode 100644 index 000000000000..00c1827c2265 --- /dev/null +++ b/src/sonic-framework/gnoi/os/os.proto @@ -0,0 +1,425 @@ +// +// Copyright 2017 Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package gnoi.os; + +import "github.com/openconfig/gnoi/types/types.proto"; + +option go_package = "github.com/openconfig/gnoi/os"; + +option (types.gnoi_version) = "0.1.4"; + + +// The OS service provides an interface for OS installation on a Target. The +// Client progresses through 3 RPCs: +// 1) Installation - provide the Target with the OS package. +// 2) Activation - activate an installed OS package. +// 3) Verification - verify that the Activation was successful. +// +// Dual Supervisor Target is supported, where the above process is executed once +// for the whole Target or once for each Supervisor. Targets that require the +// above process executed once per Supervisor will reply with the flag +// Verify->VerifyResponse->individual_supervisor_install set to true. +// +// Note that certain platforms may have particular approaches to upgrade the +// firmware of specific components, eg., power supply units, etc.. In addition, +// platforms may have processes to apply patches to the running OS. Handling +// these exceptions introduces extra complexities. For Targets that implement +// this service, component firmware upgrade or OS patching MUST be embedded +// within an OS upgrade. +service OS { + // Install transfers an OS package into the Target. No concurrent Install RPCs + // MUST be allowed to the same Target. + // + // The OS package file format is platform dependent. The platform MUST + // validate that the OS package that is supplied is valid and bootable. This + // SHOULD include a hash check against a known good hash. It is recommended + // that the hash is embedded in the OS package. + // + // The Target manages its own persistent storage, and OS installation process. + // It stores a set of distinct OS packages, and always proactively frees up + // space for incoming new OS packages. It is guaranteed that the Target always + // has enough space for a valid incoming OS package. The currently running OS + // packages MUST never be removed. The Client MUST expect that the last + // successfully installed package is available. + // + // The Install RPC allows the Client to specify the OS package version. If + // the Target already has an OS package with the same version then there is no + // need to transfer the OS package to the Target. If the Target does not have + // an OS package with the same version, then the OS package is copied. + // + // Scenario 1 - When the Target already has the OS package: + // + // Client :--------------|--------------> Target + // TransferRequest --> + // <-- [Validated|InstallError] + // + // + // Scenario 2 - When the Target does not have the OS package: + // + // Client :--------------|--------------> Target + // TransferRequest --> + // <-- [TransferReady|InstallError] + // transfer_content --> + // ... + // <-- [TransferProgress|InstallError] + // ... + // TransferEnd --> + // <-- [Validated|InstallError] + // + // On a dual Supervisor Target which requires installing the entire + // system with one Install RPC, one Install RPC is sufficient to + // install the package on all Supervisors. + // On a dual Supervisor Target which requires one Install RPC per + // supervisor, the Install RPC applies to the Active Supervisor unless + // InstallRequest->TransferRequest->standby_supervisor is set, in which + // case it applies to the Standby Supervisor. The Target MUST accept any + // order of package installation. + // On a dual Supervisor Target which requires installing the entire + // system with one Install RPC, the package MUST be made available on + // all Supervisors or none. If upon installation the package is absent + // from either Supervisor, the Target will transfer to both Supervisors + // overwriting the existing one. + // On a dual Supervisor Target which requires one Install RPC per + // supervisor, the Target MUST always attempt to copy the OS package + // between Supervisors first before accepting the transfer from the + // Client. The syncing progress is reported to the client with + // InstallResponse->SyncProgress messages. + // + // If a switchover is triggered during the Install RPC, the RPC MUST + // immediately abort with Error->type->UNEXPECTED_SWITCHOVER. + // + // Scenario 3 - When both Supervisors already have the OS package, regardless + // of the value in Start.standby_supervisor: + // + // Client :--------------|--------------> Target + // TransferRequest --> + // <-- [Validated|InstallError] + // + // + // Scenario 4 - On a dual Supervisor Target which requires one Install RPC + // per supervisor, and when one of the Supervisors already has the OS + // package but the other Supervisor is the target of the Install: + // + // Client :--------------|--------------> Target + // TransferRequest --> + // <-- [SyncProgress|InstallError] + // ... + // <-- [Validated|InstallError] + // + // + // Scenario 5 - When neither of the two Supervisors has the OS package: + // + // Client :--------------|--------------> Target + // TransferRequest --> + // <-- [TransferReady|InstallError] + // transfer_content --> + // ... + // <-- [TransferProgress|InstallError] + // ... + // TransferEnd --> + // <-- [Validated|InstallError] + // + rpc Install(stream InstallRequest) returns (stream InstallResponse); + + // Activate sets the requested OS version as the version which is used at the + // next reboot, and reboots the Target if the 'no_reboot' flag is not set. + // When booting the requested OS version fails, the Target recovers by + // booting the previously running OS package. + rpc Activate(ActivateRequest) returns (ActivateResponse); + + // Verify checks the running OS version. During reboot, gRPC client returns + // the gRPC status code UNAVAILABLE while the Target is unreachable, which + // should be retried by the client until successful. After the Target becomes + // reachable, it should report all ready or error states normally through + // VerifyResponse. + // + // On a dual Supervisor system, if the Standby Supervisor is rebooting, it + // should be reported in the VerifyResponse via verify_standby as + // StandbyState UNAVAILABLE. + rpc Verify(VerifyRequest) returns (VerifyResponse); +} + +message InstallRequest { + oneof request { + TransferRequest transfer_request = 1; + bytes transfer_content = 2; + TransferEnd transfer_end = 3; + } +} + +message TransferRequest { + // The version string is a vendor defined string that identifies the OS + // version. It is provided by the vendor and embedded in the OS package. This + // value states the desired OS package version to transfer to the Target. If + // the Target already has the OS package version it will reply with + // InstallResponse->Validated. In the case that the target is a + // single Supervisor device, or the partner Supervisor does not have the OS + // image specified, it will respond with InstallResponse->TransferReady. + // In this case, the client MUST subsequently transfer the image. In the case + // that the image is available on the peer Supervisor of a dual Supervisor + // system, it will respond with InstallResponse->SyncProgress. In this, + // latter, case - the client does not need to transfer the OS image. This + // value can also be set empty, in which case the OS package is forced + // transferred to the Target. The Target MUST never validate that this value + // matches the one in the InstallResponse->Validated message, that is the + // Client's responsibility. + // A dual Supervisor Target which requires installing the entire system + // with one Install RPC, will either have the image on both Supervisors + // or neither Supervisor. Such Targets do not need to sync the image + // from peer Supervisor and MUST immediately respond with TransferReady + string version = 1; + + // For a Target with dual Supervisors setting this flag instructs the Target + // to perform the action on the Standby Supervisor. + // A dual Supervisor Target which requires installing the entire system + // with one Install RPC MUST return an error code of NOT_SUPPORTED_ON_BACKUP + // if requested to install on standby only. + bool standby_supervisor = 2; + + // Optionally specify the package size in bytes of the OS package being + // transferred. + // If 1) the value is different than 0 + // and 2) the required space in the Target is larger than the available space + // and 3) the Target is unable to release space for the incoming OS package, + // then the Target must reply with InstallError->Type->TOO_LARGE. + uint64 package_size = 3; +} + +// The TransferEnd message is sent whenever the Client finishes transferring +// the OS package to the Target. At this point the Target MUST perform a general +// health check to the OS package. If the Target fails to parse the OS package +// it MUST immediately reply with an InstallError->type->PARSE_FAIL. If the +// integrity check of the OS package fails it MUST immediately reply with an +// InstallError->type->INTEGRITY_FAIL. If the identified OS version contained in +// the package is not compatible with the Target either because of the platform +// type or the running OS, it MUST immediately reply with an +// InstallError->type->INCOMPATIBLE. If the image is force transferred by +// omitting the InstallRequest->TransferRequest->version value, and the OS +// package is the same as the one running in the Target, the RPC MUST +// immediately abort and reply with an InstallError->type->INSTALL_RUN_PACKAGE. +message TransferEnd { +} + +// The InstallResponse is used by the Target to inform the Client about the +// state of the Install RPC. At any stage of the process the Target can reply +// with an Error message which MUST terminate the stream. +// A dual Supervisor Target which requires installing the entire system with +// one Install RPC, will either have the image on both Supervisors or neither +// Supervisor. Such Targets do not need to sync the image from peer Supervisor +// and MUST immediately respond with TransferReady. +message InstallResponse { + oneof response { + TransferReady transfer_ready = 1; + TransferProgress transfer_progress = 2; + SyncProgress sync_progress = 3; + Validated validated = 4; + InstallError install_error = 5; + } +} + +// The TransferReady message tells the Client that the Target is ready to accept +// the transfer of the OS package. At this stage the Target MUST have cleared +// enough space to accept the incoming OS package. +message TransferReady { +} + +// The TransferProgress message is sent by the target asynchronously during a +// file transfer. The device SHOULD not respond to each input block received +// from the client, but rather determine reasonable intervals at which to send +// the message (e.g., 5MB). +message TransferProgress { + // The number of bytes transferred. + uint64 bytes_received = 1; +} + +// The SyncProgress message signals the Client about the progress of +// transferring the OS package between Supervisors. +// A dual Supervisor Target which requires installing the entire system with +// one Install RPC, does not need to transfer the package between Supervisors +// and MUST not send SyncProgress. +message SyncProgress { + // The percentage that has transferred between Supervisors. + uint32 percentage_transferred = 1; +} + +// The Validated message asserts that the Target was able to parse the package +// and perform integrity checks to its contents. +message Validated { + // The OS version string that identifies the OS version in the OS package. + string version = 1; + // Informational field that SHOULD be used for providing more details about + // the OS package and its version. This MUST be strictly informational if + // used, and can contain information such as build date, target platform, + // developer, etc. + string description = 2; +} + +// The InstallError message MUST be sent by the Target to the Client whenever an +// issue occurs. The Target MUST immediately close the RPC without a gRPC error. +message InstallError { + enum Type { + // An unspecified error. Must use the detail value to describe the issue. + UNSPECIFIED = 0; + // The newly transferred package is not compatible with the Target platform. + // The detail field MUST contain the detailed error message. + INCOMPATIBLE = 1; + // The OS package being transferred is larger than the available size the + // Target provisioned. This is unexpected since the Target MUST clear disk + // space for the new OS packages. The most likely cause of this error is + // that a wrong package is being transferred, as the available space and + // the OS package size MUST be guaranteed by the platform maker. + // However, this error may also be returned if the target does not have + // enough space for both the new OS package and the current running package + // (which must be preserved as a fallback). + TOO_LARGE = 2; + // Used whenever the system is unable to parse the newly transferred + // package, like reading the OS version or the integrity checksums. + PARSE_FAIL = 3; + // The transferred OS package fails integrity check. + INTEGRITY_FAIL = 4; + // Attempting to force transfer an OS package with the same version as the + // currently running. + INSTALL_RUN_PACKAGE = 5; + // Another Install RPC to this Target is already in progress. + INSTALL_IN_PROGRESS = 6; + // A switchover happened during the Install RPC. + UNEXPECTED_SWITCHOVER = 7; + // Failed to sync the transferred OS package to the standby Supervisor. The + // detail value MUST have more information. + // A dual Supervisor Target which requires installing the entire system + // with one Install RPC, MUST not return SYNC_FAIL. + SYNC_FAIL = 8; + // Dual Supervisor Target which requires installing the entire system + // with one Install RPC MUST return this error when requested to + // install on standby Supervisor. + NOT_SUPPORTED_ON_BACKUP = 9; + } + Type type = 1; + string detail = 2; +} + +// The ActivateRequest is sent by the Client to the Target to initiate a change +// in the next bootable OS version that is to be used on the Target. +// Dual Supervisor Target which requires installing the entire system with +// one Install RPC MUST return NOT_SUPPORTED_ON_BACKUP error when requested +// to Activate on standby Supervisor. +message ActivateRequest { + // The version that is required to be activated and optionally immediattely + // booted. + string version = 1; + // For dual Supervisors setting this flag instructs the Target to perform the + // action on the Standby Supervisor. + bool standby_supervisor = 2; + // If set to 'False' the Target will initiate the reboot process immediatelly + // after changing the next bootable OS version. + // If set to 'True' a separate action to reboot the Target and start using + // the activated OS version is required. This action CAN be executing + // the gNOI.system.Reboot() RPC. + bool no_reboot = 3; +} + +// The ActivateResponse is sent from the Target to the Client in response to the +// Activate RPC. It indicates the success of making the OS package version +// active. +message ActivateResponse { + oneof response { + ActivateOK activate_ok = 1; + ActivateError activate_error = 2; + } +} + +// If the Target is already running the requested version in ActivateRequest, +// then it replies with ActivateOK. If the Target has the OS package version +// requested in ActivateRequest then it replies with ActivateOK and proceeds to +// boot. +// A dual Supervisor Target which requires installing the entire system with +// one Install RPC, will activate the image on all Supervisors in response to +// one Activate RPC. The Target should activate the image on both Supervisors +// with the least impact possible to forwarding. +// +// On a dual Supervisor Target which requires one Install RPC per supervisor, +// performing this RPC on the Active Supervisor triggers a switchover before +// booting the (old)Active Supervisor. The Target should perform a switchover +// with the least impact possible to forwarding. +message ActivateOK { +} + +message ActivateError { + enum Type { + // An unspecified error. Must use the detail value to describe the issue. + UNSPECIFIED = 0; + // There is no OS package with the version requested for activation. This is + // also used for an empty version string. + NON_EXISTENT_VERSION = 1; + // Dual Supervisor Target which requires installing the entire system + // with one Install RPC MUST return NOT_SUPPORTED_ON_BACKUP error when + // requested to Activate on standby Supervisor. + NOT_SUPPORTED_ON_BACKUP = 2; + } + Type type = 1; + string detail = 2; +} + +message VerifyRequest { +} + +message VerifyResponse { + // The OS version currently running. This string should match OC path + // /system/state/software-version + string version = 1; + // Informational message describing fail details of the last boot. This MUST + // be set when a newly transferred OS fails to boot and the system falls back + // to the previously running OS version. It MUST be cleared whenever the + // systems successfully boots the activated OS version. + string activation_fail_message = 2; + + VerifyStandby verify_standby = 3; + // Dual Supervisor Targets that require the Install/Activate/Verify process + // executed once per supervisor reply with individual_supervisor_install set + // to true + bool individual_supervisor_install = 4; +} + +message VerifyStandby { + oneof state { + // Standby state indicates problems with the standby. + StandbyState standby_state = 1; + // Standby response indicates that the standby is present and ready. + StandbyResponse verify_response = 2; + } +} + +message StandbyState { + enum State { + UNSPECIFIED = 0; + // The Target does not support dual Supervisors. + UNSUPPORTED = 1; + // Standby Supervisor is supported but does not exist. + NON_EXISTENT = 2; + // Standby Supervisor is supported but is not available, eg.: rebooting. + UNAVAILABLE = 3; + } + State state = 1; +} + +message StandbyResponse { + // Standby Supervisor ID, usually the slot number. + string id = 1; + string version = 2; + string activation_fail_message = 3; +} diff --git a/src/sonic-framework/gnoi/os/os_grpc.pb.go b/src/sonic-framework/gnoi/os/os_grpc.pb.go new file mode 100755 index 000000000000..b5cf28090e83 --- /dev/null +++ b/src/sonic-framework/gnoi/os/os_grpc.pb.go @@ -0,0 +1,210 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.2.0 +// - protoc v3.21.10 +// source: os/os.proto + +package os + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +// OSClient is the client API for OS service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type OSClient interface { + Install(ctx context.Context, opts ...grpc.CallOption) (OS_InstallClient, error) + Activate(ctx context.Context, in *ActivateRequest, opts ...grpc.CallOption) (*ActivateResponse, error) + Verify(ctx context.Context, in *VerifyRequest, opts ...grpc.CallOption) (*VerifyResponse, error) +} + +type oSClient struct { + cc grpc.ClientConnInterface +} + +func NewOSClient(cc grpc.ClientConnInterface) OSClient { + return &oSClient{cc} +} + +func (c *oSClient) Install(ctx context.Context, opts ...grpc.CallOption) (OS_InstallClient, error) { + stream, err := c.cc.NewStream(ctx, &OS_ServiceDesc.Streams[0], "/gnoi.os.OS/Install", opts...) + if err != nil { + return nil, err + } + x := &oSInstallClient{stream} + return x, nil +} + +type OS_InstallClient interface { + Send(*InstallRequest) error + Recv() (*InstallResponse, error) + grpc.ClientStream +} + +type oSInstallClient struct { + grpc.ClientStream +} + +func (x *oSInstallClient) Send(m *InstallRequest) error { + return x.ClientStream.SendMsg(m) +} + +func (x *oSInstallClient) Recv() (*InstallResponse, error) { + m := new(InstallResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *oSClient) Activate(ctx context.Context, in *ActivateRequest, opts ...grpc.CallOption) (*ActivateResponse, error) { + out := new(ActivateResponse) + err := c.cc.Invoke(ctx, "/gnoi.os.OS/Activate", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *oSClient) Verify(ctx context.Context, in *VerifyRequest, opts ...grpc.CallOption) (*VerifyResponse, error) { + out := new(VerifyResponse) + err := c.cc.Invoke(ctx, "/gnoi.os.OS/Verify", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// OSServer is the server API for OS service. +// All implementations must embed UnimplementedOSServer +// for forward compatibility +type OSServer interface { + Install(OS_InstallServer) error + Activate(context.Context, *ActivateRequest) (*ActivateResponse, error) + Verify(context.Context, *VerifyRequest) (*VerifyResponse, error) + mustEmbedUnimplementedOSServer() +} + +// UnimplementedOSServer must be embedded to have forward compatible implementations. +type UnimplementedOSServer struct { +} + +func (UnimplementedOSServer) Install(OS_InstallServer) error { + return status.Errorf(codes.Unimplemented, "method Install not implemented") +} +func (UnimplementedOSServer) Activate(context.Context, *ActivateRequest) (*ActivateResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Activate not implemented") +} +func (UnimplementedOSServer) Verify(context.Context, *VerifyRequest) (*VerifyResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Verify not implemented") +} +func (UnimplementedOSServer) mustEmbedUnimplementedOSServer() {} + +// UnsafeOSServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to OSServer will +// result in compilation errors. +type UnsafeOSServer interface { + mustEmbedUnimplementedOSServer() +} + +func RegisterOSServer(s grpc.ServiceRegistrar, srv OSServer) { + s.RegisterService(&OS_ServiceDesc, srv) +} + +func _OS_Install_Handler(srv interface{}, stream grpc.ServerStream) error { + return srv.(OSServer).Install(&oSInstallServer{stream}) +} + +type OS_InstallServer interface { + Send(*InstallResponse) error + Recv() (*InstallRequest, error) + grpc.ServerStream +} + +type oSInstallServer struct { + grpc.ServerStream +} + +func (x *oSInstallServer) Send(m *InstallResponse) error { + return x.ServerStream.SendMsg(m) +} + +func (x *oSInstallServer) Recv() (*InstallRequest, error) { + m := new(InstallRequest) + if err := x.ServerStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func _OS_Activate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ActivateRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(OSServer).Activate(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/gnoi.os.OS/Activate", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(OSServer).Activate(ctx, req.(*ActivateRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _OS_Verify_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(VerifyRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(OSServer).Verify(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/gnoi.os.OS/Verify", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(OSServer).Verify(ctx, req.(*VerifyRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// OS_ServiceDesc is the grpc.ServiceDesc for OS service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var OS_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "gnoi.os.OS", + HandlerType: (*OSServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Activate", + Handler: _OS_Activate_Handler, + }, + { + MethodName: "Verify", + Handler: _OS_Verify_Handler, + }, + }, + Streams: []grpc.StreamDesc{ + { + StreamName: "Install", + Handler: _OS_Install_Handler, + ServerStreams: true, + ClientStreams: true, + }, + }, + Metadata: "os/os.proto", +} diff --git a/src/sonic-framework/gnoi/otdr/BUILD.bazel b/src/sonic-framework/gnoi/otdr/BUILD.bazel new file mode 100644 index 000000000000..0d9c7d37259a --- /dev/null +++ b/src/sonic-framework/gnoi/otdr/BUILD.bazel @@ -0,0 +1,61 @@ +load("@rules_proto//proto:defs.bzl", "proto_library") +load("@io_bazel_rules_go//go:def.bzl", "go_library") +load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library") +load("@com_github_grpc_grpc//bazel:cc_grpc_library.bzl", "cc_grpc_library") +load("//:common.bzl", "use_new_compilers") + +#Copyright 2021 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +package( + default_visibility = ["//visibility:public"], + licenses = ["notice"], +) + +use_new_compilers() + +proto_library( + name = "otdr_proto", + srcs = ["otdr.proto"], + deps = ["//types:types_proto"], +) + +cc_proto_library( + name = "otdr_cc_proto", + deps = [":otdr_proto"], +) + +cc_grpc_library( + name = "otdr_cc_grpc_proto", + srcs = [":otdr_proto"], + grpc_only = True, + deps = [":otdr_cc_proto"], +) + +go_proto_library( + name = "otdr_go_proto", + compilers = [ + "go_protoc_gen_go", + "go_protoc_gen_go_grpc", + ], + importpath = "github.com/openconfig/gnoi/otdr", + proto = ":otdr_proto", + deps = ["//types"], +) + +go_library( + name = "otdr", + embed = [":otdr_go_proto"], + importpath = "github.com/openconfig/gnoi/otdr", +) diff --git a/src/sonic-framework/gnoi/otdr/otdr.pb.go b/src/sonic-framework/gnoi/otdr/otdr.pb.go new file mode 100644 index 000000000000..2b0435f6f234 --- /dev/null +++ b/src/sonic-framework/gnoi/otdr/otdr.pb.go @@ -0,0 +1,1111 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.30.0 +// protoc v3.21.10 +// source: otdr/otdr.proto + +package otdr + +import ( + types "github.com/openconfig/gnoi/types" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type FiberTypeProfile int32 + +const ( + FiberTypeProfile_FTP_UNKNOWN FiberTypeProfile = 0 + FiberTypeProfile_FTP_DSF FiberTypeProfile = 1 + FiberTypeProfile_FTP_LEAF FiberTypeProfile = 2 + FiberTypeProfile_FTP_SSMF FiberTypeProfile = 3 + FiberTypeProfile_FTP_TWC FiberTypeProfile = 4 + FiberTypeProfile_FTP_TWRS FiberTypeProfile = 5 + FiberTypeProfile_FTP_LS FiberTypeProfile = 6 + FiberTypeProfile_FTP_TERAWAVE FiberTypeProfile = 7 + FiberTypeProfile_FTP_TERALIGHT FiberTypeProfile = 8 +) + +// Enum value maps for FiberTypeProfile. +var ( + FiberTypeProfile_name = map[int32]string{ + 0: "FTP_UNKNOWN", + 1: "FTP_DSF", + 2: "FTP_LEAF", + 3: "FTP_SSMF", + 4: "FTP_TWC", + 5: "FTP_TWRS", + 6: "FTP_LS", + 7: "FTP_TERAWAVE", + 8: "FTP_TERALIGHT", + } + FiberTypeProfile_value = map[string]int32{ + "FTP_UNKNOWN": 0, + "FTP_DSF": 1, + "FTP_LEAF": 2, + "FTP_SSMF": 3, + "FTP_TWC": 4, + "FTP_TWRS": 5, + "FTP_LS": 6, + "FTP_TERAWAVE": 7, + "FTP_TERALIGHT": 8, + } +) + +func (x FiberTypeProfile) Enum() *FiberTypeProfile { + p := new(FiberTypeProfile) + *p = x + return p +} + +func (x FiberTypeProfile) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (FiberTypeProfile) Descriptor() protoreflect.EnumDescriptor { + return file_otdr_otdr_proto_enumTypes[0].Descriptor() +} + +func (FiberTypeProfile) Type() protoreflect.EnumType { + return &file_otdr_otdr_proto_enumTypes[0] +} + +func (x FiberTypeProfile) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use FiberTypeProfile.Descriptor instead. +func (FiberTypeProfile) EnumDescriptor() ([]byte, []int) { + return file_otdr_otdr_proto_rawDescGZIP(), []int{0} +} + +type InitiateRequest_ResultsMethod int32 + +const ( + InitiateRequest_RESULTS_UNKNOWN InitiateRequest_ResultsMethod = 0 + InitiateRequest_RESULTS_TO_LOCAL_DISK InitiateRequest_ResultsMethod = 1 + InitiateRequest_RESULTS_IN_RESPONSE InitiateRequest_ResultsMethod = 2 +) + +// Enum value maps for InitiateRequest_ResultsMethod. +var ( + InitiateRequest_ResultsMethod_name = map[int32]string{ + 0: "RESULTS_UNKNOWN", + 1: "RESULTS_TO_LOCAL_DISK", + 2: "RESULTS_IN_RESPONSE", + } + InitiateRequest_ResultsMethod_value = map[string]int32{ + "RESULTS_UNKNOWN": 0, + "RESULTS_TO_LOCAL_DISK": 1, + "RESULTS_IN_RESPONSE": 2, + } +) + +func (x InitiateRequest_ResultsMethod) Enum() *InitiateRequest_ResultsMethod { + p := new(InitiateRequest_ResultsMethod) + *p = x + return p +} + +func (x InitiateRequest_ResultsMethod) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (InitiateRequest_ResultsMethod) Descriptor() protoreflect.EnumDescriptor { + return file_otdr_otdr_proto_enumTypes[1].Descriptor() +} + +func (InitiateRequest_ResultsMethod) Type() protoreflect.EnumType { + return &file_otdr_otdr_proto_enumTypes[1] +} + +func (x InitiateRequest_ResultsMethod) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use InitiateRequest_ResultsMethod.Descriptor instead. +func (InitiateRequest_ResultsMethod) EnumDescriptor() ([]byte, []int) { + return file_otdr_otdr_proto_rawDescGZIP(), []int{0, 0} +} + +type InitiateProgress_State int32 + +const ( + InitiateProgress_UNKNOWN InitiateProgress_State = 0 + InitiateProgress_RUNNING InitiateProgress_State = 1 + InitiateProgress_PENDING InitiateProgress_State = 2 + InitiateProgress_COMPLETE InitiateProgress_State = 3 +) + +// Enum value maps for InitiateProgress_State. +var ( + InitiateProgress_State_name = map[int32]string{ + 0: "UNKNOWN", + 1: "RUNNING", + 2: "PENDING", + 3: "COMPLETE", + } + InitiateProgress_State_value = map[string]int32{ + "UNKNOWN": 0, + "RUNNING": 1, + "PENDING": 2, + "COMPLETE": 3, + } +) + +func (x InitiateProgress_State) Enum() *InitiateProgress_State { + p := new(InitiateProgress_State) + *p = x + return p +} + +func (x InitiateProgress_State) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (InitiateProgress_State) Descriptor() protoreflect.EnumDescriptor { + return file_otdr_otdr_proto_enumTypes[2].Descriptor() +} + +func (InitiateProgress_State) Type() protoreflect.EnumType { + return &file_otdr_otdr_proto_enumTypes[2] +} + +func (x InitiateProgress_State) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use InitiateProgress_State.Descriptor instead. +func (InitiateProgress_State) EnumDescriptor() ([]byte, []int) { + return file_otdr_otdr_proto_rawDescGZIP(), []int{2, 0} +} + +type InitiateError_Type int32 + +const ( + InitiateError_UNSPECIFIED InitiateError_Type = 0 + InitiateError_ALREADY_IN_PROGRESS InitiateError_Type = 1 + InitiateError_HARDWARE_FAILURE InitiateError_Type = 2 +) + +// Enum value maps for InitiateError_Type. +var ( + InitiateError_Type_name = map[int32]string{ + 0: "UNSPECIFIED", + 1: "ALREADY_IN_PROGRESS", + 2: "HARDWARE_FAILURE", + } + InitiateError_Type_value = map[string]int32{ + "UNSPECIFIED": 0, + "ALREADY_IN_PROGRESS": 1, + "HARDWARE_FAILURE": 2, + } +) + +func (x InitiateError_Type) Enum() *InitiateError_Type { + p := new(InitiateError_Type) + *p = x + return p +} + +func (x InitiateError_Type) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (InitiateError_Type) Descriptor() protoreflect.EnumDescriptor { + return file_otdr_otdr_proto_enumTypes[3].Descriptor() +} + +func (InitiateError_Type) Type() protoreflect.EnumType { + return &file_otdr_otdr_proto_enumTypes[3] +} + +func (x InitiateError_Type) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use InitiateError_Type.Descriptor instead. +func (InitiateError_Type) EnumDescriptor() ([]byte, []int) { + return file_otdr_otdr_proto_rawDescGZIP(), []int{4, 0} +} + +type InitiateRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Component *types.Path `protobuf:"bytes,1,opt,name=component,proto3" json:"component,omitempty"` + ResultsMethod []InitiateRequest_ResultsMethod `protobuf:"varint,2,rep,packed,name=results_method,json=resultsMethod,proto3,enum=gnoi.optical.InitiateRequest_ResultsMethod" json:"results_method,omitempty"` + Configuration *OTDRConfiguration `protobuf:"bytes,3,opt,name=configuration,proto3" json:"configuration,omitempty"` + Label string `protobuf:"bytes,4,opt,name=label,proto3" json:"label,omitempty"` +} + +func (x *InitiateRequest) Reset() { + *x = InitiateRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_otdr_otdr_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *InitiateRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*InitiateRequest) ProtoMessage() {} + +func (x *InitiateRequest) ProtoReflect() protoreflect.Message { + mi := &file_otdr_otdr_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use InitiateRequest.ProtoReflect.Descriptor instead. +func (*InitiateRequest) Descriptor() ([]byte, []int) { + return file_otdr_otdr_proto_rawDescGZIP(), []int{0} +} + +func (x *InitiateRequest) GetComponent() *types.Path { + if x != nil { + return x.Component + } + return nil +} + +func (x *InitiateRequest) GetResultsMethod() []InitiateRequest_ResultsMethod { + if x != nil { + return x.ResultsMethod + } + return nil +} + +func (x *InitiateRequest) GetConfiguration() *OTDRConfiguration { + if x != nil { + return x.Configuration + } + return nil +} + +func (x *InitiateRequest) GetLabel() string { + if x != nil { + return x.Label + } + return "" +} + +type OTDRConfiguration struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + AcquisitionTimeS uint32 `protobuf:"varint,1,opt,name=acquisition_time_s,json=acquisitionTimeS,proto3" json:"acquisition_time_s,omitempty"` + PulseWidthNs float32 `protobuf:"fixed32,2,opt,name=pulse_width_ns,json=pulseWidthNs,proto3" json:"pulse_width_ns,omitempty"` + WavelengthMhz uint64 `protobuf:"varint,3,opt,name=wavelength_mhz,json=wavelengthMhz,proto3" json:"wavelength_mhz,omitempty"` + RangeM float32 `protobuf:"fixed32,4,opt,name=range_m,json=rangeM,proto3" json:"range_m,omitempty"` + FiberType FiberTypeProfile `protobuf:"varint,5,opt,name=fiber_type,json=fiberType,proto3,enum=gnoi.optical.FiberTypeProfile" json:"fiber_type,omitempty"` + SamplingResolutionM float32 `protobuf:"fixed32,6,opt,name=sampling_resolution_m,json=samplingResolutionM,proto3" json:"sampling_resolution_m,omitempty"` +} + +func (x *OTDRConfiguration) Reset() { + *x = OTDRConfiguration{} + if protoimpl.UnsafeEnabled { + mi := &file_otdr_otdr_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *OTDRConfiguration) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*OTDRConfiguration) ProtoMessage() {} + +func (x *OTDRConfiguration) ProtoReflect() protoreflect.Message { + mi := &file_otdr_otdr_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use OTDRConfiguration.ProtoReflect.Descriptor instead. +func (*OTDRConfiguration) Descriptor() ([]byte, []int) { + return file_otdr_otdr_proto_rawDescGZIP(), []int{1} +} + +func (x *OTDRConfiguration) GetAcquisitionTimeS() uint32 { + if x != nil { + return x.AcquisitionTimeS + } + return 0 +} + +func (x *OTDRConfiguration) GetPulseWidthNs() float32 { + if x != nil { + return x.PulseWidthNs + } + return 0 +} + +func (x *OTDRConfiguration) GetWavelengthMhz() uint64 { + if x != nil { + return x.WavelengthMhz + } + return 0 +} + +func (x *OTDRConfiguration) GetRangeM() float32 { + if x != nil { + return x.RangeM + } + return 0 +} + +func (x *OTDRConfiguration) GetFiberType() FiberTypeProfile { + if x != nil { + return x.FiberType + } + return FiberTypeProfile_FTP_UNKNOWN +} + +func (x *OTDRConfiguration) GetSamplingResolutionM() float32 { + if x != nil { + return x.SamplingResolutionM + } + return 0 +} + +type InitiateProgress struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + State InitiateProgress_State `protobuf:"varint,1,opt,name=state,proto3,enum=gnoi.optical.InitiateProgress_State" json:"state,omitempty"` +} + +func (x *InitiateProgress) Reset() { + *x = InitiateProgress{} + if protoimpl.UnsafeEnabled { + mi := &file_otdr_otdr_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *InitiateProgress) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*InitiateProgress) ProtoMessage() {} + +func (x *InitiateProgress) ProtoReflect() protoreflect.Message { + mi := &file_otdr_otdr_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use InitiateProgress.ProtoReflect.Descriptor instead. +func (*InitiateProgress) Descriptor() ([]byte, []int) { + return file_otdr_otdr_proto_rawDescGZIP(), []int{2} +} + +func (x *InitiateProgress) GetState() InitiateProgress_State { + if x != nil { + return x.State + } + return InitiateProgress_UNKNOWN +} + +type InitiateResults struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + LocalPath string `protobuf:"bytes,1,opt,name=local_path,json=localPath,proto3" json:"local_path,omitempty"` + OtdrTrace *OTDRTrace `protobuf:"bytes,2,opt,name=otdr_trace,json=otdrTrace,proto3" json:"otdr_trace,omitempty"` +} + +func (x *InitiateResults) Reset() { + *x = InitiateResults{} + if protoimpl.UnsafeEnabled { + mi := &file_otdr_otdr_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *InitiateResults) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*InitiateResults) ProtoMessage() {} + +func (x *InitiateResults) ProtoReflect() protoreflect.Message { + mi := &file_otdr_otdr_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use InitiateResults.ProtoReflect.Descriptor instead. +func (*InitiateResults) Descriptor() ([]byte, []int) { + return file_otdr_otdr_proto_rawDescGZIP(), []int{3} +} + +func (x *InitiateResults) GetLocalPath() string { + if x != nil { + return x.LocalPath + } + return "" +} + +func (x *InitiateResults) GetOtdrTrace() *OTDRTrace { + if x != nil { + return x.OtdrTrace + } + return nil +} + +type InitiateError struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Type InitiateError_Type `protobuf:"varint,1,opt,name=type,proto3,enum=gnoi.optical.InitiateError_Type" json:"type,omitempty"` + Detail string `protobuf:"bytes,2,opt,name=detail,proto3" json:"detail,omitempty"` +} + +func (x *InitiateError) Reset() { + *x = InitiateError{} + if protoimpl.UnsafeEnabled { + mi := &file_otdr_otdr_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *InitiateError) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*InitiateError) ProtoMessage() {} + +func (x *InitiateError) ProtoReflect() protoreflect.Message { + mi := &file_otdr_otdr_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use InitiateError.ProtoReflect.Descriptor instead. +func (*InitiateError) Descriptor() ([]byte, []int) { + return file_otdr_otdr_proto_rawDescGZIP(), []int{4} +} + +func (x *InitiateError) GetType() InitiateError_Type { + if x != nil { + return x.Type + } + return InitiateError_UNSPECIFIED +} + +func (x *InitiateError) GetDetail() string { + if x != nil { + return x.Detail + } + return "" +} + +type InitiateResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Response: + // + // *InitiateResponse_Progress + // *InitiateResponse_Results + // *InitiateResponse_Error + Response isInitiateResponse_Response `protobuf_oneof:"response"` +} + +func (x *InitiateResponse) Reset() { + *x = InitiateResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_otdr_otdr_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *InitiateResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*InitiateResponse) ProtoMessage() {} + +func (x *InitiateResponse) ProtoReflect() protoreflect.Message { + mi := &file_otdr_otdr_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use InitiateResponse.ProtoReflect.Descriptor instead. +func (*InitiateResponse) Descriptor() ([]byte, []int) { + return file_otdr_otdr_proto_rawDescGZIP(), []int{5} +} + +func (m *InitiateResponse) GetResponse() isInitiateResponse_Response { + if m != nil { + return m.Response + } + return nil +} + +func (x *InitiateResponse) GetProgress() *InitiateProgress { + if x, ok := x.GetResponse().(*InitiateResponse_Progress); ok { + return x.Progress + } + return nil +} + +func (x *InitiateResponse) GetResults() *InitiateResults { + if x, ok := x.GetResponse().(*InitiateResponse_Results); ok { + return x.Results + } + return nil +} + +func (x *InitiateResponse) GetError() *InitiateError { + if x, ok := x.GetResponse().(*InitiateResponse_Error); ok { + return x.Error + } + return nil +} + +type isInitiateResponse_Response interface { + isInitiateResponse_Response() +} + +type InitiateResponse_Progress struct { + Progress *InitiateProgress `protobuf:"bytes,1,opt,name=progress,proto3,oneof"` +} + +type InitiateResponse_Results struct { + Results *InitiateResults `protobuf:"bytes,2,opt,name=results,proto3,oneof"` +} + +type InitiateResponse_Error struct { + Error *InitiateError `protobuf:"bytes,3,opt,name=error,proto3,oneof"` +} + +func (*InitiateResponse_Progress) isInitiateResponse_Response() {} + +func (*InitiateResponse_Results) isInitiateResponse_Response() {} + +func (*InitiateResponse_Error) isInitiateResponse_Response() {} + +type OTDRTrace struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + TotalLossDb float32 `protobuf:"fixed32,1,opt,name=total_loss_db,json=totalLossDb,proto3" json:"total_loss_db,omitempty"` + TotalLengthM float32 `protobuf:"fixed32,2,opt,name=total_length_m,json=totalLengthM,proto3" json:"total_length_m,omitempty"` + OpticalReturnLossDb float32 `protobuf:"fixed32,3,opt,name=optical_return_loss_db,json=opticalReturnLossDb,proto3" json:"optical_return_loss_db,omitempty"` + AverageLossDbKm float32 `protobuf:"fixed32,4,opt,name=average_loss_db_km,json=averageLossDbKm,proto3" json:"average_loss_db_km,omitempty"` + DiscoveredFiberType FiberTypeProfile `protobuf:"varint,5,opt,name=discovered_fiber_type,json=discoveredFiberType,proto3,enum=gnoi.optical.FiberTypeProfile" json:"discovered_fiber_type,omitempty"` + Events []*Event `protobuf:"bytes,6,rep,name=events,proto3" json:"events,omitempty"` +} + +func (x *OTDRTrace) Reset() { + *x = OTDRTrace{} + if protoimpl.UnsafeEnabled { + mi := &file_otdr_otdr_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *OTDRTrace) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*OTDRTrace) ProtoMessage() {} + +func (x *OTDRTrace) ProtoReflect() protoreflect.Message { + mi := &file_otdr_otdr_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use OTDRTrace.ProtoReflect.Descriptor instead. +func (*OTDRTrace) Descriptor() ([]byte, []int) { + return file_otdr_otdr_proto_rawDescGZIP(), []int{6} +} + +func (x *OTDRTrace) GetTotalLossDb() float32 { + if x != nil { + return x.TotalLossDb + } + return 0 +} + +func (x *OTDRTrace) GetTotalLengthM() float32 { + if x != nil { + return x.TotalLengthM + } + return 0 +} + +func (x *OTDRTrace) GetOpticalReturnLossDb() float32 { + if x != nil { + return x.OpticalReturnLossDb + } + return 0 +} + +func (x *OTDRTrace) GetAverageLossDbKm() float32 { + if x != nil { + return x.AverageLossDbKm + } + return 0 +} + +func (x *OTDRTrace) GetDiscoveredFiberType() FiberTypeProfile { + if x != nil { + return x.DiscoveredFiberType + } + return FiberTypeProfile_FTP_UNKNOWN +} + +func (x *OTDRTrace) GetEvents() []*Event { + if x != nil { + return x.Events + } + return nil +} + +type Event struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + DistanceM float32 `protobuf:"fixed32,1,opt,name=distance_m,json=distanceM,proto3" json:"distance_m,omitempty"` + LossDb float32 `protobuf:"fixed32,2,opt,name=loss_db,json=lossDb,proto3" json:"loss_db,omitempty"` + ReflectionDb float32 `protobuf:"fixed32,3,opt,name=reflection_db,json=reflectionDb,proto3" json:"reflection_db,omitempty"` +} + +func (x *Event) Reset() { + *x = Event{} + if protoimpl.UnsafeEnabled { + mi := &file_otdr_otdr_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Event) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Event) ProtoMessage() {} + +func (x *Event) ProtoReflect() protoreflect.Message { + mi := &file_otdr_otdr_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Event.ProtoReflect.Descriptor instead. +func (*Event) Descriptor() ([]byte, []int) { + return file_otdr_otdr_proto_rawDescGZIP(), []int{7} +} + +func (x *Event) GetDistanceM() float32 { + if x != nil { + return x.DistanceM + } + return 0 +} + +func (x *Event) GetLossDb() float32 { + if x != nil { + return x.LossDb + } + return 0 +} + +func (x *Event) GetReflectionDb() float32 { + if x != nil { + return x.ReflectionDb + } + return 0 +} + +var File_otdr_otdr_proto protoreflect.FileDescriptor + +var file_otdr_otdr_proto_rawDesc = []byte{ + 0x0a, 0x0f, 0x6f, 0x74, 0x64, 0x72, 0x2f, 0x6f, 0x74, 0x64, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x12, 0x0c, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x63, 0x61, 0x6c, 0x1a, + 0x2c, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x70, 0x65, 0x6e, + 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x67, 0x6e, 0x6f, 0x69, 0x2f, 0x74, 0x79, 0x70, 0x65, + 0x73, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xcc, 0x02, + 0x0a, 0x0f, 0x49, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x2e, 0x0a, 0x09, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x74, 0x79, 0x70, 0x65, + 0x73, 0x2e, 0x50, 0x61, 0x74, 0x68, 0x52, 0x09, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, + 0x74, 0x12, 0x52, 0x0a, 0x0e, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x5f, 0x6d, 0x65, 0x74, + 0x68, 0x6f, 0x64, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0e, 0x32, 0x2b, 0x2e, 0x67, 0x6e, 0x6f, 0x69, + 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x63, 0x61, 0x6c, 0x2e, 0x49, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x74, + 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, + 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x52, 0x0d, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x4d, + 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x45, 0x0a, 0x0d, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, + 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x67, + 0x6e, 0x6f, 0x69, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x63, 0x61, 0x6c, 0x2e, 0x4f, 0x54, 0x44, 0x52, + 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0d, 0x63, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x14, 0x0a, 0x05, + 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6c, 0x61, 0x62, + 0x65, 0x6c, 0x22, 0x58, 0x0a, 0x0d, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x4d, 0x65, 0x74, + 0x68, 0x6f, 0x64, 0x12, 0x13, 0x0a, 0x0f, 0x52, 0x45, 0x53, 0x55, 0x4c, 0x54, 0x53, 0x5f, 0x55, + 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x19, 0x0a, 0x15, 0x52, 0x45, 0x53, 0x55, + 0x4c, 0x54, 0x53, 0x5f, 0x54, 0x4f, 0x5f, 0x4c, 0x4f, 0x43, 0x41, 0x4c, 0x5f, 0x44, 0x49, 0x53, + 0x4b, 0x10, 0x01, 0x12, 0x17, 0x0a, 0x13, 0x52, 0x45, 0x53, 0x55, 0x4c, 0x54, 0x53, 0x5f, 0x49, + 0x4e, 0x5f, 0x52, 0x45, 0x53, 0x50, 0x4f, 0x4e, 0x53, 0x45, 0x10, 0x02, 0x22, 0x9a, 0x02, 0x0a, + 0x11, 0x4f, 0x54, 0x44, 0x52, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x12, 0x2c, 0x0a, 0x12, 0x61, 0x63, 0x71, 0x75, 0x69, 0x73, 0x69, 0x74, 0x69, 0x6f, + 0x6e, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x10, + 0x61, 0x63, 0x71, 0x75, 0x69, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x53, + 0x12, 0x24, 0x0a, 0x0e, 0x70, 0x75, 0x6c, 0x73, 0x65, 0x5f, 0x77, 0x69, 0x64, 0x74, 0x68, 0x5f, + 0x6e, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x02, 0x52, 0x0c, 0x70, 0x75, 0x6c, 0x73, 0x65, 0x57, + 0x69, 0x64, 0x74, 0x68, 0x4e, 0x73, 0x12, 0x25, 0x0a, 0x0e, 0x77, 0x61, 0x76, 0x65, 0x6c, 0x65, + 0x6e, 0x67, 0x74, 0x68, 0x5f, 0x6d, 0x68, 0x7a, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0d, + 0x77, 0x61, 0x76, 0x65, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x4d, 0x68, 0x7a, 0x12, 0x17, 0x0a, + 0x07, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x5f, 0x6d, 0x18, 0x04, 0x20, 0x01, 0x28, 0x02, 0x52, 0x06, + 0x72, 0x61, 0x6e, 0x67, 0x65, 0x4d, 0x12, 0x3d, 0x0a, 0x0a, 0x66, 0x69, 0x62, 0x65, 0x72, 0x5f, + 0x74, 0x79, 0x70, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1e, 0x2e, 0x67, 0x6e, 0x6f, + 0x69, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x63, 0x61, 0x6c, 0x2e, 0x46, 0x69, 0x62, 0x65, 0x72, 0x54, + 0x79, 0x70, 0x65, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x52, 0x09, 0x66, 0x69, 0x62, 0x65, + 0x72, 0x54, 0x79, 0x70, 0x65, 0x12, 0x32, 0x0a, 0x15, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x69, 0x6e, + 0x67, 0x5f, 0x72, 0x65, 0x73, 0x6f, 0x6c, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x18, 0x06, + 0x20, 0x01, 0x28, 0x02, 0x52, 0x13, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x69, 0x6e, 0x67, 0x52, 0x65, + 0x73, 0x6f, 0x6c, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x22, 0x8c, 0x01, 0x0a, 0x10, 0x49, 0x6e, + 0x69, 0x74, 0x69, 0x61, 0x74, 0x65, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x12, 0x3a, + 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x24, 0x2e, + 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x63, 0x61, 0x6c, 0x2e, 0x49, 0x6e, 0x69, + 0x74, 0x69, 0x61, 0x74, 0x65, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x2e, 0x53, 0x74, + 0x61, 0x74, 0x65, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x22, 0x3c, 0x0a, 0x05, 0x53, 0x74, + 0x61, 0x74, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, + 0x12, 0x0b, 0x0a, 0x07, 0x52, 0x55, 0x4e, 0x4e, 0x49, 0x4e, 0x47, 0x10, 0x01, 0x12, 0x0b, 0x0a, + 0x07, 0x50, 0x45, 0x4e, 0x44, 0x49, 0x4e, 0x47, 0x10, 0x02, 0x12, 0x0c, 0x0a, 0x08, 0x43, 0x4f, + 0x4d, 0x50, 0x4c, 0x45, 0x54, 0x45, 0x10, 0x03, 0x22, 0x68, 0x0a, 0x0f, 0x49, 0x6e, 0x69, 0x74, + 0x69, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x6c, + 0x6f, 0x63, 0x61, 0x6c, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x09, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x50, 0x61, 0x74, 0x68, 0x12, 0x36, 0x0a, 0x0a, 0x6f, 0x74, + 0x64, 0x72, 0x5f, 0x74, 0x72, 0x61, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, + 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x63, 0x61, 0x6c, 0x2e, 0x4f, 0x54, + 0x44, 0x52, 0x54, 0x72, 0x61, 0x63, 0x65, 0x52, 0x09, 0x6f, 0x74, 0x64, 0x72, 0x54, 0x72, 0x61, + 0x63, 0x65, 0x22, 0xa5, 0x01, 0x0a, 0x0d, 0x49, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x74, 0x65, 0x45, + 0x72, 0x72, 0x6f, 0x72, 0x12, 0x34, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0e, 0x32, 0x20, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x63, 0x61, + 0x6c, 0x2e, 0x49, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x74, 0x65, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x2e, + 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x64, 0x65, + 0x74, 0x61, 0x69, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x65, 0x74, 0x61, + 0x69, 0x6c, 0x22, 0x46, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0f, 0x0a, 0x0b, 0x55, 0x4e, + 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x17, 0x0a, 0x13, 0x41, + 0x4c, 0x52, 0x45, 0x41, 0x44, 0x59, 0x5f, 0x49, 0x4e, 0x5f, 0x50, 0x52, 0x4f, 0x47, 0x52, 0x45, + 0x53, 0x53, 0x10, 0x01, 0x12, 0x14, 0x0a, 0x10, 0x48, 0x41, 0x52, 0x44, 0x57, 0x41, 0x52, 0x45, + 0x5f, 0x46, 0x41, 0x49, 0x4c, 0x55, 0x52, 0x45, 0x10, 0x02, 0x22, 0xcc, 0x01, 0x0a, 0x10, 0x49, + 0x6e, 0x69, 0x74, 0x69, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x3c, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1e, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x63, 0x61, 0x6c, + 0x2e, 0x49, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x74, 0x65, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, + 0x73, 0x48, 0x00, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x12, 0x39, 0x0a, + 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, + 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x63, 0x61, 0x6c, 0x2e, 0x49, 0x6e, + 0x69, 0x74, 0x69, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x48, 0x00, 0x52, + 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x12, 0x33, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, + 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x6f, + 0x70, 0x74, 0x69, 0x63, 0x61, 0x6c, 0x2e, 0x49, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x74, 0x65, 0x45, + 0x72, 0x72, 0x6f, 0x72, 0x48, 0x00, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x42, 0x0a, 0x0a, + 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xb8, 0x02, 0x0a, 0x09, 0x4f, 0x54, + 0x44, 0x52, 0x54, 0x72, 0x61, 0x63, 0x65, 0x12, 0x22, 0x0a, 0x0d, 0x74, 0x6f, 0x74, 0x61, 0x6c, + 0x5f, 0x6c, 0x6f, 0x73, 0x73, 0x5f, 0x64, 0x62, 0x18, 0x01, 0x20, 0x01, 0x28, 0x02, 0x52, 0x0b, + 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x4c, 0x6f, 0x73, 0x73, 0x44, 0x62, 0x12, 0x24, 0x0a, 0x0e, 0x74, + 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x5f, 0x6d, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x02, 0x52, 0x0c, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x4c, 0x65, 0x6e, 0x67, 0x74, 0x68, + 0x4d, 0x12, 0x33, 0x0a, 0x16, 0x6f, 0x70, 0x74, 0x69, 0x63, 0x61, 0x6c, 0x5f, 0x72, 0x65, 0x74, + 0x75, 0x72, 0x6e, 0x5f, 0x6c, 0x6f, 0x73, 0x73, 0x5f, 0x64, 0x62, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x02, 0x52, 0x13, 0x6f, 0x70, 0x74, 0x69, 0x63, 0x61, 0x6c, 0x52, 0x65, 0x74, 0x75, 0x72, 0x6e, + 0x4c, 0x6f, 0x73, 0x73, 0x44, 0x62, 0x12, 0x2b, 0x0a, 0x12, 0x61, 0x76, 0x65, 0x72, 0x61, 0x67, + 0x65, 0x5f, 0x6c, 0x6f, 0x73, 0x73, 0x5f, 0x64, 0x62, 0x5f, 0x6b, 0x6d, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x02, 0x52, 0x0f, 0x61, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x4c, 0x6f, 0x73, 0x73, 0x44, + 0x62, 0x4b, 0x6d, 0x12, 0x52, 0x0a, 0x15, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x65, + 0x64, 0x5f, 0x66, 0x69, 0x62, 0x65, 0x72, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x0e, 0x32, 0x1e, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x63, 0x61, + 0x6c, 0x2e, 0x46, 0x69, 0x62, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x50, 0x72, 0x6f, 0x66, 0x69, + 0x6c, 0x65, 0x52, 0x13, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x65, 0x64, 0x46, 0x69, + 0x62, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x12, 0x2b, 0x0a, 0x06, 0x65, 0x76, 0x65, 0x6e, 0x74, + 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x6f, + 0x70, 0x74, 0x69, 0x63, 0x61, 0x6c, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, 0x06, 0x65, 0x76, + 0x65, 0x6e, 0x74, 0x73, 0x22, 0x64, 0x0a, 0x05, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x1d, 0x0a, + 0x0a, 0x64, 0x69, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x02, 0x52, 0x09, 0x64, 0x69, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x4d, 0x12, 0x17, 0x0a, 0x07, + 0x6c, 0x6f, 0x73, 0x73, 0x5f, 0x64, 0x62, 0x18, 0x02, 0x20, 0x01, 0x28, 0x02, 0x52, 0x06, 0x6c, + 0x6f, 0x73, 0x73, 0x44, 0x62, 0x12, 0x23, 0x0a, 0x0d, 0x72, 0x65, 0x66, 0x6c, 0x65, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x5f, 0x64, 0x62, 0x18, 0x03, 0x20, 0x01, 0x28, 0x02, 0x52, 0x0c, 0x72, 0x65, + 0x66, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x62, 0x2a, 0x98, 0x01, 0x0a, 0x10, 0x46, + 0x69, 0x62, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x12, + 0x0f, 0x0a, 0x0b, 0x46, 0x54, 0x50, 0x5f, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, + 0x12, 0x0b, 0x0a, 0x07, 0x46, 0x54, 0x50, 0x5f, 0x44, 0x53, 0x46, 0x10, 0x01, 0x12, 0x0c, 0x0a, + 0x08, 0x46, 0x54, 0x50, 0x5f, 0x4c, 0x45, 0x41, 0x46, 0x10, 0x02, 0x12, 0x0c, 0x0a, 0x08, 0x46, + 0x54, 0x50, 0x5f, 0x53, 0x53, 0x4d, 0x46, 0x10, 0x03, 0x12, 0x0b, 0x0a, 0x07, 0x46, 0x54, 0x50, + 0x5f, 0x54, 0x57, 0x43, 0x10, 0x04, 0x12, 0x0c, 0x0a, 0x08, 0x46, 0x54, 0x50, 0x5f, 0x54, 0x57, + 0x52, 0x53, 0x10, 0x05, 0x12, 0x0a, 0x0a, 0x06, 0x46, 0x54, 0x50, 0x5f, 0x4c, 0x53, 0x10, 0x06, + 0x12, 0x10, 0x0a, 0x0c, 0x46, 0x54, 0x50, 0x5f, 0x54, 0x45, 0x52, 0x41, 0x57, 0x41, 0x56, 0x45, + 0x10, 0x07, 0x12, 0x11, 0x0a, 0x0d, 0x46, 0x54, 0x50, 0x5f, 0x54, 0x45, 0x52, 0x41, 0x4c, 0x49, + 0x47, 0x48, 0x54, 0x10, 0x08, 0x32, 0x55, 0x0a, 0x04, 0x4f, 0x54, 0x44, 0x52, 0x12, 0x4d, 0x0a, + 0x08, 0x49, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x74, 0x65, 0x12, 0x1d, 0x2e, 0x67, 0x6e, 0x6f, 0x69, + 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x63, 0x61, 0x6c, 0x2e, 0x49, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x74, + 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, + 0x6f, 0x70, 0x74, 0x69, 0x63, 0x61, 0x6c, 0x2e, 0x49, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x74, 0x65, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x30, 0x01, 0x42, 0x29, 0xd2, 0x3e, + 0x05, 0x30, 0x2e, 0x31, 0x2e, 0x30, 0x5a, 0x1f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, + 0x6f, 0x6d, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x67, 0x6e, + 0x6f, 0x69, 0x2f, 0x6f, 0x74, 0x64, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_otdr_otdr_proto_rawDescOnce sync.Once + file_otdr_otdr_proto_rawDescData = file_otdr_otdr_proto_rawDesc +) + +func file_otdr_otdr_proto_rawDescGZIP() []byte { + file_otdr_otdr_proto_rawDescOnce.Do(func() { + file_otdr_otdr_proto_rawDescData = protoimpl.X.CompressGZIP(file_otdr_otdr_proto_rawDescData) + }) + return file_otdr_otdr_proto_rawDescData +} + +var file_otdr_otdr_proto_enumTypes = make([]protoimpl.EnumInfo, 4) +var file_otdr_otdr_proto_msgTypes = make([]protoimpl.MessageInfo, 8) +var file_otdr_otdr_proto_goTypes = []interface{}{ + (FiberTypeProfile)(0), // 0: gnoi.optical.FiberTypeProfile + (InitiateRequest_ResultsMethod)(0), // 1: gnoi.optical.InitiateRequest.ResultsMethod + (InitiateProgress_State)(0), // 2: gnoi.optical.InitiateProgress.State + (InitiateError_Type)(0), // 3: gnoi.optical.InitiateError.Type + (*InitiateRequest)(nil), // 4: gnoi.optical.InitiateRequest + (*OTDRConfiguration)(nil), // 5: gnoi.optical.OTDRConfiguration + (*InitiateProgress)(nil), // 6: gnoi.optical.InitiateProgress + (*InitiateResults)(nil), // 7: gnoi.optical.InitiateResults + (*InitiateError)(nil), // 8: gnoi.optical.InitiateError + (*InitiateResponse)(nil), // 9: gnoi.optical.InitiateResponse + (*OTDRTrace)(nil), // 10: gnoi.optical.OTDRTrace + (*Event)(nil), // 11: gnoi.optical.Event + (*types.Path)(nil), // 12: gnoi.types.Path +} +var file_otdr_otdr_proto_depIdxs = []int32{ + 12, // 0: gnoi.optical.InitiateRequest.component:type_name -> gnoi.types.Path + 1, // 1: gnoi.optical.InitiateRequest.results_method:type_name -> gnoi.optical.InitiateRequest.ResultsMethod + 5, // 2: gnoi.optical.InitiateRequest.configuration:type_name -> gnoi.optical.OTDRConfiguration + 0, // 3: gnoi.optical.OTDRConfiguration.fiber_type:type_name -> gnoi.optical.FiberTypeProfile + 2, // 4: gnoi.optical.InitiateProgress.state:type_name -> gnoi.optical.InitiateProgress.State + 10, // 5: gnoi.optical.InitiateResults.otdr_trace:type_name -> gnoi.optical.OTDRTrace + 3, // 6: gnoi.optical.InitiateError.type:type_name -> gnoi.optical.InitiateError.Type + 6, // 7: gnoi.optical.InitiateResponse.progress:type_name -> gnoi.optical.InitiateProgress + 7, // 8: gnoi.optical.InitiateResponse.results:type_name -> gnoi.optical.InitiateResults + 8, // 9: gnoi.optical.InitiateResponse.error:type_name -> gnoi.optical.InitiateError + 0, // 10: gnoi.optical.OTDRTrace.discovered_fiber_type:type_name -> gnoi.optical.FiberTypeProfile + 11, // 11: gnoi.optical.OTDRTrace.events:type_name -> gnoi.optical.Event + 4, // 12: gnoi.optical.OTDR.Initiate:input_type -> gnoi.optical.InitiateRequest + 9, // 13: gnoi.optical.OTDR.Initiate:output_type -> gnoi.optical.InitiateResponse + 13, // [13:14] is the sub-list for method output_type + 12, // [12:13] is the sub-list for method input_type + 12, // [12:12] is the sub-list for extension type_name + 12, // [12:12] is the sub-list for extension extendee + 0, // [0:12] is the sub-list for field type_name +} + +func init() { file_otdr_otdr_proto_init() } +func file_otdr_otdr_proto_init() { + if File_otdr_otdr_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_otdr_otdr_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*InitiateRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_otdr_otdr_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*OTDRConfiguration); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_otdr_otdr_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*InitiateProgress); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_otdr_otdr_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*InitiateResults); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_otdr_otdr_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*InitiateError); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_otdr_otdr_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*InitiateResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_otdr_otdr_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*OTDRTrace); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_otdr_otdr_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Event); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_otdr_otdr_proto_msgTypes[5].OneofWrappers = []interface{}{ + (*InitiateResponse_Progress)(nil), + (*InitiateResponse_Results)(nil), + (*InitiateResponse_Error)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_otdr_otdr_proto_rawDesc, + NumEnums: 4, + NumMessages: 8, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_otdr_otdr_proto_goTypes, + DependencyIndexes: file_otdr_otdr_proto_depIdxs, + EnumInfos: file_otdr_otdr_proto_enumTypes, + MessageInfos: file_otdr_otdr_proto_msgTypes, + }.Build() + File_otdr_otdr_proto = out.File + file_otdr_otdr_proto_rawDesc = nil + file_otdr_otdr_proto_goTypes = nil + file_otdr_otdr_proto_depIdxs = nil +} diff --git a/src/sonic-framework/gnoi/otdr/otdr.proto b/src/sonic-framework/gnoi/otdr/otdr.proto new file mode 100644 index 000000000000..54ed97ecfcaf --- /dev/null +++ b/src/sonic-framework/gnoi/otdr/otdr.proto @@ -0,0 +1,174 @@ +// +// Copyright 2019 Google LLC. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package gnoi.optical; + +import "github.com/openconfig/gnoi/types/types.proto"; + +option go_package = "github.com/openconfig/gnoi/otdr"; + +option (types.gnoi_version) = "0.1.0"; + +service OTDR { + // Initiate triggers an optical time domain reflectometer (OTDR) trace to + // be run on a specified port. The results of the trace may be sent back in + // the response or saved on the device to be retrieved later. If the + // information is saved on the device a path to the file must be returned + // which can later be used by File.Get or File.TransferToRemote. The RPC + // should initiate the OTDR trace and wait until the OTDR trace has completed + // and the device has processed the results before returning. If the RPC is + // cancelled while in operation, the running OTDR trace should stop. + rpc Initiate(InitiateRequest) returns (stream InitiateResponse) {} +} + +message InitiateRequest { + // Absolute path to the /components/component list member in the OpenConfig + // model corresponding to the port to perform the OTDR trace from. + // (e.g., /components/component[name=otdr-1-1]) + types.Path component = 1; + + enum ResultsMethod { + RESULTS_UNKNOWN = 0; + RESULTS_TO_LOCAL_DISK = 1; // Results saved to a file on the device. + RESULTS_IN_RESPONSE = 2; // Results sent back in the response. + } + // Describes how the results of the OTDR trace should be made available. More + // than one option may be specified if desired. + repeated ResultsMethod results_method = 2; + + // Describes the configuration used to perform an OTDR trace. + OTDRConfiguration configuration = 3; + + // If specified, the device will label the OTDR trace so it can be recalled + // later. For example, the initial OTDR trace measured during span + // commissioning might be labeled "baseline". + string label = 4; +} + +// OTDR configuration options which can be set on the device. It is not required +// that every field be set as some fields may not apply for a given +// implementation. +message OTDRConfiguration { + // The time in seconds in which the OTDR trace will run continuously to + // collect data. + uint32 acquisition_time_s = 1; + + // The pulse width in nanoseconds which defines how long pulses sent by the + // OTDR will be during the test. + float pulse_width_ns = 2; + + // The wavelength in MHz that will be sent by the OTDR. This may be left blank + // if the OTDR only supports one wavelength. + uint64 wavelength_mhz = 3; + + // The maximum fiber distance range in meters that the OTDR trace will + // support. + float range_m = 4; + + // The type of fiber that is being measured. + FiberTypeProfile fiber_type = 5; + + // The sampling resolution in meters. + float sampling_resolution_m = 6; +} + +// Type definition for different profiles of fiber types. These match what is +// already defined in OpenConfig under the FIBER_TYPE_PROFILE identityref in +// openconfig-optical-amplifier.yang model. +enum FiberTypeProfile { + FTP_UNKNOWN = 0; + FTP_DSF = 1; // Dispersion shifted fiber. + FTP_LEAF = 2; // Large effective area fiber. + FTP_SSMF = 3; // Standard single mode fiber. + FTP_TWC = 4; // True wave classic fiber. + FTP_TWRS = 5; // True wave reduced slope fiber. + FTP_LS = 6; // LEAF Submarine fiber. + FTP_TERAWAVE = 7; // TeraWave fiber. + FTP_TERALIGHT = 8; // TeraLight fiber. +} + +message InitiateProgress { + // The State enum defines possible states that the OTDR trace may be in + // while running the operation. + enum State { + UNKNOWN = 0; + RUNNING = 1; // The OTDR is currently performing an OTDR trace. + PENDING = 2; // The OTDR is pending underlying resources being available. + COMPLETE = 3; // The OTDR trace was completed. + } + // The state of the OTDR trace requested. Note that this does not include + // error states as these should be returned as a gRPC error. + State state = 1; +} + +message InitiateResults { + // The local path in which the OTDR file is saved on the device. + string local_path = 1; + // The OTDR trace details in a structured format. + OTDRTrace otdr_trace = 2; +} + +message InitiateError { + enum Type { + // An unspecified error. Must use the detail value to describe the issue. + UNSPECIFIED = 0; + // An existing OTDR trace is already in progress. + ALREADY_IN_PROGRESS = 1; + // The OTDR hardware has failed and cannot complete an OTDR trace. + HARDWARE_FAILURE = 2; + } + Type type = 1; + string detail = 2; +} + +// IntitiateResponse describes the possible response messages that will be +// streamed after the RPC is initiated. While the OTDR is running, "progress" +// messages should be sent at a regular interval. When the OTDR trace is +// completed, a final "results" or "error" message should be streamed before +// the RPC is terminated. +message InitiateResponse { + oneof response { + InitiateProgress progress = 1; + InitiateResults results = 2; + InitiateError error = 3; + } +} + +message OTDRTrace { + // Total measured loss of the fiber. + float total_loss_db = 1; + // Total measured length of the fiber in meters. + float total_length_m = 2; + // Optical return loss of the fiber in dB. + float optical_return_loss_db = 3; + // Average fiber loss (dB/km) + float average_loss_db_km = 4; + // Discovered fiber type, if the OTDR can infer this information. + FiberTypeProfile discovered_fiber_type = 5; + + repeated Event events = 6; +} + +message Event { + // Distance at which the event occurred in meters. + float distance_m = 1; + // The fiber loss that occurred at the event in dB. + float loss_db = 2; + // The reflection that occurred at the event in dB. + float reflection_db = 3; +} + diff --git a/src/sonic-framework/gnoi/otdr/otdr_grpc.pb.go b/src/sonic-framework/gnoi/otdr/otdr_grpc.pb.go new file mode 100755 index 000000000000..c0d5fa22a0cb --- /dev/null +++ b/src/sonic-framework/gnoi/otdr/otdr_grpc.pb.go @@ -0,0 +1,132 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.2.0 +// - protoc v3.21.10 +// source: otdr/otdr.proto + +package otdr + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +// OTDRClient is the client API for OTDR service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type OTDRClient interface { + Initiate(ctx context.Context, in *InitiateRequest, opts ...grpc.CallOption) (OTDR_InitiateClient, error) +} + +type oTDRClient struct { + cc grpc.ClientConnInterface +} + +func NewOTDRClient(cc grpc.ClientConnInterface) OTDRClient { + return &oTDRClient{cc} +} + +func (c *oTDRClient) Initiate(ctx context.Context, in *InitiateRequest, opts ...grpc.CallOption) (OTDR_InitiateClient, error) { + stream, err := c.cc.NewStream(ctx, &OTDR_ServiceDesc.Streams[0], "/gnoi.optical.OTDR/Initiate", opts...) + if err != nil { + return nil, err + } + x := &oTDRInitiateClient{stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +type OTDR_InitiateClient interface { + Recv() (*InitiateResponse, error) + grpc.ClientStream +} + +type oTDRInitiateClient struct { + grpc.ClientStream +} + +func (x *oTDRInitiateClient) Recv() (*InitiateResponse, error) { + m := new(InitiateResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +// OTDRServer is the server API for OTDR service. +// All implementations must embed UnimplementedOTDRServer +// for forward compatibility +type OTDRServer interface { + Initiate(*InitiateRequest, OTDR_InitiateServer) error + mustEmbedUnimplementedOTDRServer() +} + +// UnimplementedOTDRServer must be embedded to have forward compatible implementations. +type UnimplementedOTDRServer struct { +} + +func (UnimplementedOTDRServer) Initiate(*InitiateRequest, OTDR_InitiateServer) error { + return status.Errorf(codes.Unimplemented, "method Initiate not implemented") +} +func (UnimplementedOTDRServer) mustEmbedUnimplementedOTDRServer() {} + +// UnsafeOTDRServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to OTDRServer will +// result in compilation errors. +type UnsafeOTDRServer interface { + mustEmbedUnimplementedOTDRServer() +} + +func RegisterOTDRServer(s grpc.ServiceRegistrar, srv OTDRServer) { + s.RegisterService(&OTDR_ServiceDesc, srv) +} + +func _OTDR_Initiate_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(InitiateRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(OTDRServer).Initiate(m, &oTDRInitiateServer{stream}) +} + +type OTDR_InitiateServer interface { + Send(*InitiateResponse) error + grpc.ServerStream +} + +type oTDRInitiateServer struct { + grpc.ServerStream +} + +func (x *oTDRInitiateServer) Send(m *InitiateResponse) error { + return x.ServerStream.SendMsg(m) +} + +// OTDR_ServiceDesc is the grpc.ServiceDesc for OTDR service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var OTDR_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "gnoi.optical.OTDR", + HandlerType: (*OTDRServer)(nil), + Methods: []grpc.MethodDesc{}, + Streams: []grpc.StreamDesc{ + { + StreamName: "Initiate", + Handler: _OTDR_Initiate_Handler, + ServerStreams: true, + }, + }, + Metadata: "otdr/otdr.proto", +} diff --git a/src/sonic-framework/gnoi/packet_capture/BUILD.bazel b/src/sonic-framework/gnoi/packet_capture/BUILD.bazel new file mode 100644 index 000000000000..84cef5766782 --- /dev/null +++ b/src/sonic-framework/gnoi/packet_capture/BUILD.bazel @@ -0,0 +1,56 @@ +load("@rules_proto//proto:defs.bzl", "proto_library") +load("@io_bazel_rules_go//go:def.bzl", "go_library") +load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library") +load("@com_github_grpc_grpc//bazel:cc_grpc_library.bzl", "cc_grpc_library") +load("//:common.bzl", "use_new_compilers") +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +package( + default_visibility = ["//visibility:public"], + licenses = ["notice"], +) + +use_new_compilers() + +proto_library( + name = "pcap_proto", + srcs = ["packet_capture.proto"], + visibility = ["//visibility:public"], +) + +go_proto_library( + name = "pcap_go_proto", + compilers = [ + "go_protoc_gen_go", + "go_protoc_gen_go_grpc", + ], + importpath = "github.com/openconfig/gnoi/packet_capture", + proto = ":pcap_proto", + visibility = ["//visibility:public"], +) + +go_library( + name = "pcap", + embed = [":pcap_go_proto"], + importpath = "github.com/openconfig/gnoi/pcap", + visibility = ["//visibility:public"], +) + +go_library( + name = "packet_capture", + embed = [":pcap_go_proto"], + importpath = "github.com/openconfig/gnoi/packet_capture", + visibility = ["//visibility:public"], +) diff --git a/src/sonic-framework/gnoi/packet_capture/packet_capture.pb.go b/src/sonic-framework/gnoi/packet_capture/packet_capture.pb.go new file mode 100644 index 000000000000..3b641b92266b --- /dev/null +++ b/src/sonic-framework/gnoi/packet_capture/packet_capture.pb.go @@ -0,0 +1,1284 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.30.0 +// protoc v3.21.10 +// source: packet_capture/packet_capture.proto + +package pcap + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type OperatingBand int32 + +const ( + OperatingBand_BAND_2G OperatingBand = 0 + OperatingBand_BAND_5G OperatingBand = 1 + OperatingBand_BAND_6G OperatingBand = 2 + OperatingBand_BAND_ALL OperatingBand = 3 +) + +// Enum value maps for OperatingBand. +var ( + OperatingBand_name = map[int32]string{ + 0: "BAND_2G", + 1: "BAND_5G", + 2: "BAND_6G", + 3: "BAND_ALL", + } + OperatingBand_value = map[string]int32{ + "BAND_2G": 0, + "BAND_5G": 1, + "BAND_6G": 2, + "BAND_ALL": 3, + } +) + +func (x OperatingBand) Enum() *OperatingBand { + p := new(OperatingBand) + *p = x + return p +} + +func (x OperatingBand) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (OperatingBand) Descriptor() protoreflect.EnumDescriptor { + return file_packet_capture_packet_capture_proto_enumTypes[0].Descriptor() +} + +func (OperatingBand) Type() protoreflect.EnumType { + return &file_packet_capture_packet_capture_proto_enumTypes[0] +} + +func (x OperatingBand) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use OperatingBand.Descriptor instead. +func (OperatingBand) EnumDescriptor() ([]byte, []int) { + return file_packet_capture_packet_capture_proto_rawDescGZIP(), []int{0} +} + +type Protocol int32 + +const ( + Protocol_TCP Protocol = 0 + Protocol_UDP Protocol = 1 +) + +// Enum value maps for Protocol. +var ( + Protocol_name = map[int32]string{ + 0: "TCP", + 1: "UDP", + } + Protocol_value = map[string]int32{ + "TCP": 0, + "UDP": 1, + } +) + +func (x Protocol) Enum() *Protocol { + p := new(Protocol) + *p = x + return p +} + +func (x Protocol) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Protocol) Descriptor() protoreflect.EnumDescriptor { + return file_packet_capture_packet_capture_proto_enumTypes[1].Descriptor() +} + +func (Protocol) Type() protoreflect.EnumType { + return &file_packet_capture_packet_capture_proto_enumTypes[1] +} + +func (x Protocol) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use Protocol.Descriptor instead. +func (Protocol) EnumDescriptor() ([]byte, []int) { + return file_packet_capture_packet_capture_proto_rawDescGZIP(), []int{1} +} + +type Direction int32 + +const ( + Direction_RX Direction = 0 + Direction_TX Direction = 1 + Direction_BOTH Direction = 2 +) + +// Enum value maps for Direction. +var ( + Direction_name = map[int32]string{ + 0: "RX", + 1: "TX", + 2: "BOTH", + } + Direction_value = map[string]int32{ + "RX": 0, + "TX": 1, + "BOTH": 2, + } +) + +func (x Direction) Enum() *Direction { + p := new(Direction) + *p = x + return p +} + +func (x Direction) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Direction) Descriptor() protoreflect.EnumDescriptor { + return file_packet_capture_packet_capture_proto_enumTypes[2].Descriptor() +} + +func (Direction) Type() protoreflect.EnumType { + return &file_packet_capture_packet_capture_proto_enumTypes[2] +} + +func (x Direction) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use Direction.Descriptor instead. +func (Direction) EnumDescriptor() ([]byte, []int) { + return file_packet_capture_packet_capture_proto_rawDescGZIP(), []int{2} +} + +type ChannelWidth int32 + +const ( + ChannelWidth_WIDTH_20MHZ ChannelWidth = 0 + ChannelWidth_WIDTH_40MHZ ChannelWidth = 1 + ChannelWidth_WIDTH_80MHZ ChannelWidth = 2 + ChannelWidth_WIDTH_160MHZ ChannelWidth = 3 +) + +// Enum value maps for ChannelWidth. +var ( + ChannelWidth_name = map[int32]string{ + 0: "WIDTH_20MHZ", + 1: "WIDTH_40MHZ", + 2: "WIDTH_80MHZ", + 3: "WIDTH_160MHZ", + } + ChannelWidth_value = map[string]int32{ + "WIDTH_20MHZ": 0, + "WIDTH_40MHZ": 1, + "WIDTH_80MHZ": 2, + "WIDTH_160MHZ": 3, + } +) + +func (x ChannelWidth) Enum() *ChannelWidth { + p := new(ChannelWidth) + *p = x + return p +} + +func (x ChannelWidth) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (ChannelWidth) Descriptor() protoreflect.EnumDescriptor { + return file_packet_capture_packet_capture_proto_enumTypes[3].Descriptor() +} + +func (ChannelWidth) Type() protoreflect.EnumType { + return &file_packet_capture_packet_capture_proto_enumTypes[3] +} + +func (x ChannelWidth) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use ChannelWidth.Descriptor instead. +func (ChannelWidth) EnumDescriptor() ([]byte, []int) { + return file_packet_capture_packet_capture_proto_rawDescGZIP(), []int{3} +} + +type AccessCaptureType struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + OperatingBand []OperatingBand `protobuf:"varint,1,rep,packed,name=operating_band,json=operatingBand,proto3,enum=gnoi.pcap.OperatingBand" json:"operating_band,omitempty"` + // Types that are assignable to FilterType: + // + // *AccessCaptureType_Ssid + // *AccessCaptureType_Mac + FilterType isAccessCaptureType_FilterType `protobuf_oneof:"filter_type"` + PromiscuousMode bool `protobuf:"varint,4,opt,name=promiscuous_mode,json=promiscuousMode,proto3" json:"promiscuous_mode,omitempty"` +} + +func (x *AccessCaptureType) Reset() { + *x = AccessCaptureType{} + if protoimpl.UnsafeEnabled { + mi := &file_packet_capture_packet_capture_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AccessCaptureType) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AccessCaptureType) ProtoMessage() {} + +func (x *AccessCaptureType) ProtoReflect() protoreflect.Message { + mi := &file_packet_capture_packet_capture_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AccessCaptureType.ProtoReflect.Descriptor instead. +func (*AccessCaptureType) Descriptor() ([]byte, []int) { + return file_packet_capture_packet_capture_proto_rawDescGZIP(), []int{0} +} + +func (x *AccessCaptureType) GetOperatingBand() []OperatingBand { + if x != nil { + return x.OperatingBand + } + return nil +} + +func (m *AccessCaptureType) GetFilterType() isAccessCaptureType_FilterType { + if m != nil { + return m.FilterType + } + return nil +} + +func (x *AccessCaptureType) GetSsid() string { + if x, ok := x.GetFilterType().(*AccessCaptureType_Ssid); ok { + return x.Ssid + } + return "" +} + +func (x *AccessCaptureType) GetMac() string { + if x, ok := x.GetFilterType().(*AccessCaptureType_Mac); ok { + return x.Mac + } + return "" +} + +func (x *AccessCaptureType) GetPromiscuousMode() bool { + if x != nil { + return x.PromiscuousMode + } + return false +} + +type isAccessCaptureType_FilterType interface { + isAccessCaptureType_FilterType() +} + +type AccessCaptureType_Ssid struct { + Ssid string `protobuf:"bytes,2,opt,name=ssid,proto3,oneof"` +} + +type AccessCaptureType_Mac struct { + Mac string `protobuf:"bytes,3,opt,name=mac,proto3,oneof"` +} + +func (*AccessCaptureType_Ssid) isAccessCaptureType_FilterType() {} + +func (*AccessCaptureType_Mac) isAccessCaptureType_FilterType() {} + +type ChannelInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Channel string `protobuf:"bytes,1,opt,name=channel,proto3" json:"channel,omitempty"` + ChannelWidth ChannelWidth `protobuf:"varint,2,opt,name=channel_width,json=channelWidth,proto3,enum=gnoi.pcap.ChannelWidth" json:"channel_width,omitempty"` +} + +func (x *ChannelInfo) Reset() { + *x = ChannelInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_packet_capture_packet_capture_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ChannelInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChannelInfo) ProtoMessage() {} + +func (x *ChannelInfo) ProtoReflect() protoreflect.Message { + mi := &file_packet_capture_packet_capture_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ChannelInfo.ProtoReflect.Descriptor instead. +func (*ChannelInfo) Descriptor() ([]byte, []int) { + return file_packet_capture_packet_capture_proto_rawDescGZIP(), []int{1} +} + +func (x *ChannelInfo) GetChannel() string { + if x != nil { + return x.Channel + } + return "" +} + +func (x *ChannelInfo) GetChannelWidth() ChannelWidth { + if x != nil { + return x.ChannelWidth + } + return ChannelWidth_WIDTH_20MHZ +} + +type BandChannelCombo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + OperatingBand OperatingBand `protobuf:"varint,1,opt,name=operating_band,json=operatingBand,proto3,enum=gnoi.pcap.OperatingBand" json:"operating_band,omitempty"` + ChannelInfo []*ChannelInfo `protobuf:"bytes,2,rep,name=channel_info,json=channelInfo,proto3" json:"channel_info,omitempty"` +} + +func (x *BandChannelCombo) Reset() { + *x = BandChannelCombo{} + if protoimpl.UnsafeEnabled { + mi := &file_packet_capture_packet_capture_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *BandChannelCombo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BandChannelCombo) ProtoMessage() {} + +func (x *BandChannelCombo) ProtoReflect() protoreflect.Message { + mi := &file_packet_capture_packet_capture_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BandChannelCombo.ProtoReflect.Descriptor instead. +func (*BandChannelCombo) Descriptor() ([]byte, []int) { + return file_packet_capture_packet_capture_proto_rawDescGZIP(), []int{2} +} + +func (x *BandChannelCombo) GetOperatingBand() OperatingBand { + if x != nil { + return x.OperatingBand + } + return OperatingBand_BAND_2G +} + +func (x *BandChannelCombo) GetChannelInfo() []*ChannelInfo { + if x != nil { + return x.ChannelInfo + } + return nil +} + +type ScanCaptureType struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Combo []*BandChannelCombo `protobuf:"bytes,1,rep,name=combo,proto3" json:"combo,omitempty"` + DwellTime uint64 `protobuf:"varint,2,opt,name=dwell_time,json=dwellTime,proto3" json:"dwell_time,omitempty"` +} + +func (x *ScanCaptureType) Reset() { + *x = ScanCaptureType{} + if protoimpl.UnsafeEnabled { + mi := &file_packet_capture_packet_capture_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ScanCaptureType) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ScanCaptureType) ProtoMessage() {} + +func (x *ScanCaptureType) ProtoReflect() protoreflect.Message { + mi := &file_packet_capture_packet_capture_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ScanCaptureType.ProtoReflect.Descriptor instead. +func (*ScanCaptureType) Descriptor() ([]byte, []int) { + return file_packet_capture_packet_capture_proto_rawDescGZIP(), []int{3} +} + +func (x *ScanCaptureType) GetCombo() []*BandChannelCombo { + if x != nil { + return x.Combo + } + return nil +} + +func (x *ScanCaptureType) GetDwellTime() uint64 { + if x != nil { + return x.DwellTime + } + return 0 +} + +type Filter struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + FilterName string `protobuf:"bytes,1,opt,name=filter_name,json=filterName,proto3" json:"filter_name,omitempty"` + SrcNet string `protobuf:"bytes,2,opt,name=src_net,json=srcNet,proto3" json:"src_net,omitempty"` + DestNet string `protobuf:"bytes,3,opt,name=dest_net,json=destNet,proto3" json:"dest_net,omitempty"` + Protocol []Protocol `protobuf:"varint,4,rep,packed,name=protocol,proto3,enum=gnoi.pcap.Protocol" json:"protocol,omitempty"` + Port []uint32 `protobuf:"varint,5,rep,packed,name=port,proto3" json:"port,omitempty"` + Vlan []uint32 `protobuf:"varint,6,rep,packed,name=vlan,proto3" json:"vlan,omitempty"` +} + +func (x *Filter) Reset() { + *x = Filter{} + if protoimpl.UnsafeEnabled { + mi := &file_packet_capture_packet_capture_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Filter) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Filter) ProtoMessage() {} + +func (x *Filter) ProtoReflect() protoreflect.Message { + mi := &file_packet_capture_packet_capture_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Filter.ProtoReflect.Descriptor instead. +func (*Filter) Descriptor() ([]byte, []int) { + return file_packet_capture_packet_capture_proto_rawDescGZIP(), []int{4} +} + +func (x *Filter) GetFilterName() string { + if x != nil { + return x.FilterName + } + return "" +} + +func (x *Filter) GetSrcNet() string { + if x != nil { + return x.SrcNet + } + return "" +} + +func (x *Filter) GetDestNet() string { + if x != nil { + return x.DestNet + } + return "" +} + +func (x *Filter) GetProtocol() []Protocol { + if x != nil { + return x.Protocol + } + return nil +} + +func (x *Filter) GetPort() []uint32 { + if x != nil { + return x.Port + } + return nil +} + +func (x *Filter) GetVlan() []uint32 { + if x != nil { + return x.Vlan + } + return nil +} + +type WiredRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Ifname string `protobuf:"bytes,1,opt,name=ifname,proto3" json:"ifname,omitempty"` + Direction Direction `protobuf:"varint,2,opt,name=direction,proto3,enum=gnoi.pcap.Direction" json:"direction,omitempty"` + // Types that are assignable to FilterType: + // + // *WiredRequest_TcpdumpExpression + // *WiredRequest_Filter + FilterType isWiredRequest_FilterType `protobuf_oneof:"filter_type"` +} + +func (x *WiredRequest) Reset() { + *x = WiredRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_packet_capture_packet_capture_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *WiredRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*WiredRequest) ProtoMessage() {} + +func (x *WiredRequest) ProtoReflect() protoreflect.Message { + mi := &file_packet_capture_packet_capture_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use WiredRequest.ProtoReflect.Descriptor instead. +func (*WiredRequest) Descriptor() ([]byte, []int) { + return file_packet_capture_packet_capture_proto_rawDescGZIP(), []int{5} +} + +func (x *WiredRequest) GetIfname() string { + if x != nil { + return x.Ifname + } + return "" +} + +func (x *WiredRequest) GetDirection() Direction { + if x != nil { + return x.Direction + } + return Direction_RX +} + +func (m *WiredRequest) GetFilterType() isWiredRequest_FilterType { + if m != nil { + return m.FilterType + } + return nil +} + +func (x *WiredRequest) GetTcpdumpExpression() string { + if x, ok := x.GetFilterType().(*WiredRequest_TcpdumpExpression); ok { + return x.TcpdumpExpression + } + return "" +} + +func (x *WiredRequest) GetFilter() *Filter { + if x, ok := x.GetFilterType().(*WiredRequest_Filter); ok { + return x.Filter + } + return nil +} + +type isWiredRequest_FilterType interface { + isWiredRequest_FilterType() +} + +type WiredRequest_TcpdumpExpression struct { + TcpdumpExpression string `protobuf:"bytes,3,opt,name=tcpdump_expression,json=tcpdumpExpression,proto3,oneof"` +} + +type WiredRequest_Filter struct { + Filter *Filter `protobuf:"bytes,4,opt,name=filter,proto3,oneof"` +} + +func (*WiredRequest_TcpdumpExpression) isWiredRequest_FilterType() {} + +func (*WiredRequest_Filter) isWiredRequest_FilterType() {} + +type WirelessRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to CaptureType: + // + // *WirelessRequest_AccessType + // *WirelessRequest_ScanType + CaptureType isWirelessRequest_CaptureType `protobuf_oneof:"capture_type"` +} + +func (x *WirelessRequest) Reset() { + *x = WirelessRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_packet_capture_packet_capture_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *WirelessRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*WirelessRequest) ProtoMessage() {} + +func (x *WirelessRequest) ProtoReflect() protoreflect.Message { + mi := &file_packet_capture_packet_capture_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use WirelessRequest.ProtoReflect.Descriptor instead. +func (*WirelessRequest) Descriptor() ([]byte, []int) { + return file_packet_capture_packet_capture_proto_rawDescGZIP(), []int{6} +} + +func (m *WirelessRequest) GetCaptureType() isWirelessRequest_CaptureType { + if m != nil { + return m.CaptureType + } + return nil +} + +func (x *WirelessRequest) GetAccessType() *AccessCaptureType { + if x, ok := x.GetCaptureType().(*WirelessRequest_AccessType); ok { + return x.AccessType + } + return nil +} + +func (x *WirelessRequest) GetScanType() *ScanCaptureType { + if x, ok := x.GetCaptureType().(*WirelessRequest_ScanType); ok { + return x.ScanType + } + return nil +} + +type isWirelessRequest_CaptureType interface { + isWirelessRequest_CaptureType() +} + +type WirelessRequest_AccessType struct { + AccessType *AccessCaptureType `protobuf:"bytes,1,opt,name=access_type,json=accessType,proto3,oneof"` +} + +type WirelessRequest_ScanType struct { + ScanType *ScanCaptureType `protobuf:"bytes,2,opt,name=scan_type,json=scanType,proto3,oneof"` +} + +func (*WirelessRequest_AccessType) isWirelessRequest_CaptureType() {} + +func (*WirelessRequest_ScanType) isWirelessRequest_CaptureType() {} + +type PcapRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to RequestType: + // + // *PcapRequest_WiredRequest + // *PcapRequest_WirelessRequest + RequestType isPcapRequest_RequestType `protobuf_oneof:"request_type"` + TrimPayload uint32 `protobuf:"varint,3,opt,name=trim_payload,json=trimPayload,proto3" json:"trim_payload,omitempty"` + PacketCount uint32 `protobuf:"varint,4,opt,name=packet_count,json=packetCount,proto3" json:"packet_count,omitempty"` + Duration uint64 `protobuf:"varint,5,opt,name=duration,proto3" json:"duration,omitempty"` +} + +func (x *PcapRequest) Reset() { + *x = PcapRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_packet_capture_packet_capture_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PcapRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PcapRequest) ProtoMessage() {} + +func (x *PcapRequest) ProtoReflect() protoreflect.Message { + mi := &file_packet_capture_packet_capture_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PcapRequest.ProtoReflect.Descriptor instead. +func (*PcapRequest) Descriptor() ([]byte, []int) { + return file_packet_capture_packet_capture_proto_rawDescGZIP(), []int{7} +} + +func (m *PcapRequest) GetRequestType() isPcapRequest_RequestType { + if m != nil { + return m.RequestType + } + return nil +} + +func (x *PcapRequest) GetWiredRequest() *WiredRequest { + if x, ok := x.GetRequestType().(*PcapRequest_WiredRequest); ok { + return x.WiredRequest + } + return nil +} + +func (x *PcapRequest) GetWirelessRequest() *WirelessRequest { + if x, ok := x.GetRequestType().(*PcapRequest_WirelessRequest); ok { + return x.WirelessRequest + } + return nil +} + +func (x *PcapRequest) GetTrimPayload() uint32 { + if x != nil { + return x.TrimPayload + } + return 0 +} + +func (x *PcapRequest) GetPacketCount() uint32 { + if x != nil { + return x.PacketCount + } + return 0 +} + +func (x *PcapRequest) GetDuration() uint64 { + if x != nil { + return x.Duration + } + return 0 +} + +type isPcapRequest_RequestType interface { + isPcapRequest_RequestType() +} + +type PcapRequest_WiredRequest struct { + WiredRequest *WiredRequest `protobuf:"bytes,1,opt,name=wired_request,json=wiredRequest,proto3,oneof"` +} + +type PcapRequest_WirelessRequest struct { + WirelessRequest *WirelessRequest `protobuf:"bytes,2,opt,name=wireless_request,json=wirelessRequest,proto3,oneof"` +} + +func (*PcapRequest_WiredRequest) isPcapRequest_RequestType() {} + +func (*PcapRequest_WirelessRequest) isPcapRequest_RequestType() {} + +type Packet struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` +} + +func (x *Packet) Reset() { + *x = Packet{} + if protoimpl.UnsafeEnabled { + mi := &file_packet_capture_packet_capture_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Packet) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Packet) ProtoMessage() {} + +func (x *Packet) ProtoReflect() protoreflect.Message { + mi := &file_packet_capture_packet_capture_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Packet.ProtoReflect.Descriptor instead. +func (*Packet) Descriptor() ([]byte, []int) { + return file_packet_capture_packet_capture_proto_rawDescGZIP(), []int{8} +} + +func (x *Packet) GetData() []byte { + if x != nil { + return x.Data + } + return nil +} + +type PcapResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Packets []*Packet `protobuf:"bytes,1,rep,name=packets,proto3" json:"packets,omitempty"` +} + +func (x *PcapResponse) Reset() { + *x = PcapResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_packet_capture_packet_capture_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PcapResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PcapResponse) ProtoMessage() {} + +func (x *PcapResponse) ProtoReflect() protoreflect.Message { + mi := &file_packet_capture_packet_capture_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PcapResponse.ProtoReflect.Descriptor instead. +func (*PcapResponse) Descriptor() ([]byte, []int) { + return file_packet_capture_packet_capture_proto_rawDescGZIP(), []int{9} +} + +func (x *PcapResponse) GetPackets() []*Packet { + if x != nil { + return x.Packets + } + return nil +} + +var File_packet_capture_packet_capture_proto protoreflect.FileDescriptor + +var file_packet_capture_packet_capture_proto_rawDesc = []byte{ + 0x0a, 0x23, 0x70, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x5f, 0x63, 0x61, 0x70, 0x74, 0x75, 0x72, 0x65, + 0x2f, 0x70, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x5f, 0x63, 0x61, 0x70, 0x74, 0x75, 0x72, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x09, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x70, 0x63, 0x61, 0x70, + 0x22, 0xb8, 0x01, 0x0a, 0x11, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x43, 0x61, 0x70, 0x74, 0x75, + 0x72, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x3f, 0x0a, 0x0e, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, + 0x69, 0x6e, 0x67, 0x5f, 0x62, 0x61, 0x6e, 0x64, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0e, 0x32, 0x18, + 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x70, 0x63, 0x61, 0x70, 0x2e, 0x4f, 0x70, 0x65, 0x72, 0x61, + 0x74, 0x69, 0x6e, 0x67, 0x42, 0x61, 0x6e, 0x64, 0x52, 0x0d, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, + 0x69, 0x6e, 0x67, 0x42, 0x61, 0x6e, 0x64, 0x12, 0x14, 0x0a, 0x04, 0x73, 0x73, 0x69, 0x64, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x04, 0x73, 0x73, 0x69, 0x64, 0x12, 0x12, 0x0a, + 0x03, 0x6d, 0x61, 0x63, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x03, 0x6d, 0x61, + 0x63, 0x12, 0x29, 0x0a, 0x10, 0x70, 0x72, 0x6f, 0x6d, 0x69, 0x73, 0x63, 0x75, 0x6f, 0x75, 0x73, + 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0f, 0x70, 0x72, 0x6f, + 0x6d, 0x69, 0x73, 0x63, 0x75, 0x6f, 0x75, 0x73, 0x4d, 0x6f, 0x64, 0x65, 0x42, 0x0d, 0x0a, 0x0b, + 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x22, 0x65, 0x0a, 0x0b, 0x43, + 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x68, + 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x68, 0x61, + 0x6e, 0x6e, 0x65, 0x6c, 0x12, 0x3c, 0x0a, 0x0d, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x5f, + 0x77, 0x69, 0x64, 0x74, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x17, 0x2e, 0x67, 0x6e, + 0x6f, 0x69, 0x2e, 0x70, 0x63, 0x61, 0x70, 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x57, + 0x69, 0x64, 0x74, 0x68, 0x52, 0x0c, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x57, 0x69, 0x64, + 0x74, 0x68, 0x22, 0x8e, 0x01, 0x0a, 0x10, 0x42, 0x61, 0x6e, 0x64, 0x43, 0x68, 0x61, 0x6e, 0x6e, + 0x65, 0x6c, 0x43, 0x6f, 0x6d, 0x62, 0x6f, 0x12, 0x3f, 0x0a, 0x0e, 0x6f, 0x70, 0x65, 0x72, 0x61, + 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x62, 0x61, 0x6e, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, + 0x18, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x70, 0x63, 0x61, 0x70, 0x2e, 0x4f, 0x70, 0x65, 0x72, + 0x61, 0x74, 0x69, 0x6e, 0x67, 0x42, 0x61, 0x6e, 0x64, 0x52, 0x0d, 0x6f, 0x70, 0x65, 0x72, 0x61, + 0x74, 0x69, 0x6e, 0x67, 0x42, 0x61, 0x6e, 0x64, 0x12, 0x39, 0x0a, 0x0c, 0x63, 0x68, 0x61, 0x6e, + 0x6e, 0x65, 0x6c, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, + 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x70, 0x63, 0x61, 0x70, 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x6e, + 0x65, 0x6c, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x0b, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x49, + 0x6e, 0x66, 0x6f, 0x22, 0x63, 0x0a, 0x0f, 0x53, 0x63, 0x61, 0x6e, 0x43, 0x61, 0x70, 0x74, 0x75, + 0x72, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x31, 0x0a, 0x05, 0x63, 0x6f, 0x6d, 0x62, 0x6f, 0x18, + 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x70, 0x63, 0x61, + 0x70, 0x2e, 0x42, 0x61, 0x6e, 0x64, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x43, 0x6f, 0x6d, + 0x62, 0x6f, 0x52, 0x05, 0x63, 0x6f, 0x6d, 0x62, 0x6f, 0x12, 0x1d, 0x0a, 0x0a, 0x64, 0x77, 0x65, + 0x6c, 0x6c, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x64, + 0x77, 0x65, 0x6c, 0x6c, 0x54, 0x69, 0x6d, 0x65, 0x22, 0xb6, 0x01, 0x0a, 0x06, 0x46, 0x69, 0x6c, + 0x74, 0x65, 0x72, 0x12, 0x1f, 0x0a, 0x0b, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x5f, 0x6e, 0x61, + 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, + 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x73, 0x72, 0x63, 0x5f, 0x6e, 0x65, 0x74, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x72, 0x63, 0x4e, 0x65, 0x74, 0x12, 0x19, 0x0a, + 0x08, 0x64, 0x65, 0x73, 0x74, 0x5f, 0x6e, 0x65, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x07, 0x64, 0x65, 0x73, 0x74, 0x4e, 0x65, 0x74, 0x12, 0x2f, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x63, 0x6f, 0x6c, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0e, 0x32, 0x13, 0x2e, 0x67, 0x6e, 0x6f, + 0x69, 0x2e, 0x70, 0x63, 0x61, 0x70, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x52, + 0x08, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x6f, 0x72, + 0x74, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0d, 0x52, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x12, 0x0a, + 0x04, 0x76, 0x6c, 0x61, 0x6e, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0d, 0x52, 0x04, 0x76, 0x6c, 0x61, + 0x6e, 0x22, 0xc7, 0x01, 0x0a, 0x0c, 0x57, 0x69, 0x72, 0x65, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x69, 0x66, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x06, 0x69, 0x66, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x32, 0x0a, 0x09, 0x64, 0x69, + 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x14, 0x2e, + 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x70, 0x63, 0x61, 0x70, 0x2e, 0x44, 0x69, 0x72, 0x65, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x52, 0x09, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2f, + 0x0a, 0x12, 0x74, 0x63, 0x70, 0x64, 0x75, 0x6d, 0x70, 0x5f, 0x65, 0x78, 0x70, 0x72, 0x65, 0x73, + 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x11, 0x74, 0x63, + 0x70, 0x64, 0x75, 0x6d, 0x70, 0x45, 0x78, 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, + 0x2b, 0x0a, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x11, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x70, 0x63, 0x61, 0x70, 0x2e, 0x46, 0x69, 0x6c, 0x74, + 0x65, 0x72, 0x48, 0x00, 0x52, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x42, 0x0d, 0x0a, 0x0b, + 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x22, 0x9d, 0x01, 0x0a, 0x0f, + 0x57, 0x69, 0x72, 0x65, 0x6c, 0x65, 0x73, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x3f, 0x0a, 0x0b, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x70, 0x63, 0x61, 0x70, + 0x2e, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x43, 0x61, 0x70, 0x74, 0x75, 0x72, 0x65, 0x54, 0x79, + 0x70, 0x65, 0x48, 0x00, 0x52, 0x0a, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x79, 0x70, 0x65, + 0x12, 0x39, 0x0a, 0x09, 0x73, 0x63, 0x61, 0x6e, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x70, 0x63, 0x61, 0x70, 0x2e, + 0x53, 0x63, 0x61, 0x6e, 0x43, 0x61, 0x70, 0x74, 0x75, 0x72, 0x65, 0x54, 0x79, 0x70, 0x65, 0x48, + 0x00, 0x52, 0x08, 0x73, 0x63, 0x61, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x42, 0x0e, 0x0a, 0x0c, 0x63, + 0x61, 0x70, 0x74, 0x75, 0x72, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x22, 0x88, 0x02, 0x0a, 0x0b, + 0x50, 0x63, 0x61, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3e, 0x0a, 0x0d, 0x77, + 0x69, 0x72, 0x65, 0x64, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x70, 0x63, 0x61, 0x70, 0x2e, 0x57, + 0x69, 0x72, 0x65, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x0c, 0x77, + 0x69, 0x72, 0x65, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x47, 0x0a, 0x10, 0x77, + 0x69, 0x72, 0x65, 0x6c, 0x65, 0x73, 0x73, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x70, 0x63, 0x61, + 0x70, 0x2e, 0x57, 0x69, 0x72, 0x65, 0x6c, 0x65, 0x73, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x48, 0x00, 0x52, 0x0f, 0x77, 0x69, 0x72, 0x65, 0x6c, 0x65, 0x73, 0x73, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x74, 0x72, 0x69, 0x6d, 0x5f, 0x70, 0x61, 0x79, + 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0b, 0x74, 0x72, 0x69, 0x6d, + 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x70, 0x61, 0x63, 0x6b, 0x65, + 0x74, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0b, 0x70, + 0x61, 0x63, 0x6b, 0x65, 0x74, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x64, 0x75, + 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x64, 0x75, + 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x0e, 0x0a, 0x0c, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x22, 0x1c, 0x0a, 0x06, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, + 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, + 0x64, 0x61, 0x74, 0x61, 0x22, 0x3b, 0x0a, 0x0c, 0x50, 0x63, 0x61, 0x70, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2b, 0x0a, 0x07, 0x70, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x18, + 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x70, 0x63, 0x61, + 0x70, 0x2e, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x07, 0x70, 0x61, 0x63, 0x6b, 0x65, 0x74, + 0x73, 0x2a, 0x44, 0x0a, 0x0d, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6e, 0x67, 0x42, 0x61, + 0x6e, 0x64, 0x12, 0x0b, 0x0a, 0x07, 0x42, 0x41, 0x4e, 0x44, 0x5f, 0x32, 0x47, 0x10, 0x00, 0x12, + 0x0b, 0x0a, 0x07, 0x42, 0x41, 0x4e, 0x44, 0x5f, 0x35, 0x47, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, + 0x42, 0x41, 0x4e, 0x44, 0x5f, 0x36, 0x47, 0x10, 0x02, 0x12, 0x0c, 0x0a, 0x08, 0x42, 0x41, 0x4e, + 0x44, 0x5f, 0x41, 0x4c, 0x4c, 0x10, 0x03, 0x2a, 0x1c, 0x0a, 0x08, 0x50, 0x72, 0x6f, 0x74, 0x6f, + 0x63, 0x6f, 0x6c, 0x12, 0x07, 0x0a, 0x03, 0x54, 0x43, 0x50, 0x10, 0x00, 0x12, 0x07, 0x0a, 0x03, + 0x55, 0x44, 0x50, 0x10, 0x01, 0x2a, 0x25, 0x0a, 0x09, 0x44, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x12, 0x06, 0x0a, 0x02, 0x52, 0x58, 0x10, 0x00, 0x12, 0x06, 0x0a, 0x02, 0x54, 0x58, + 0x10, 0x01, 0x12, 0x08, 0x0a, 0x04, 0x42, 0x4f, 0x54, 0x48, 0x10, 0x02, 0x2a, 0x53, 0x0a, 0x0c, + 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x57, 0x69, 0x64, 0x74, 0x68, 0x12, 0x0f, 0x0a, 0x0b, + 0x57, 0x49, 0x44, 0x54, 0x48, 0x5f, 0x32, 0x30, 0x4d, 0x48, 0x5a, 0x10, 0x00, 0x12, 0x0f, 0x0a, + 0x0b, 0x57, 0x49, 0x44, 0x54, 0x48, 0x5f, 0x34, 0x30, 0x4d, 0x48, 0x5a, 0x10, 0x01, 0x12, 0x0f, + 0x0a, 0x0b, 0x57, 0x49, 0x44, 0x54, 0x48, 0x5f, 0x38, 0x30, 0x4d, 0x48, 0x5a, 0x10, 0x02, 0x12, + 0x10, 0x0a, 0x0c, 0x57, 0x49, 0x44, 0x54, 0x48, 0x5f, 0x31, 0x36, 0x30, 0x4d, 0x48, 0x5a, 0x10, + 0x03, 0x32, 0x4c, 0x0a, 0x0d, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x43, 0x61, 0x70, 0x74, 0x75, + 0x72, 0x65, 0x12, 0x3b, 0x0a, 0x04, 0x50, 0x63, 0x61, 0x70, 0x12, 0x16, 0x2e, 0x67, 0x6e, 0x6f, + 0x69, 0x2e, 0x70, 0x63, 0x61, 0x70, 0x2e, 0x50, 0x63, 0x61, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x70, 0x63, 0x61, 0x70, 0x2e, 0x50, + 0x63, 0x61, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x30, 0x01, 0x42, + 0x30, 0x5a, 0x2e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x70, + 0x65, 0x6e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x67, 0x6e, 0x6f, 0x69, 0x2f, 0x70, 0x61, + 0x63, 0x6b, 0x65, 0x74, 0x5f, 0x63, 0x61, 0x70, 0x74, 0x75, 0x72, 0x65, 0x3b, 0x70, 0x63, 0x61, + 0x70, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_packet_capture_packet_capture_proto_rawDescOnce sync.Once + file_packet_capture_packet_capture_proto_rawDescData = file_packet_capture_packet_capture_proto_rawDesc +) + +func file_packet_capture_packet_capture_proto_rawDescGZIP() []byte { + file_packet_capture_packet_capture_proto_rawDescOnce.Do(func() { + file_packet_capture_packet_capture_proto_rawDescData = protoimpl.X.CompressGZIP(file_packet_capture_packet_capture_proto_rawDescData) + }) + return file_packet_capture_packet_capture_proto_rawDescData +} + +var file_packet_capture_packet_capture_proto_enumTypes = make([]protoimpl.EnumInfo, 4) +var file_packet_capture_packet_capture_proto_msgTypes = make([]protoimpl.MessageInfo, 10) +var file_packet_capture_packet_capture_proto_goTypes = []interface{}{ + (OperatingBand)(0), // 0: gnoi.pcap.OperatingBand + (Protocol)(0), // 1: gnoi.pcap.Protocol + (Direction)(0), // 2: gnoi.pcap.Direction + (ChannelWidth)(0), // 3: gnoi.pcap.ChannelWidth + (*AccessCaptureType)(nil), // 4: gnoi.pcap.AccessCaptureType + (*ChannelInfo)(nil), // 5: gnoi.pcap.ChannelInfo + (*BandChannelCombo)(nil), // 6: gnoi.pcap.BandChannelCombo + (*ScanCaptureType)(nil), // 7: gnoi.pcap.ScanCaptureType + (*Filter)(nil), // 8: gnoi.pcap.Filter + (*WiredRequest)(nil), // 9: gnoi.pcap.WiredRequest + (*WirelessRequest)(nil), // 10: gnoi.pcap.WirelessRequest + (*PcapRequest)(nil), // 11: gnoi.pcap.PcapRequest + (*Packet)(nil), // 12: gnoi.pcap.Packet + (*PcapResponse)(nil), // 13: gnoi.pcap.PcapResponse +} +var file_packet_capture_packet_capture_proto_depIdxs = []int32{ + 0, // 0: gnoi.pcap.AccessCaptureType.operating_band:type_name -> gnoi.pcap.OperatingBand + 3, // 1: gnoi.pcap.ChannelInfo.channel_width:type_name -> gnoi.pcap.ChannelWidth + 0, // 2: gnoi.pcap.BandChannelCombo.operating_band:type_name -> gnoi.pcap.OperatingBand + 5, // 3: gnoi.pcap.BandChannelCombo.channel_info:type_name -> gnoi.pcap.ChannelInfo + 6, // 4: gnoi.pcap.ScanCaptureType.combo:type_name -> gnoi.pcap.BandChannelCombo + 1, // 5: gnoi.pcap.Filter.protocol:type_name -> gnoi.pcap.Protocol + 2, // 6: gnoi.pcap.WiredRequest.direction:type_name -> gnoi.pcap.Direction + 8, // 7: gnoi.pcap.WiredRequest.filter:type_name -> gnoi.pcap.Filter + 4, // 8: gnoi.pcap.WirelessRequest.access_type:type_name -> gnoi.pcap.AccessCaptureType + 7, // 9: gnoi.pcap.WirelessRequest.scan_type:type_name -> gnoi.pcap.ScanCaptureType + 9, // 10: gnoi.pcap.PcapRequest.wired_request:type_name -> gnoi.pcap.WiredRequest + 10, // 11: gnoi.pcap.PcapRequest.wireless_request:type_name -> gnoi.pcap.WirelessRequest + 12, // 12: gnoi.pcap.PcapResponse.packets:type_name -> gnoi.pcap.Packet + 11, // 13: gnoi.pcap.PacketCapture.Pcap:input_type -> gnoi.pcap.PcapRequest + 13, // 14: gnoi.pcap.PacketCapture.Pcap:output_type -> gnoi.pcap.PcapResponse + 14, // [14:15] is the sub-list for method output_type + 13, // [13:14] is the sub-list for method input_type + 13, // [13:13] is the sub-list for extension type_name + 13, // [13:13] is the sub-list for extension extendee + 0, // [0:13] is the sub-list for field type_name +} + +func init() { file_packet_capture_packet_capture_proto_init() } +func file_packet_capture_packet_capture_proto_init() { + if File_packet_capture_packet_capture_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_packet_capture_packet_capture_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AccessCaptureType); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_packet_capture_packet_capture_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChannelInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_packet_capture_packet_capture_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BandChannelCombo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_packet_capture_packet_capture_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ScanCaptureType); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_packet_capture_packet_capture_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Filter); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_packet_capture_packet_capture_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*WiredRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_packet_capture_packet_capture_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*WirelessRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_packet_capture_packet_capture_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PcapRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_packet_capture_packet_capture_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Packet); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_packet_capture_packet_capture_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PcapResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_packet_capture_packet_capture_proto_msgTypes[0].OneofWrappers = []interface{}{ + (*AccessCaptureType_Ssid)(nil), + (*AccessCaptureType_Mac)(nil), + } + file_packet_capture_packet_capture_proto_msgTypes[5].OneofWrappers = []interface{}{ + (*WiredRequest_TcpdumpExpression)(nil), + (*WiredRequest_Filter)(nil), + } + file_packet_capture_packet_capture_proto_msgTypes[6].OneofWrappers = []interface{}{ + (*WirelessRequest_AccessType)(nil), + (*WirelessRequest_ScanType)(nil), + } + file_packet_capture_packet_capture_proto_msgTypes[7].OneofWrappers = []interface{}{ + (*PcapRequest_WiredRequest)(nil), + (*PcapRequest_WirelessRequest)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_packet_capture_packet_capture_proto_rawDesc, + NumEnums: 4, + NumMessages: 10, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_packet_capture_packet_capture_proto_goTypes, + DependencyIndexes: file_packet_capture_packet_capture_proto_depIdxs, + EnumInfos: file_packet_capture_packet_capture_proto_enumTypes, + MessageInfos: file_packet_capture_packet_capture_proto_msgTypes, + }.Build() + File_packet_capture_packet_capture_proto = out.File + file_packet_capture_packet_capture_proto_rawDesc = nil + file_packet_capture_packet_capture_proto_goTypes = nil + file_packet_capture_packet_capture_proto_depIdxs = nil +} diff --git a/src/sonic-framework/gnoi/packet_capture/packet_capture.proto b/src/sonic-framework/gnoi/packet_capture/packet_capture.proto new file mode 100644 index 000000000000..666154d98126 --- /dev/null +++ b/src/sonic-framework/gnoi/packet_capture/packet_capture.proto @@ -0,0 +1,176 @@ +// +// Copyright 2024 Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +syntax = "proto3"; + +package gnoi.pcap; + +option go_package = "github.com/openconfig/gnoi/packet_capture;pcap"; + +// The PacketCapture service exported by targets. +service PacketCapture { + // Pcap starts packet capture on the target and streams back the results as + // raw data packets that should be appropriately decoded by the receiver. + // For example, most commonly an Ethernet decoder would be used for a typical + // WiredRequest. A WirelessRequest may require a Prism decoder or + // related 802.11 decoder. + rpc Pcap(PcapRequest) returns (stream PcapResponse) {} +} + +enum OperatingBand { + BAND_2G = 0; + BAND_5G = 1; + BAND_6G = 2; + BAND_ALL = 3; +} + +enum Protocol { + TCP = 0; + UDP = 1; +} + +enum Direction { + // When applied to an interface, the Direction of packets to capture, receive + // transmit, or both. + RX = 0; + TX = 1; + BOTH = 2; +} + +enum ChannelWidth { + WIDTH_20MHZ = 0; + WIDTH_40MHZ = 1; + WIDTH_80MHZ = 2; + WIDTH_160MHZ = 3; +} + +// The capture is performed on the operating access radio(s) and it is not +// client impacting. +message AccessCaptureType { + // Operating band: 2.4G, 5G, 6G. + repeated OperatingBand operating_band = 1; + oneof filter_type { + // Optional, SSID of a VAP. + string ssid = 2; + // Optional, MAC addresss matching a BSSID or a client MAC. + string mac = 3; + } + // Capture packets in promiscuous mode. When enabled, all possible packets + // meeting the criteria are captured. When disabled, only own tx/rx packets + // meeting the criteria are captured. + bool promiscuous_mode = 4; +} + +message ChannelInfo { + // Channels. + string channel = 1; + // Channel width: 20/40/80/160 MHz, if not specified defaults to 20MHz. + ChannelWidth channel_width = 2; +} + +// BandChannelCombo specifies the bands and channels to capture on. +message BandChannelCombo { + // Operating band: 2.4G, 5G, 6G. + OperatingBand operating_band = 1; + // Channel Info. + repeated ChannelInfo channel_info = 2; +} + +// A ScanCaptureType on a dedicated scan radio. If a dedicated scan radio does +// not exist, the device may turn an access radio(s) into scan radio(s), which +// may impact clients. +message ScanCaptureType { + repeated BandChannelCombo combo = 1; + // Channel capture duration in nanoseconds, if not specified + // defaults to something, supported by the platform. + uint64 dwell_time = 2; +} + +message Filter { + // Different types of filtering options. + + // filter_name can be a reference to a filter already configured on the device + // such as an ACL/class-map or other platform-specific abstraction that + // may allow for the configuration of other filtering not otherwise available. + string filter_name = 1; + // Source/destination net may be used to match traffic and should be specified + // using CIDR notation. eg. 1.1.1.1/32 + string src_net = 2; + string dest_net = 3; + repeated Protocol protocol = 4; + // The specific protocol port number to match, eg. HTTP=80. + repeated uint32 port = 5; + // A VLAN ID. + repeated uint32 vlan = 6; +} + +message WiredRequest { + // Interface name. + string ifname = 1; + // The Direction to capture from, if not specified defaults to BOTH. + Direction direction = 2; + // Filtering based on protocols. + oneof filter_type { + // A tcpdump expression: https://www.tcpdump.org/manpages/pcap-filter.7.html + // if raw expressions are supported by the device. + string tcpdump_expression = 3; + // A Filter as defined in a message. + Filter filter = 4; + } +} + +message WirelessRequest { + // A WirelessRequest may be on the access radio(s) or a dedicated scan + // radio(s). On a device with a dedicated scan radio, an AccessCaptureType or + // ScanCaptureType should not impact clients -- the access radios should not + // go off channel or stop servicing clients. On a device *without* a + // dedicated scan radio, an AccessCaptureType should not be client impacting. + // If ScanCaptureType is used on a device without a dedicated scan radio; the + // device MAY impact clients and honor the packet capture requirements. + oneof capture_type { + // Access radio. + AccessCaptureType access_type = 1; + // Scan radio. + ScanCaptureType scan_type = 2; + } +} + +message PcapRequest { + oneof request_type { + // Wired capture request. + WiredRequest wired_request = 1; + // Wireless capture request. + WirelessRequest wireless_request = 2; + } + // Bytes to trim the data during packet capture: 0 for entire packet. + uint32 trim_payload = 3; + // The number of pakets to capture, after which the capture will end; 0 for + // for unlimited. + uint32 packet_count = 4; + // Capture duration in nanoseconds; 0 for indefinite. + uint64 duration = 5; +} + +message Packet { + // The raw bytes making up the packet. + bytes data = 1; +} + +message PcapResponse { + // A packet is the raw network packet that must be decoded. Libraries exist + // for different languages for decoding. + // Python: https://scapy.readthedocs.io/en/latest/api/scapy.layers.html + // GoLang: https://github.com/google/gopacket/blob/master/layers/layertypes.go + repeated Packet packets = 1; +} diff --git a/src/sonic-framework/gnoi/packet_capture/packet_capture_grpc.pb.go b/src/sonic-framework/gnoi/packet_capture/packet_capture_grpc.pb.go new file mode 100755 index 000000000000..903bf46b057f --- /dev/null +++ b/src/sonic-framework/gnoi/packet_capture/packet_capture_grpc.pb.go @@ -0,0 +1,132 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.2.0 +// - protoc v3.21.10 +// source: packet_capture/packet_capture.proto + +package pcap + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +// PacketCaptureClient is the client API for PacketCapture service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type PacketCaptureClient interface { + Pcap(ctx context.Context, in *PcapRequest, opts ...grpc.CallOption) (PacketCapture_PcapClient, error) +} + +type packetCaptureClient struct { + cc grpc.ClientConnInterface +} + +func NewPacketCaptureClient(cc grpc.ClientConnInterface) PacketCaptureClient { + return &packetCaptureClient{cc} +} + +func (c *packetCaptureClient) Pcap(ctx context.Context, in *PcapRequest, opts ...grpc.CallOption) (PacketCapture_PcapClient, error) { + stream, err := c.cc.NewStream(ctx, &PacketCapture_ServiceDesc.Streams[0], "/gnoi.pcap.PacketCapture/Pcap", opts...) + if err != nil { + return nil, err + } + x := &packetCapturePcapClient{stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +type PacketCapture_PcapClient interface { + Recv() (*PcapResponse, error) + grpc.ClientStream +} + +type packetCapturePcapClient struct { + grpc.ClientStream +} + +func (x *packetCapturePcapClient) Recv() (*PcapResponse, error) { + m := new(PcapResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +// PacketCaptureServer is the server API for PacketCapture service. +// All implementations must embed UnimplementedPacketCaptureServer +// for forward compatibility +type PacketCaptureServer interface { + Pcap(*PcapRequest, PacketCapture_PcapServer) error + mustEmbedUnimplementedPacketCaptureServer() +} + +// UnimplementedPacketCaptureServer must be embedded to have forward compatible implementations. +type UnimplementedPacketCaptureServer struct { +} + +func (UnimplementedPacketCaptureServer) Pcap(*PcapRequest, PacketCapture_PcapServer) error { + return status.Errorf(codes.Unimplemented, "method Pcap not implemented") +} +func (UnimplementedPacketCaptureServer) mustEmbedUnimplementedPacketCaptureServer() {} + +// UnsafePacketCaptureServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to PacketCaptureServer will +// result in compilation errors. +type UnsafePacketCaptureServer interface { + mustEmbedUnimplementedPacketCaptureServer() +} + +func RegisterPacketCaptureServer(s grpc.ServiceRegistrar, srv PacketCaptureServer) { + s.RegisterService(&PacketCapture_ServiceDesc, srv) +} + +func _PacketCapture_Pcap_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(PcapRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(PacketCaptureServer).Pcap(m, &packetCapturePcapServer{stream}) +} + +type PacketCapture_PcapServer interface { + Send(*PcapResponse) error + grpc.ServerStream +} + +type packetCapturePcapServer struct { + grpc.ServerStream +} + +func (x *packetCapturePcapServer) Send(m *PcapResponse) error { + return x.ServerStream.SendMsg(m) +} + +// PacketCapture_ServiceDesc is the grpc.ServiceDesc for PacketCapture service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var PacketCapture_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "gnoi.pcap.PacketCapture", + HandlerType: (*PacketCaptureServer)(nil), + Methods: []grpc.MethodDesc{}, + Streams: []grpc.StreamDesc{ + { + StreamName: "Pcap", + Handler: _PacketCapture_Pcap_Handler, + ServerStreams: true, + }, + }, + Metadata: "packet_capture/packet_capture.proto", +} diff --git a/src/sonic-framework/gnoi/packet_link_qualification/BUILD.bazel b/src/sonic-framework/gnoi/packet_link_qualification/BUILD.bazel new file mode 100644 index 000000000000..592cac3009da --- /dev/null +++ b/src/sonic-framework/gnoi/packet_link_qualification/BUILD.bazel @@ -0,0 +1,67 @@ +load("@rules_proto//proto:defs.bzl", "proto_library") +load("@io_bazel_rules_go//go:def.bzl", "go_library") +load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library") +load("@com_github_grpc_grpc//bazel:cc_grpc_library.bzl", "cc_grpc_library") +load("//:common.bzl", "use_new_compilers") + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +package( + default_visibility = ["//visibility:public"], + licenses = ["notice"], +) + +use_new_compilers() + +proto_library( + name = "linkqual_proto", + srcs = ["packet_link_qualification.proto"], + visibility = ["//visibility:public"], + deps = [ + "//types:types_proto", + "@com_google_protobuf//:duration_proto", + "@com_google_protobuf//:timestamp_proto", + "@go_googleapis//google/rpc:status_proto", + ], +) + +go_proto_library( + name = "linkqual_go_proto", + compilers = [ + "go_protoc_gen_go", + "go_protoc_gen_go_grpc", + ], + importpath = "github.com/openconfig/gnoi/packet_link_qualification", + proto = ":linkqual_proto", + visibility = ["//visibility:public"], + deps = [ + "//types", + "@go_googleapis//google/rpc:status_go_proto", + ], +) + +go_library( + name = "linkqual", + embed = [":linkqual_go_proto"], + importpath = "github.com/openconfig/gnoi/linkqual", + visibility = ["//visibility:public"], +) + +go_library( + name = "packet_link_qualification", + embed = [":linkqual_go_proto"], + importpath = "github.com/openconfig/gnoi/packet_link_qualification", + visibility = ["//visibility:public"], +) diff --git a/src/sonic-framework/gnoi/packet_link_qualification/img/link_qual.svg b/src/sonic-framework/gnoi/packet_link_qualification/img/link_qual.svg new file mode 100644 index 000000000000..1e92f62ff033 --- /dev/null +++ b/src/sonic-framework/gnoi/packet_link_qualification/img/link_qual.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/sonic-framework/gnoi/packet_link_qualification/img/link_qual_ntp.svg b/src/sonic-framework/gnoi/packet_link_qualification/img/link_qual_ntp.svg new file mode 100644 index 000000000000..e80e0ca27d4f --- /dev/null +++ b/src/sonic-framework/gnoi/packet_link_qualification/img/link_qual_ntp.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/sonic-framework/gnoi/packet_link_qualification/index.md b/src/sonic-framework/gnoi/packet_link_qualification/index.md new file mode 100644 index 000000000000..973a444af26c --- /dev/null +++ b/src/sonic-framework/gnoi/packet_link_qualification/index.md @@ -0,0 +1,379 @@ +# Link Qualification Service v2 Definition + +## Background + +The link qualification service provides a way to certify link +quality on two devices. This service defines a protocol for setting up the peer +devices to allow for the generation of packets from one device to another and +validate those packets are sent and received, then restoring the devices to +their previous state. This service's intent is to allow for different +generation and reflection modes of operation based on the hardware capabilities +of the device. There is a standard report generated regardless of modes +selected and that common report can be used by upstream services to aggregate +network wide link quality. + +## TLDR + +### General flow + +![General Flow](img/link_qual.svg) + +### Specific requirements around the service + +#### Connectivity to devices during link qualification maybe interrupted + +Upon calling Create, the interfaces on the device will be put into a forwarding +mode which must not contain other traffic, control or data. This may cause the +generator or reflector endpoint to become unreachable. The service +implementation must gracefully handle this state. + +**Devices must return to pre-link qualification state after the link qualification has completed or errored** + +The service is not expected to persist state across reboots of the device. +Since no state is changed in the configuration of the device, on boot the +system should boot normally and there will be no side effects left from +previous link qualifications. + +During the link qualification the device must put the interfaces into a +`TESTING` `oper-status` for the duration of the qualification. Once complete, +the `oper-status` should be restored to the previous state. + +##### Devices must garbage collect results after some period to keep from filling up storage on the device + +The service should store at least 2 qualification results for each interface. +The results are not expected to persist across reboots of the device. + +##### The service implementation must support multiple generations of forwarding hardware which have different capabilities with regards to both generation and reflection of packets + +* Packet Generators +The preferred method for the generation of frames for the link qualification is +via a packet generator. This mode provides the most flexibility around packet +rates, packet sizes and packet content. + +* Packet Injectors +To support hardware which doesn't have a built in packet generator, link +qualification provides a packet injector mode to support a loop between both +endpoints in the qualification for packets to be injected and looped. + +* ASIC Loopback +The ASIC loopback mode allows for the loopback of frames to happen in the +forwarding path of the device. This enables the most comprehensive testing +results as all counters should be available to the qualification. This is the +preferred mode of reflection. + +* PMD Loopback +For devices which cannot implement an ASIC based loopback. The PMD loopback +mode can be supported. This mode allows for the interface to be looped back at +either the PMD or in the interface. This will likely limit what counters are +available for results on the reflector but can still validate the link. + +## Service Definition + +See [proto](packet_link_qualification.proto) for rpc and message definitions. + +### Capabilities + +Capabilities returns the endpoint types the device is able to support for link +qualifications. + +### Create + +Create will create the linkqualifcations for the provides interfaces on the +device. The provided configurations specific the id to be used by the qualifcation +as well as the endpoint type to be used. + +### Delete + +Delete will delete the qualifiction id from the device. If the qualifcation is not +in `QUALIFICATION_STATE_ERROR` or `QUALIFICATION_STATE_COMPLETED` the qualification +will be cancelled and torn down and deleted. + +### Get + +Get returns the current status and results for the provided qualfication id. + +### List + +List returns the list of all current and previous qualifications on the device. + +## Use Cases + +### Duplicate test ID called + +* Create with config.id=”Test1” for interface Ethernet1 +* While the above is still ongoing, Create with config.id=”Test1” for interface Ethernet2 +* Second call to Create will return `AlreadyExists` error code within the gRPC error + response. + +### Existing Qualification running on interface + +* StartPacketQualification with config.id=”Test1” for interface Ethernet1 +* After the above is completed, StartPacketQualification with config.id=”Test1” for interface Ethernet2 +* Second call to Create will return AlreadyExists error code + +### Duplicate id but called after previous id is deleted + +* Create with config.id=”Test1” for interface Ethernet1 +* Delete with id=”Test1” +* Create with config.id=”Test1” for interface Ethernet2 +* Second call to StartPacketQualification is expected to go through without errors. + +### How a based generator walks through setting itself up + +* Create call is made +* For all status errors described below are part of the individual qualification status + and not part of the RPC status. +* Service validates the `interface_name` is valid + * if not return `INVALID_PARAMETER` +* Service validates the `interface_name` is found + * if not return `NOT_FOUND` +* Service validates the test id doesn't conflict with existing tests + * if not return `ALREADY_EXISTS` +* Service validates the endpoint type is supported + * if not return `INVALID_PARAMETER` +* Service validates endpoint configuration + * if not return `INVALID_PARAMETER` + * status should return what parameters are invalid +* If the synchronization mode is NTP + * Validate that the service can start at that time it must be at least endpoint type setup time + current time away + * if not return `INVALID_PARAMETER` + * Mark status as `QUALIFICATION_STATE_IDLE` + * Wait for `start_time` - `min_setup_time` + * Begin Setup + * Mark status as `QUALIFICATION_STATE_SETUP` + * if the setup cannot be completed before `start_time` + * Mark status as `QUALIFICATION_STATE_ERROR` + * Begin Qualification at `start_time` + * Start the qualification run for duration providing updates to the result every `min_sample_interval` + * Mark status as `QUALIFICATION_STATE_RUNNING` + * Wait for `end_time` + * Mark status as `QUALIFICATION_STATE_TEARDOWN` + * If `teardown_time` is set + * Wait until `teardown_time` + * Begin teardown + * if the teardown cannot be completed + * Mark status as `QUALIFICATION_STATE_ERROR` + * Mark status as `QUALIFICATION_STATE_COMPLETED` +* if the synchronization mode is RPC + * Validate the synchronization parameters for setup / teardown + * If any errors have occurred + * Mark status as `QUALIFICATION_STATE_ERROR` + * if any failures occur during the following steps also mark status as `QUALIFICATION_STATE_ERROR` + * Mark status as `QUALIFICATION_STATE_IDLE` + * Mark status as `QUALIFICATION_STATE_SETUP` + * Wait for `pre_sync_duration` + * Start the setup for the setup + * if the setup cannot be completed in `setup_duration` + * Mark status as `QUALIFICATION_STATE_ERROR` + * Once setup, wait for any remaining time based on the setup + * Start the qualification run for duration providing updates to the result every `min_sample_interval` + * Mark status as `QUALIFICATION_STATE_RUNNING` + * Mark status as `QUALIFICATION_STATE_TEARDOWN` + * Wait for `post_sync_duration` + * Begin teardown + * Mark status as `QUALIFICATION_STATE_TEARDOWN` + * if the teardown cannot be completed in `teardown_duration` + * Mark status as `QUALIFICATION_STATE_ERROR` + * Wait for the remaining `teardown_duration` + * Mark status as `QUALIFICATION_STATE_COMPLETED` + +### Call graph for NTP synchronization + +![NTP Flow](img/link_qual_ntp.svg) + +### Call example for RPC synchronization with packet injector and PMD loopback + +* Caller gets Capabilities + * generator supports: + +``` +message PacketInjectorCapabilities { + min_mtu: 64 + max_mtu: 1500 + min_injected_packets: 1 + max_injected_packets: 1000 + min_setup_duration: "30s" + min_teardown_duration: "30s" + min_sample_interval: "60s" + loopback_modes: PACKET_INJECTOR_LOOPBACK_MODE_PMD +} +``` + +* loopback supports: + +``` +message PmdLoopbackCapabilities { + min_setup_duration: "10s" + min_teardown_duration: "10s" +} +``` + +* Caller calculates the `pre_sync_duration`, `setup_duration`, `teardown_duration` and `post_sync_duration` for each side + * **This assumes that both rpc's are sent in parallel** + * Generator + * `pre_sync_duration` = 10s + * remote setup time so we know the loopback is ready for us to generate packets + * `setup_duration` = 30s + * Setup time desired for this endpoint type. cannot be less than `min_setup_duration` provided as a capability. + * Start sending packets + * `duration` = 180s + * qualification duration + * stats must be updated every `min_sample_interval` + * `post_sync_duration` = 0s + * Generators should not need to set this value but may for synchronization issues with remote sides. + * `teardown_duration` = 30s + * The generator side teardown duration + * The `min_teardown_duration` will be used if left unset + * Reflector + * `pre_sync_duration` = 0s + * Loopbacks should not need to set this value but may for synchronization issues with remote sides. + * `setup_duration` = 40s + * This value should be the sum of the remote `setup_duration` and the local `min_setup_duration`. This value allows for the sides to be synchronized at the qualification start. + * `duration` = 180s + * qualification duration + * stats must be updated every `min_sample_interval` + * `post_sync_duration` = 30s + * the reflector side should hold up the loopback until the remote side has finished teardown + * `teardown_duration` = 10s + * The reflector side teardown duration + * The `min_teardown_duration` will be used if left unset +* Call generator and reflector Create() +* On the device acting as the Generator (PacketInjector) + * Validate that `setup_duration` is >= `min_setup_duration` + * Validate that `teardown_duration` is >= `min_teardown_duration` + * Schedule the work with backend which should being with waiting for `pre_sync_duration` if set + * Once the `pre_sync_duration` duration is reached + * Begin putting interface into generator mode + * If `setup_duration` has not been reached wait for the remaining duration + * Take first snapshot of packets and rates for the initial result + * Repeat taking snapshots of results every `min_sample_interval` + * Once duration is reached wait for `post_sync_duration` if set (for generators this value is not expected to be set) + * After `post_sync_duration` is reached begin teardown +* Reflector (PmdLoopback) + * Validate that `setup_duration` is >= `min_setup_duration` + * Validate that `teardown_duration` is >= `min_teardown_duration` + * Schedule the work with backend which should being with waiting for `pre_sync_duration` if set (for reflector this value is not expected to be set) + * Once the `pre_sync_duration` duration is reached + * Begin putting interface into reflector mode + * If `setup_duration` has not been reached wait for the remaining duration + * Take first snapshot of packets and rates for the initial result + * Repeat taking snapshots of results every update\_interval + * Once duration is reached wait for `post_sync_duration` if set + * After `post_sync_duration` is reached begin teardown + +### Call graph for Mixed synchronization generator RPC / loopback NTP + +* Caller gets Capabilities + * generator supports: + + ``` + message PacketGeneratorCapabilities { + max_bps: 250000000000 + max_pps: 200000000 + min_mtu: 64 + max_mtu: 9216 + min_setup_duration: "2s" + min_teardown_duration: "2s" + min_sample_interval: "1s" + } + ``` + +* loopback supports: + + ``` + message PmdLoopbackCapabilities { + min_setup_duration: "10s" + min_teardown_duration: "10s" + } + ``` + +* Caller calculates the `pre_sync_duration`, `setup_duration`, `teardown_duration` and `post_sync_duration` for each side + * **This assumes that both rpc's are sent in parallel** + * Generator + + ``` + message NTPSyncedTiming { + start_time: time.Now()+"60s" + end_time: time.Now()+"180s" + } + ``` + + * `start_time` + * adding 60 secs just to show how to balance out the loopback side via RPC + * `end_time` = `start_time` + "180s" + * qualification duration + * stats must be updated every `min_sample_interval` + * `teardown_time` + * left unset as we want to the generator to teardown immediately after `end_time` + * Reflector + * `pre_sync_duration` = 0s + * Reflectors should not need to set this value unless the RPC's are dispatched synchronously. + * `setup_duration` = 60s + * This value should be the sum of the remote `setup_duration` and the local `setup_duration`. This value allows for the sides to be synchronized at the qualification start. + * `duration` = 180s + * qualification duration + * stats must be updated every `min_sample_interval` + * `post_sync_duration` = 2s + * the reflector side should hold up the loopback until the remote side has finished teardown + * `teardown_duration` = 10s + * The reflector side teardown duration + * The `min_teardown_duration` will be used if left unset +* Call generator and reflector Create() +* Generator + * Validate that `start_time >= time.Now() + min_setup_duration` + * if `teardown_time` is set + * `teardown_time` must be >= `end_time` + * If not, `teardown_time` will be `end_time` + * Begin setup at `start_time` - `min_setup_duration` + * Take first snapshot of packets and rates for the initial result + * Repeat taking snapshots of results every `min_sample_interval` until `end_time` + * if `teardown_time` is not set, begin teardown. + * if set wait until `teardown_time` then begin teardown + * Once the teardown is complete, take the final reading on `packets_sent`, `packets_received`, `packets_error` and `packets_dropped` at the Generator end. + * `qualification_rate_bytes_per_second` counter should be computed only during the test duration using the bytes sent in the `min_sample_interval`. +* Reflector + * Validate that `setup_duration` is >= `min_setup_duration` + * Validate that `teardown_duration` is >= `min_teardown_duration` + * Schedule the work with backend which should being with waiting for `pre_sync_duration` if set (for reflector this value is not expected to be set) + * Once the `pre_sync_duration` duration is reached + * Begin putting interface into reflector mode + * If `setup_duration` has not been reached wait for the remaining duration + * Take first snapshot of packets and rates for the initial result + * Repeat taking snapshots of results every `update_interva`l + * Once duration is reached wait for `post_sync_duration` if set + * After `post_sync_duration` is reached begin teardown + * Once the teardown is complete, take the final reading on `packets_sent`, `packets_received`, `packets_error` and `packets_dropped` at the reflector end. + * `qualification_rate_bytes_per_second` counter should be computed only during the test duration using the bytes sent in the `min_sample_interval`. + +### Workflow for Delete in the case of canceling early + +* A caller may want cancel a running qualification early due to several administrative reasons + * Noticing the errors have already exceeded a threshold + * Wanting to change the rate or mtu for a running test + * Canceling it as might have been scheduled at the wrong time +* The expectation would be that calling delete before completion would cause the service to immediately cancel the packet ongoing test by + * Setting the status into `QUALIFICATION_STATE_ERROR` + * The status would be `CANCELLED` in the embedded status message + * The service would immediately start a teardown on the qualification + * Once the qualification is torn down the results would be deleted. + +## Future work + +### Inband signaled link qualification + +Using this API as a general purpose framework, it could be extended to support +an inband signaled mode of operation. In the currently defined implementations +the calling service must orchestrate both ends of the link via create / get / +delete calls. An inband version could allow the caller to only need to +orchestrate the one side of the link. Also there could even be internal use +cases in which the devices themselves could initiate a link qualification +without external prompting. + +### Link round-trip or one-way latency measurements + +Some service providers use measured link round trip or one way latency as part of their +qualification process for link turn-up, often by comparing such values with those the +circuit design predicts. For example, this informs us whether the path was built on +“the correct side of the mountain”. A generator could be defined that passes timestamps +in-band in both directions that the devices at the ends of the link under test would +interpret to produce the round trip and potentially the one-way delay timing. diff --git a/src/sonic-framework/gnoi/packet_link_qualification/packet_link_qualification.pb.go b/src/sonic-framework/gnoi/packet_link_qualification/packet_link_qualification.pb.go new file mode 100644 index 000000000000..9433476ccdc9 --- /dev/null +++ b/src/sonic-framework/gnoi/packet_link_qualification/packet_link_qualification.pb.go @@ -0,0 +1,2720 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.30.0 +// protoc v3.21.10 +// source: packet_link_qualification/packet_link_qualification.proto + +package linkqual + +import ( + _ "github.com/openconfig/gnoi/types" + status "google.golang.org/genproto/googleapis/rpc/status" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + durationpb "google.golang.org/protobuf/types/known/durationpb" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type QualificationState int32 + +const ( + QualificationState_QUALIFICATION_STATE_UNSPECIFIED QualificationState = 0 + QualificationState_QUALIFICATION_STATE_ERROR QualificationState = 1 + QualificationState_QUALIFICATION_STATE_IDLE QualificationState = 2 + QualificationState_QUALIFICATION_STATE_SETUP QualificationState = 3 + QualificationState_QUALIFICATION_STATE_RUNNING QualificationState = 4 + QualificationState_QUALIFICATION_STATE_TEARDOWN QualificationState = 5 + QualificationState_QUALIFICATION_STATE_COMPLETED QualificationState = 6 +) + +// Enum value maps for QualificationState. +var ( + QualificationState_name = map[int32]string{ + 0: "QUALIFICATION_STATE_UNSPECIFIED", + 1: "QUALIFICATION_STATE_ERROR", + 2: "QUALIFICATION_STATE_IDLE", + 3: "QUALIFICATION_STATE_SETUP", + 4: "QUALIFICATION_STATE_RUNNING", + 5: "QUALIFICATION_STATE_TEARDOWN", + 6: "QUALIFICATION_STATE_COMPLETED", + } + QualificationState_value = map[string]int32{ + "QUALIFICATION_STATE_UNSPECIFIED": 0, + "QUALIFICATION_STATE_ERROR": 1, + "QUALIFICATION_STATE_IDLE": 2, + "QUALIFICATION_STATE_SETUP": 3, + "QUALIFICATION_STATE_RUNNING": 4, + "QUALIFICATION_STATE_TEARDOWN": 5, + "QUALIFICATION_STATE_COMPLETED": 6, + } +) + +func (x QualificationState) Enum() *QualificationState { + p := new(QualificationState) + *p = x + return p +} + +func (x QualificationState) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (QualificationState) Descriptor() protoreflect.EnumDescriptor { + return file_packet_link_qualification_packet_link_qualification_proto_enumTypes[0].Descriptor() +} + +func (QualificationState) Type() protoreflect.EnumType { + return &file_packet_link_qualification_packet_link_qualification_proto_enumTypes[0] +} + +func (x QualificationState) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use QualificationState.Descriptor instead. +func (QualificationState) EnumDescriptor() ([]byte, []int) { + return file_packet_link_qualification_packet_link_qualification_proto_rawDescGZIP(), []int{0} +} + +type PacketInjectorLoopbackMode int32 + +const ( + PacketInjectorLoopbackMode_PACKET_INJECTOR_LOOPBACK_MODE_UNSPECIFIED PacketInjectorLoopbackMode = 0 + PacketInjectorLoopbackMode_PACKET_INJECTOR_LOOPBACK_MODE_PMD PacketInjectorLoopbackMode = 1 + PacketInjectorLoopbackMode_PACKET_INJECTOR_LOOPBACK_MODE_ASIC PacketInjectorLoopbackMode = 2 +) + +// Enum value maps for PacketInjectorLoopbackMode. +var ( + PacketInjectorLoopbackMode_name = map[int32]string{ + 0: "PACKET_INJECTOR_LOOPBACK_MODE_UNSPECIFIED", + 1: "PACKET_INJECTOR_LOOPBACK_MODE_PMD", + 2: "PACKET_INJECTOR_LOOPBACK_MODE_ASIC", + } + PacketInjectorLoopbackMode_value = map[string]int32{ + "PACKET_INJECTOR_LOOPBACK_MODE_UNSPECIFIED": 0, + "PACKET_INJECTOR_LOOPBACK_MODE_PMD": 1, + "PACKET_INJECTOR_LOOPBACK_MODE_ASIC": 2, + } +) + +func (x PacketInjectorLoopbackMode) Enum() *PacketInjectorLoopbackMode { + p := new(PacketInjectorLoopbackMode) + *p = x + return p +} + +func (x PacketInjectorLoopbackMode) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (PacketInjectorLoopbackMode) Descriptor() protoreflect.EnumDescriptor { + return file_packet_link_qualification_packet_link_qualification_proto_enumTypes[1].Descriptor() +} + +func (PacketInjectorLoopbackMode) Type() protoreflect.EnumType { + return &file_packet_link_qualification_packet_link_qualification_proto_enumTypes[1] +} + +func (x PacketInjectorLoopbackMode) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use PacketInjectorLoopbackMode.Descriptor instead. +func (PacketInjectorLoopbackMode) EnumDescriptor() ([]byte, []int) { + return file_packet_link_qualification_packet_link_qualification_proto_rawDescGZIP(), []int{1} +} + +type HeaderMatchField int32 + +const ( + HeaderMatchField_HEADER_MATCH_FIELD_UNSPECIFIED HeaderMatchField = 0 + HeaderMatchField_HEADER_MATCH_FIELD_L2 HeaderMatchField = 1 + HeaderMatchField_HEADER_MATCH_FIELD_L3 HeaderMatchField = 2 + HeaderMatchField_HEADER_MATCH_FIELD_L4 HeaderMatchField = 3 +) + +// Enum value maps for HeaderMatchField. +var ( + HeaderMatchField_name = map[int32]string{ + 0: "HEADER_MATCH_FIELD_UNSPECIFIED", + 1: "HEADER_MATCH_FIELD_L2", + 2: "HEADER_MATCH_FIELD_L3", + 3: "HEADER_MATCH_FIELD_L4", + } + HeaderMatchField_value = map[string]int32{ + "HEADER_MATCH_FIELD_UNSPECIFIED": 0, + "HEADER_MATCH_FIELD_L2": 1, + "HEADER_MATCH_FIELD_L3": 2, + "HEADER_MATCH_FIELD_L4": 3, + } +) + +func (x HeaderMatchField) Enum() *HeaderMatchField { + p := new(HeaderMatchField) + *p = x + return p +} + +func (x HeaderMatchField) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (HeaderMatchField) Descriptor() protoreflect.EnumDescriptor { + return file_packet_link_qualification_packet_link_qualification_proto_enumTypes[2].Descriptor() +} + +func (HeaderMatchField) Type() protoreflect.EnumType { + return &file_packet_link_qualification_packet_link_qualification_proto_enumTypes[2] +} + +func (x HeaderMatchField) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use HeaderMatchField.Descriptor instead. +func (HeaderMatchField) EnumDescriptor() ([]byte, []int) { + return file_packet_link_qualification_packet_link_qualification_proto_rawDescGZIP(), []int{2} +} + +type CreateRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Interfaces []*QualificationConfiguration `protobuf:"bytes,1,rep,name=interfaces,proto3" json:"interfaces,omitempty"` +} + +func (x *CreateRequest) Reset() { + *x = CreateRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_packet_link_qualification_packet_link_qualification_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateRequest) ProtoMessage() {} + +func (x *CreateRequest) ProtoReflect() protoreflect.Message { + mi := &file_packet_link_qualification_packet_link_qualification_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateRequest.ProtoReflect.Descriptor instead. +func (*CreateRequest) Descriptor() ([]byte, []int) { + return file_packet_link_qualification_packet_link_qualification_proto_rawDescGZIP(), []int{0} +} + +func (x *CreateRequest) GetInterfaces() []*QualificationConfiguration { + if x != nil { + return x.Interfaces + } + return nil +} + +type CreateResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Status map[string]*status.Status `protobuf:"bytes,2,rep,name=status,proto3" json:"status,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +func (x *CreateResponse) Reset() { + *x = CreateResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_packet_link_qualification_packet_link_qualification_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateResponse) ProtoMessage() {} + +func (x *CreateResponse) ProtoReflect() protoreflect.Message { + mi := &file_packet_link_qualification_packet_link_qualification_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateResponse.ProtoReflect.Descriptor instead. +func (*CreateResponse) Descriptor() ([]byte, []int) { + return file_packet_link_qualification_packet_link_qualification_proto_rawDescGZIP(), []int{1} +} + +func (x *CreateResponse) GetStatus() map[string]*status.Status { + if x != nil { + return x.Status + } + return nil +} + +type NTPSyncedTiming struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + StartTime *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=start_time,json=startTime,proto3" json:"start_time,omitempty"` + EndTime *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=end_time,json=endTime,proto3" json:"end_time,omitempty"` + TeardownTime *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=teardown_time,json=teardownTime,proto3" json:"teardown_time,omitempty"` +} + +func (x *NTPSyncedTiming) Reset() { + *x = NTPSyncedTiming{} + if protoimpl.UnsafeEnabled { + mi := &file_packet_link_qualification_packet_link_qualification_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *NTPSyncedTiming) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*NTPSyncedTiming) ProtoMessage() {} + +func (x *NTPSyncedTiming) ProtoReflect() protoreflect.Message { + mi := &file_packet_link_qualification_packet_link_qualification_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use NTPSyncedTiming.ProtoReflect.Descriptor instead. +func (*NTPSyncedTiming) Descriptor() ([]byte, []int) { + return file_packet_link_qualification_packet_link_qualification_proto_rawDescGZIP(), []int{2} +} + +func (x *NTPSyncedTiming) GetStartTime() *timestamppb.Timestamp { + if x != nil { + return x.StartTime + } + return nil +} + +func (x *NTPSyncedTiming) GetEndTime() *timestamppb.Timestamp { + if x != nil { + return x.EndTime + } + return nil +} + +func (x *NTPSyncedTiming) GetTeardownTime() *timestamppb.Timestamp { + if x != nil { + return x.TeardownTime + } + return nil +} + +type RPCSyncedTiming struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + PreSyncDuration *durationpb.Duration `protobuf:"bytes,1,opt,name=pre_sync_duration,json=preSyncDuration,proto3" json:"pre_sync_duration,omitempty"` + SetupDuration *durationpb.Duration `protobuf:"bytes,2,opt,name=setup_duration,json=setupDuration,proto3" json:"setup_duration,omitempty"` + Duration *durationpb.Duration `protobuf:"bytes,3,opt,name=duration,proto3" json:"duration,omitempty"` + PostSyncDuration *durationpb.Duration `protobuf:"bytes,4,opt,name=post_sync_duration,json=postSyncDuration,proto3" json:"post_sync_duration,omitempty"` + TeardownDuration *durationpb.Duration `protobuf:"bytes,5,opt,name=teardown_duration,json=teardownDuration,proto3" json:"teardown_duration,omitempty"` +} + +func (x *RPCSyncedTiming) Reset() { + *x = RPCSyncedTiming{} + if protoimpl.UnsafeEnabled { + mi := &file_packet_link_qualification_packet_link_qualification_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RPCSyncedTiming) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RPCSyncedTiming) ProtoMessage() {} + +func (x *RPCSyncedTiming) ProtoReflect() protoreflect.Message { + mi := &file_packet_link_qualification_packet_link_qualification_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RPCSyncedTiming.ProtoReflect.Descriptor instead. +func (*RPCSyncedTiming) Descriptor() ([]byte, []int) { + return file_packet_link_qualification_packet_link_qualification_proto_rawDescGZIP(), []int{3} +} + +func (x *RPCSyncedTiming) GetPreSyncDuration() *durationpb.Duration { + if x != nil { + return x.PreSyncDuration + } + return nil +} + +func (x *RPCSyncedTiming) GetSetupDuration() *durationpb.Duration { + if x != nil { + return x.SetupDuration + } + return nil +} + +func (x *RPCSyncedTiming) GetDuration() *durationpb.Duration { + if x != nil { + return x.Duration + } + return nil +} + +func (x *RPCSyncedTiming) GetPostSyncDuration() *durationpb.Duration { + if x != nil { + return x.PostSyncDuration + } + return nil +} + +func (x *RPCSyncedTiming) GetTeardownDuration() *durationpb.Duration { + if x != nil { + return x.TeardownDuration + } + return nil +} + +type QualificationConfiguration struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + InterfaceName string `protobuf:"bytes,2,opt,name=interface_name,json=interfaceName,proto3" json:"interface_name,omitempty"` + // Types that are assignable to Timing: + // + // *QualificationConfiguration_Ntp + // *QualificationConfiguration_Rpc + Timing isQualificationConfiguration_Timing `protobuf_oneof:"timing"` + // Types that are assignable to EndpointType: + // + // *QualificationConfiguration_PacketGenerator + // *QualificationConfiguration_PacketInjector + // *QualificationConfiguration_PmdLoopback + // *QualificationConfiguration_AsicLoopback + EndpointType isQualificationConfiguration_EndpointType `protobuf_oneof:"endpoint_type"` +} + +func (x *QualificationConfiguration) Reset() { + *x = QualificationConfiguration{} + if protoimpl.UnsafeEnabled { + mi := &file_packet_link_qualification_packet_link_qualification_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QualificationConfiguration) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QualificationConfiguration) ProtoMessage() {} + +func (x *QualificationConfiguration) ProtoReflect() protoreflect.Message { + mi := &file_packet_link_qualification_packet_link_qualification_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use QualificationConfiguration.ProtoReflect.Descriptor instead. +func (*QualificationConfiguration) Descriptor() ([]byte, []int) { + return file_packet_link_qualification_packet_link_qualification_proto_rawDescGZIP(), []int{4} +} + +func (x *QualificationConfiguration) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *QualificationConfiguration) GetInterfaceName() string { + if x != nil { + return x.InterfaceName + } + return "" +} + +func (m *QualificationConfiguration) GetTiming() isQualificationConfiguration_Timing { + if m != nil { + return m.Timing + } + return nil +} + +func (x *QualificationConfiguration) GetNtp() *NTPSyncedTiming { + if x, ok := x.GetTiming().(*QualificationConfiguration_Ntp); ok { + return x.Ntp + } + return nil +} + +func (x *QualificationConfiguration) GetRpc() *RPCSyncedTiming { + if x, ok := x.GetTiming().(*QualificationConfiguration_Rpc); ok { + return x.Rpc + } + return nil +} + +func (m *QualificationConfiguration) GetEndpointType() isQualificationConfiguration_EndpointType { + if m != nil { + return m.EndpointType + } + return nil +} + +func (x *QualificationConfiguration) GetPacketGenerator() *PacketGeneratorConfiguration { + if x, ok := x.GetEndpointType().(*QualificationConfiguration_PacketGenerator); ok { + return x.PacketGenerator + } + return nil +} + +func (x *QualificationConfiguration) GetPacketInjector() *PacketInjectorConfiguration { + if x, ok := x.GetEndpointType().(*QualificationConfiguration_PacketInjector); ok { + return x.PacketInjector + } + return nil +} + +func (x *QualificationConfiguration) GetPmdLoopback() *PmdLoopbackConfiguration { + if x, ok := x.GetEndpointType().(*QualificationConfiguration_PmdLoopback); ok { + return x.PmdLoopback + } + return nil +} + +func (x *QualificationConfiguration) GetAsicLoopback() *AsicLoopbackConfiguration { + if x, ok := x.GetEndpointType().(*QualificationConfiguration_AsicLoopback); ok { + return x.AsicLoopback + } + return nil +} + +type isQualificationConfiguration_Timing interface { + isQualificationConfiguration_Timing() +} + +type QualificationConfiguration_Ntp struct { + Ntp *NTPSyncedTiming `protobuf:"bytes,101,opt,name=ntp,proto3,oneof"` +} + +type QualificationConfiguration_Rpc struct { + Rpc *RPCSyncedTiming `protobuf:"bytes,102,opt,name=rpc,proto3,oneof"` +} + +func (*QualificationConfiguration_Ntp) isQualificationConfiguration_Timing() {} + +func (*QualificationConfiguration_Rpc) isQualificationConfiguration_Timing() {} + +type isQualificationConfiguration_EndpointType interface { + isQualificationConfiguration_EndpointType() +} + +type QualificationConfiguration_PacketGenerator struct { + PacketGenerator *PacketGeneratorConfiguration `protobuf:"bytes,111,opt,name=packet_generator,json=packetGenerator,proto3,oneof"` +} + +type QualificationConfiguration_PacketInjector struct { + PacketInjector *PacketInjectorConfiguration `protobuf:"bytes,112,opt,name=packet_injector,json=packetInjector,proto3,oneof"` +} + +type QualificationConfiguration_PmdLoopback struct { + PmdLoopback *PmdLoopbackConfiguration `protobuf:"bytes,113,opt,name=pmd_loopback,json=pmdLoopback,proto3,oneof"` +} + +type QualificationConfiguration_AsicLoopback struct { + AsicLoopback *AsicLoopbackConfiguration `protobuf:"bytes,114,opt,name=asic_loopback,json=asicLoopback,proto3,oneof"` +} + +func (*QualificationConfiguration_PacketGenerator) isQualificationConfiguration_EndpointType() {} + +func (*QualificationConfiguration_PacketInjector) isQualificationConfiguration_EndpointType() {} + +func (*QualificationConfiguration_PmdLoopback) isQualificationConfiguration_EndpointType() {} + +func (*QualificationConfiguration_AsicLoopback) isQualificationConfiguration_EndpointType() {} + +type PacketGeneratorConfiguration struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + PacketRate uint64 `protobuf:"varint,1,opt,name=packet_rate,json=packetRate,proto3" json:"packet_rate,omitempty"` + PacketSize uint32 `protobuf:"varint,2,opt,name=packet_size,json=packetSize,proto3" json:"packet_size,omitempty"` +} + +func (x *PacketGeneratorConfiguration) Reset() { + *x = PacketGeneratorConfiguration{} + if protoimpl.UnsafeEnabled { + mi := &file_packet_link_qualification_packet_link_qualification_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PacketGeneratorConfiguration) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PacketGeneratorConfiguration) ProtoMessage() {} + +func (x *PacketGeneratorConfiguration) ProtoReflect() protoreflect.Message { + mi := &file_packet_link_qualification_packet_link_qualification_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PacketGeneratorConfiguration.ProtoReflect.Descriptor instead. +func (*PacketGeneratorConfiguration) Descriptor() ([]byte, []int) { + return file_packet_link_qualification_packet_link_qualification_proto_rawDescGZIP(), []int{5} +} + +func (x *PacketGeneratorConfiguration) GetPacketRate() uint64 { + if x != nil { + return x.PacketRate + } + return 0 +} + +func (x *PacketGeneratorConfiguration) GetPacketSize() uint32 { + if x != nil { + return x.PacketSize + } + return 0 +} + +type PacketInjectorConfiguration struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + PacketCount uint32 `protobuf:"varint,1,opt,name=packet_count,json=packetCount,proto3" json:"packet_count,omitempty"` + PacketSize uint32 `protobuf:"varint,2,opt,name=packet_size,json=packetSize,proto3" json:"packet_size,omitempty"` + // Types that are assignable to LoopbackMode: + // + // *PacketInjectorConfiguration_PmdLoopback + // *PacketInjectorConfiguration_AsicLoopback + LoopbackMode isPacketInjectorConfiguration_LoopbackMode `protobuf_oneof:"loopback_mode"` +} + +func (x *PacketInjectorConfiguration) Reset() { + *x = PacketInjectorConfiguration{} + if protoimpl.UnsafeEnabled { + mi := &file_packet_link_qualification_packet_link_qualification_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PacketInjectorConfiguration) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PacketInjectorConfiguration) ProtoMessage() {} + +func (x *PacketInjectorConfiguration) ProtoReflect() protoreflect.Message { + mi := &file_packet_link_qualification_packet_link_qualification_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PacketInjectorConfiguration.ProtoReflect.Descriptor instead. +func (*PacketInjectorConfiguration) Descriptor() ([]byte, []int) { + return file_packet_link_qualification_packet_link_qualification_proto_rawDescGZIP(), []int{6} +} + +func (x *PacketInjectorConfiguration) GetPacketCount() uint32 { + if x != nil { + return x.PacketCount + } + return 0 +} + +func (x *PacketInjectorConfiguration) GetPacketSize() uint32 { + if x != nil { + return x.PacketSize + } + return 0 +} + +func (m *PacketInjectorConfiguration) GetLoopbackMode() isPacketInjectorConfiguration_LoopbackMode { + if m != nil { + return m.LoopbackMode + } + return nil +} + +func (x *PacketInjectorConfiguration) GetPmdLoopback() *PmdLoopbackConfiguration { + if x, ok := x.GetLoopbackMode().(*PacketInjectorConfiguration_PmdLoopback); ok { + return x.PmdLoopback + } + return nil +} + +func (x *PacketInjectorConfiguration) GetAsicLoopback() *AsicLoopbackConfiguration { + if x, ok := x.GetLoopbackMode().(*PacketInjectorConfiguration_AsicLoopback); ok { + return x.AsicLoopback + } + return nil +} + +type isPacketInjectorConfiguration_LoopbackMode interface { + isPacketInjectorConfiguration_LoopbackMode() +} + +type PacketInjectorConfiguration_PmdLoopback struct { + PmdLoopback *PmdLoopbackConfiguration `protobuf:"bytes,101,opt,name=pmd_loopback,json=pmdLoopback,proto3,oneof"` +} + +type PacketInjectorConfiguration_AsicLoopback struct { + AsicLoopback *AsicLoopbackConfiguration `protobuf:"bytes,102,opt,name=asic_loopback,json=asicLoopback,proto3,oneof"` +} + +func (*PacketInjectorConfiguration_PmdLoopback) isPacketInjectorConfiguration_LoopbackMode() {} + +func (*PacketInjectorConfiguration_AsicLoopback) isPacketInjectorConfiguration_LoopbackMode() {} + +type PmdLoopbackConfiguration struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *PmdLoopbackConfiguration) Reset() { + *x = PmdLoopbackConfiguration{} + if protoimpl.UnsafeEnabled { + mi := &file_packet_link_qualification_packet_link_qualification_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PmdLoopbackConfiguration) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PmdLoopbackConfiguration) ProtoMessage() {} + +func (x *PmdLoopbackConfiguration) ProtoReflect() protoreflect.Message { + mi := &file_packet_link_qualification_packet_link_qualification_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PmdLoopbackConfiguration.ProtoReflect.Descriptor instead. +func (*PmdLoopbackConfiguration) Descriptor() ([]byte, []int) { + return file_packet_link_qualification_packet_link_qualification_proto_rawDescGZIP(), []int{7} +} + +type AsicLoopbackConfiguration struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *AsicLoopbackConfiguration) Reset() { + *x = AsicLoopbackConfiguration{} + if protoimpl.UnsafeEnabled { + mi := &file_packet_link_qualification_packet_link_qualification_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AsicLoopbackConfiguration) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AsicLoopbackConfiguration) ProtoMessage() {} + +func (x *AsicLoopbackConfiguration) ProtoReflect() protoreflect.Message { + mi := &file_packet_link_qualification_packet_link_qualification_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AsicLoopbackConfiguration.ProtoReflect.Descriptor instead. +func (*AsicLoopbackConfiguration) Descriptor() ([]byte, []int) { + return file_packet_link_qualification_packet_link_qualification_proto_rawDescGZIP(), []int{8} +} + +type GetRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Ids []string `protobuf:"bytes,1,rep,name=ids,proto3" json:"ids,omitempty"` +} + +func (x *GetRequest) Reset() { + *x = GetRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_packet_link_qualification_packet_link_qualification_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetRequest) ProtoMessage() {} + +func (x *GetRequest) ProtoReflect() protoreflect.Message { + mi := &file_packet_link_qualification_packet_link_qualification_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetRequest.ProtoReflect.Descriptor instead. +func (*GetRequest) Descriptor() ([]byte, []int) { + return file_packet_link_qualification_packet_link_qualification_proto_rawDescGZIP(), []int{9} +} + +func (x *GetRequest) GetIds() []string { + if x != nil { + return x.Ids + } + return nil +} + +type GetResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Results map[string]*QualificationResult `protobuf:"bytes,1,rep,name=results,proto3" json:"results,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +func (x *GetResponse) Reset() { + *x = GetResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_packet_link_qualification_packet_link_qualification_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetResponse) ProtoMessage() {} + +func (x *GetResponse) ProtoReflect() protoreflect.Message { + mi := &file_packet_link_qualification_packet_link_qualification_proto_msgTypes[10] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetResponse.ProtoReflect.Descriptor instead. +func (*GetResponse) Descriptor() ([]byte, []int) { + return file_packet_link_qualification_packet_link_qualification_proto_rawDescGZIP(), []int{10} +} + +func (x *GetResponse) GetResults() map[string]*QualificationResult { + if x != nil { + return x.Results + } + return nil +} + +type QualificationResult struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + InterfaceName string `protobuf:"bytes,2,opt,name=interface_name,json=interfaceName,proto3" json:"interface_name,omitempty"` + State QualificationState `protobuf:"varint,3,opt,name=state,proto3,enum=gnoi.packet_link_qualification.QualificationState" json:"state,omitempty"` + PacketsSent uint64 `protobuf:"varint,4,opt,name=packets_sent,json=packetsSent,proto3" json:"packets_sent,omitempty"` + PacketsReceived uint64 `protobuf:"varint,5,opt,name=packets_received,json=packetsReceived,proto3" json:"packets_received,omitempty"` + PacketsError uint64 `protobuf:"varint,6,opt,name=packets_error,json=packetsError,proto3" json:"packets_error,omitempty"` + PacketsDropped uint64 `protobuf:"varint,7,opt,name=packets_dropped,json=packetsDropped,proto3" json:"packets_dropped,omitempty"` + StartTime *timestamppb.Timestamp `protobuf:"bytes,8,opt,name=start_time,json=startTime,proto3" json:"start_time,omitempty"` + EndTime *timestamppb.Timestamp `protobuf:"bytes,9,opt,name=end_time,json=endTime,proto3" json:"end_time,omitempty"` + ExpectedRateBytesPerSecond uint64 `protobuf:"varint,10,opt,name=expected_rate_bytes_per_second,json=expectedRateBytesPerSecond,proto3" json:"expected_rate_bytes_per_second,omitempty"` + QualificationRateBytesPerSecond uint64 `protobuf:"varint,11,opt,name=qualification_rate_bytes_per_second,json=qualificationRateBytesPerSecond,proto3" json:"qualification_rate_bytes_per_second,omitempty"` + Status *status.Status `protobuf:"bytes,12,opt,name=status,proto3" json:"status,omitempty"` +} + +func (x *QualificationResult) Reset() { + *x = QualificationResult{} + if protoimpl.UnsafeEnabled { + mi := &file_packet_link_qualification_packet_link_qualification_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QualificationResult) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QualificationResult) ProtoMessage() {} + +func (x *QualificationResult) ProtoReflect() protoreflect.Message { + mi := &file_packet_link_qualification_packet_link_qualification_proto_msgTypes[11] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use QualificationResult.ProtoReflect.Descriptor instead. +func (*QualificationResult) Descriptor() ([]byte, []int) { + return file_packet_link_qualification_packet_link_qualification_proto_rawDescGZIP(), []int{11} +} + +func (x *QualificationResult) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *QualificationResult) GetInterfaceName() string { + if x != nil { + return x.InterfaceName + } + return "" +} + +func (x *QualificationResult) GetState() QualificationState { + if x != nil { + return x.State + } + return QualificationState_QUALIFICATION_STATE_UNSPECIFIED +} + +func (x *QualificationResult) GetPacketsSent() uint64 { + if x != nil { + return x.PacketsSent + } + return 0 +} + +func (x *QualificationResult) GetPacketsReceived() uint64 { + if x != nil { + return x.PacketsReceived + } + return 0 +} + +func (x *QualificationResult) GetPacketsError() uint64 { + if x != nil { + return x.PacketsError + } + return 0 +} + +func (x *QualificationResult) GetPacketsDropped() uint64 { + if x != nil { + return x.PacketsDropped + } + return 0 +} + +func (x *QualificationResult) GetStartTime() *timestamppb.Timestamp { + if x != nil { + return x.StartTime + } + return nil +} + +func (x *QualificationResult) GetEndTime() *timestamppb.Timestamp { + if x != nil { + return x.EndTime + } + return nil +} + +func (x *QualificationResult) GetExpectedRateBytesPerSecond() uint64 { + if x != nil { + return x.ExpectedRateBytesPerSecond + } + return 0 +} + +func (x *QualificationResult) GetQualificationRateBytesPerSecond() uint64 { + if x != nil { + return x.QualificationRateBytesPerSecond + } + return 0 +} + +func (x *QualificationResult) GetStatus() *status.Status { + if x != nil { + return x.Status + } + return nil +} + +type DeleteRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Ids []string `protobuf:"bytes,1,rep,name=ids,proto3" json:"ids,omitempty"` +} + +func (x *DeleteRequest) Reset() { + *x = DeleteRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_packet_link_qualification_packet_link_qualification_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeleteRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteRequest) ProtoMessage() {} + +func (x *DeleteRequest) ProtoReflect() protoreflect.Message { + mi := &file_packet_link_qualification_packet_link_qualification_proto_msgTypes[12] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeleteRequest.ProtoReflect.Descriptor instead. +func (*DeleteRequest) Descriptor() ([]byte, []int) { + return file_packet_link_qualification_packet_link_qualification_proto_rawDescGZIP(), []int{12} +} + +func (x *DeleteRequest) GetIds() []string { + if x != nil { + return x.Ids + } + return nil +} + +type DeleteResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Results map[string]*status.Status `protobuf:"bytes,1,rep,name=results,proto3" json:"results,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +func (x *DeleteResponse) Reset() { + *x = DeleteResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_packet_link_qualification_packet_link_qualification_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeleteResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteResponse) ProtoMessage() {} + +func (x *DeleteResponse) ProtoReflect() protoreflect.Message { + mi := &file_packet_link_qualification_packet_link_qualification_proto_msgTypes[13] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeleteResponse.ProtoReflect.Descriptor instead. +func (*DeleteResponse) Descriptor() ([]byte, []int) { + return file_packet_link_qualification_packet_link_qualification_proto_rawDescGZIP(), []int{13} +} + +func (x *DeleteResponse) GetResults() map[string]*status.Status { + if x != nil { + return x.Results + } + return nil +} + +type CapabilitiesRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *CapabilitiesRequest) Reset() { + *x = CapabilitiesRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_packet_link_qualification_packet_link_qualification_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CapabilitiesRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CapabilitiesRequest) ProtoMessage() {} + +func (x *CapabilitiesRequest) ProtoReflect() protoreflect.Message { + mi := &file_packet_link_qualification_packet_link_qualification_proto_msgTypes[14] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CapabilitiesRequest.ProtoReflect.Descriptor instead. +func (*CapabilitiesRequest) Descriptor() ([]byte, []int) { + return file_packet_link_qualification_packet_link_qualification_proto_rawDescGZIP(), []int{14} +} + +type CapabilitiesResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Time *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=time,proto3" json:"time,omitempty"` + NtpSynced bool `protobuf:"varint,2,opt,name=ntp_synced,json=ntpSynced,proto3" json:"ntp_synced,omitempty"` + Generator *GeneratorCapabilities `protobuf:"bytes,3,opt,name=generator,proto3" json:"generator,omitempty"` + Reflector *ReflectorCapabilities `protobuf:"bytes,4,opt,name=reflector,proto3" json:"reflector,omitempty"` + MaxHistoricalResultsPerInterface uint64 `protobuf:"varint,5,opt,name=max_historical_results_per_interface,json=maxHistoricalResultsPerInterface,proto3" json:"max_historical_results_per_interface,omitempty"` +} + +func (x *CapabilitiesResponse) Reset() { + *x = CapabilitiesResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_packet_link_qualification_packet_link_qualification_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CapabilitiesResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CapabilitiesResponse) ProtoMessage() {} + +func (x *CapabilitiesResponse) ProtoReflect() protoreflect.Message { + mi := &file_packet_link_qualification_packet_link_qualification_proto_msgTypes[15] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CapabilitiesResponse.ProtoReflect.Descriptor instead. +func (*CapabilitiesResponse) Descriptor() ([]byte, []int) { + return file_packet_link_qualification_packet_link_qualification_proto_rawDescGZIP(), []int{15} +} + +func (x *CapabilitiesResponse) GetTime() *timestamppb.Timestamp { + if x != nil { + return x.Time + } + return nil +} + +func (x *CapabilitiesResponse) GetNtpSynced() bool { + if x != nil { + return x.NtpSynced + } + return false +} + +func (x *CapabilitiesResponse) GetGenerator() *GeneratorCapabilities { + if x != nil { + return x.Generator + } + return nil +} + +func (x *CapabilitiesResponse) GetReflector() *ReflectorCapabilities { + if x != nil { + return x.Reflector + } + return nil +} + +func (x *CapabilitiesResponse) GetMaxHistoricalResultsPerInterface() uint64 { + if x != nil { + return x.MaxHistoricalResultsPerInterface + } + return 0 +} + +type PacketGeneratorCapabilities struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + MaxBps uint64 `protobuf:"varint,1,opt,name=max_bps,json=maxBps,proto3" json:"max_bps,omitempty"` + MaxPps uint64 `protobuf:"varint,2,opt,name=max_pps,json=maxPps,proto3" json:"max_pps,omitempty"` + MinMtu uint32 `protobuf:"varint,3,opt,name=min_mtu,json=minMtu,proto3" json:"min_mtu,omitempty"` + MaxMtu uint32 `protobuf:"varint,4,opt,name=max_mtu,json=maxMtu,proto3" json:"max_mtu,omitempty"` + MinSetupDuration *durationpb.Duration `protobuf:"bytes,5,opt,name=min_setup_duration,json=minSetupDuration,proto3" json:"min_setup_duration,omitempty"` + MinTeardownDuration *durationpb.Duration `protobuf:"bytes,6,opt,name=min_teardown_duration,json=minTeardownDuration,proto3" json:"min_teardown_duration,omitempty"` + MinSampleInterval *durationpb.Duration `protobuf:"bytes,7,opt,name=min_sample_interval,json=minSampleInterval,proto3" json:"min_sample_interval,omitempty"` +} + +func (x *PacketGeneratorCapabilities) Reset() { + *x = PacketGeneratorCapabilities{} + if protoimpl.UnsafeEnabled { + mi := &file_packet_link_qualification_packet_link_qualification_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PacketGeneratorCapabilities) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PacketGeneratorCapabilities) ProtoMessage() {} + +func (x *PacketGeneratorCapabilities) ProtoReflect() protoreflect.Message { + mi := &file_packet_link_qualification_packet_link_qualification_proto_msgTypes[16] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PacketGeneratorCapabilities.ProtoReflect.Descriptor instead. +func (*PacketGeneratorCapabilities) Descriptor() ([]byte, []int) { + return file_packet_link_qualification_packet_link_qualification_proto_rawDescGZIP(), []int{16} +} + +func (x *PacketGeneratorCapabilities) GetMaxBps() uint64 { + if x != nil { + return x.MaxBps + } + return 0 +} + +func (x *PacketGeneratorCapabilities) GetMaxPps() uint64 { + if x != nil { + return x.MaxPps + } + return 0 +} + +func (x *PacketGeneratorCapabilities) GetMinMtu() uint32 { + if x != nil { + return x.MinMtu + } + return 0 +} + +func (x *PacketGeneratorCapabilities) GetMaxMtu() uint32 { + if x != nil { + return x.MaxMtu + } + return 0 +} + +func (x *PacketGeneratorCapabilities) GetMinSetupDuration() *durationpb.Duration { + if x != nil { + return x.MinSetupDuration + } + return nil +} + +func (x *PacketGeneratorCapabilities) GetMinTeardownDuration() *durationpb.Duration { + if x != nil { + return x.MinTeardownDuration + } + return nil +} + +func (x *PacketGeneratorCapabilities) GetMinSampleInterval() *durationpb.Duration { + if x != nil { + return x.MinSampleInterval + } + return nil +} + +type PacketInjectorCapabilities struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + MinMtu uint32 `protobuf:"varint,1,opt,name=min_mtu,json=minMtu,proto3" json:"min_mtu,omitempty"` + MaxMtu uint32 `protobuf:"varint,2,opt,name=max_mtu,json=maxMtu,proto3" json:"max_mtu,omitempty"` + MinInjectedPackets uint32 `protobuf:"varint,3,opt,name=min_injected_packets,json=minInjectedPackets,proto3" json:"min_injected_packets,omitempty"` + MaxInjectedPackets uint32 `protobuf:"varint,4,opt,name=max_injected_packets,json=maxInjectedPackets,proto3" json:"max_injected_packets,omitempty"` + MinSetupDuration *durationpb.Duration `protobuf:"bytes,5,opt,name=min_setup_duration,json=minSetupDuration,proto3" json:"min_setup_duration,omitempty"` + MinTeardownDuration *durationpb.Duration `protobuf:"bytes,6,opt,name=min_teardown_duration,json=minTeardownDuration,proto3" json:"min_teardown_duration,omitempty"` + MinSampleInterval *durationpb.Duration `protobuf:"bytes,7,opt,name=min_sample_interval,json=minSampleInterval,proto3" json:"min_sample_interval,omitempty"` + LoopbackModes []PacketInjectorLoopbackMode `protobuf:"varint,8,rep,packed,name=loopback_modes,json=loopbackModes,proto3,enum=gnoi.packet_link_qualification.PacketInjectorLoopbackMode" json:"loopback_modes,omitempty"` +} + +func (x *PacketInjectorCapabilities) Reset() { + *x = PacketInjectorCapabilities{} + if protoimpl.UnsafeEnabled { + mi := &file_packet_link_qualification_packet_link_qualification_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PacketInjectorCapabilities) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PacketInjectorCapabilities) ProtoMessage() {} + +func (x *PacketInjectorCapabilities) ProtoReflect() protoreflect.Message { + mi := &file_packet_link_qualification_packet_link_qualification_proto_msgTypes[17] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PacketInjectorCapabilities.ProtoReflect.Descriptor instead. +func (*PacketInjectorCapabilities) Descriptor() ([]byte, []int) { + return file_packet_link_qualification_packet_link_qualification_proto_rawDescGZIP(), []int{17} +} + +func (x *PacketInjectorCapabilities) GetMinMtu() uint32 { + if x != nil { + return x.MinMtu + } + return 0 +} + +func (x *PacketInjectorCapabilities) GetMaxMtu() uint32 { + if x != nil { + return x.MaxMtu + } + return 0 +} + +func (x *PacketInjectorCapabilities) GetMinInjectedPackets() uint32 { + if x != nil { + return x.MinInjectedPackets + } + return 0 +} + +func (x *PacketInjectorCapabilities) GetMaxInjectedPackets() uint32 { + if x != nil { + return x.MaxInjectedPackets + } + return 0 +} + +func (x *PacketInjectorCapabilities) GetMinSetupDuration() *durationpb.Duration { + if x != nil { + return x.MinSetupDuration + } + return nil +} + +func (x *PacketInjectorCapabilities) GetMinTeardownDuration() *durationpb.Duration { + if x != nil { + return x.MinTeardownDuration + } + return nil +} + +func (x *PacketInjectorCapabilities) GetMinSampleInterval() *durationpb.Duration { + if x != nil { + return x.MinSampleInterval + } + return nil +} + +func (x *PacketInjectorCapabilities) GetLoopbackModes() []PacketInjectorLoopbackMode { + if x != nil { + return x.LoopbackModes + } + return nil +} + +type GeneratorCapabilities struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + PacketGenerator *PacketGeneratorCapabilities `protobuf:"bytes,1,opt,name=packet_generator,json=packetGenerator,proto3" json:"packet_generator,omitempty"` + PacketInjector *PacketInjectorCapabilities `protobuf:"bytes,2,opt,name=packet_injector,json=packetInjector,proto3" json:"packet_injector,omitempty"` +} + +func (x *GeneratorCapabilities) Reset() { + *x = GeneratorCapabilities{} + if protoimpl.UnsafeEnabled { + mi := &file_packet_link_qualification_packet_link_qualification_proto_msgTypes[18] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GeneratorCapabilities) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GeneratorCapabilities) ProtoMessage() {} + +func (x *GeneratorCapabilities) ProtoReflect() protoreflect.Message { + mi := &file_packet_link_qualification_packet_link_qualification_proto_msgTypes[18] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GeneratorCapabilities.ProtoReflect.Descriptor instead. +func (*GeneratorCapabilities) Descriptor() ([]byte, []int) { + return file_packet_link_qualification_packet_link_qualification_proto_rawDescGZIP(), []int{18} +} + +func (x *GeneratorCapabilities) GetPacketGenerator() *PacketGeneratorCapabilities { + if x != nil { + return x.PacketGenerator + } + return nil +} + +func (x *GeneratorCapabilities) GetPacketInjector() *PacketInjectorCapabilities { + if x != nil { + return x.PacketInjector + } + return nil +} + +type PmdLoopbackCapabilities struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + MinSetupDuration *durationpb.Duration `protobuf:"bytes,1,opt,name=min_setup_duration,json=minSetupDuration,proto3" json:"min_setup_duration,omitempty"` + MinTeardownDuration *durationpb.Duration `protobuf:"bytes,2,opt,name=min_teardown_duration,json=minTeardownDuration,proto3" json:"min_teardown_duration,omitempty"` +} + +func (x *PmdLoopbackCapabilities) Reset() { + *x = PmdLoopbackCapabilities{} + if protoimpl.UnsafeEnabled { + mi := &file_packet_link_qualification_packet_link_qualification_proto_msgTypes[19] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PmdLoopbackCapabilities) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PmdLoopbackCapabilities) ProtoMessage() {} + +func (x *PmdLoopbackCapabilities) ProtoReflect() protoreflect.Message { + mi := &file_packet_link_qualification_packet_link_qualification_proto_msgTypes[19] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PmdLoopbackCapabilities.ProtoReflect.Descriptor instead. +func (*PmdLoopbackCapabilities) Descriptor() ([]byte, []int) { + return file_packet_link_qualification_packet_link_qualification_proto_rawDescGZIP(), []int{19} +} + +func (x *PmdLoopbackCapabilities) GetMinSetupDuration() *durationpb.Duration { + if x != nil { + return x.MinSetupDuration + } + return nil +} + +func (x *PmdLoopbackCapabilities) GetMinTeardownDuration() *durationpb.Duration { + if x != nil { + return x.MinTeardownDuration + } + return nil +} + +type AsicLoopbackCapabilities struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + MinSetupDuration *durationpb.Duration `protobuf:"bytes,1,opt,name=min_setup_duration,json=minSetupDuration,proto3" json:"min_setup_duration,omitempty"` + MinTeardownDuration *durationpb.Duration `protobuf:"bytes,2,opt,name=min_teardown_duration,json=minTeardownDuration,proto3" json:"min_teardown_duration,omitempty"` + Fields []HeaderMatchField `protobuf:"varint,3,rep,packed,name=fields,proto3,enum=gnoi.packet_link_qualification.HeaderMatchField" json:"fields,omitempty"` +} + +func (x *AsicLoopbackCapabilities) Reset() { + *x = AsicLoopbackCapabilities{} + if protoimpl.UnsafeEnabled { + mi := &file_packet_link_qualification_packet_link_qualification_proto_msgTypes[20] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AsicLoopbackCapabilities) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AsicLoopbackCapabilities) ProtoMessage() {} + +func (x *AsicLoopbackCapabilities) ProtoReflect() protoreflect.Message { + mi := &file_packet_link_qualification_packet_link_qualification_proto_msgTypes[20] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AsicLoopbackCapabilities.ProtoReflect.Descriptor instead. +func (*AsicLoopbackCapabilities) Descriptor() ([]byte, []int) { + return file_packet_link_qualification_packet_link_qualification_proto_rawDescGZIP(), []int{20} +} + +func (x *AsicLoopbackCapabilities) GetMinSetupDuration() *durationpb.Duration { + if x != nil { + return x.MinSetupDuration + } + return nil +} + +func (x *AsicLoopbackCapabilities) GetMinTeardownDuration() *durationpb.Duration { + if x != nil { + return x.MinTeardownDuration + } + return nil +} + +func (x *AsicLoopbackCapabilities) GetFields() []HeaderMatchField { + if x != nil { + return x.Fields + } + return nil +} + +type ReflectorCapabilities struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + PmdLoopback *PmdLoopbackCapabilities `protobuf:"bytes,1,opt,name=pmd_loopback,json=pmdLoopback,proto3" json:"pmd_loopback,omitempty"` + AsicLoopback *AsicLoopbackCapabilities `protobuf:"bytes,2,opt,name=asic_loopback,json=asicLoopback,proto3" json:"asic_loopback,omitempty"` +} + +func (x *ReflectorCapabilities) Reset() { + *x = ReflectorCapabilities{} + if protoimpl.UnsafeEnabled { + mi := &file_packet_link_qualification_packet_link_qualification_proto_msgTypes[21] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ReflectorCapabilities) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ReflectorCapabilities) ProtoMessage() {} + +func (x *ReflectorCapabilities) ProtoReflect() protoreflect.Message { + mi := &file_packet_link_qualification_packet_link_qualification_proto_msgTypes[21] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ReflectorCapabilities.ProtoReflect.Descriptor instead. +func (*ReflectorCapabilities) Descriptor() ([]byte, []int) { + return file_packet_link_qualification_packet_link_qualification_proto_rawDescGZIP(), []int{21} +} + +func (x *ReflectorCapabilities) GetPmdLoopback() *PmdLoopbackCapabilities { + if x != nil { + return x.PmdLoopback + } + return nil +} + +func (x *ReflectorCapabilities) GetAsicLoopback() *AsicLoopbackCapabilities { + if x != nil { + return x.AsicLoopback + } + return nil +} + +type ListRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *ListRequest) Reset() { + *x = ListRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_packet_link_qualification_packet_link_qualification_proto_msgTypes[22] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListRequest) ProtoMessage() {} + +func (x *ListRequest) ProtoReflect() protoreflect.Message { + mi := &file_packet_link_qualification_packet_link_qualification_proto_msgTypes[22] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListRequest.ProtoReflect.Descriptor instead. +func (*ListRequest) Descriptor() ([]byte, []int) { + return file_packet_link_qualification_packet_link_qualification_proto_rawDescGZIP(), []int{22} +} + +type ListResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Results []*ListResult `protobuf:"bytes,1,rep,name=results,proto3" json:"results,omitempty"` +} + +func (x *ListResponse) Reset() { + *x = ListResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_packet_link_qualification_packet_link_qualification_proto_msgTypes[23] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListResponse) ProtoMessage() {} + +func (x *ListResponse) ProtoReflect() protoreflect.Message { + mi := &file_packet_link_qualification_packet_link_qualification_proto_msgTypes[23] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListResponse.ProtoReflect.Descriptor instead. +func (*ListResponse) Descriptor() ([]byte, []int) { + return file_packet_link_qualification_packet_link_qualification_proto_rawDescGZIP(), []int{23} +} + +func (x *ListResponse) GetResults() []*ListResult { + if x != nil { + return x.Results + } + return nil +} + +type ListResult struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + State QualificationState `protobuf:"varint,2,opt,name=state,proto3,enum=gnoi.packet_link_qualification.QualificationState" json:"state,omitempty"` + InterfaceName string `protobuf:"bytes,3,opt,name=interface_name,json=interfaceName,proto3" json:"interface_name,omitempty"` +} + +func (x *ListResult) Reset() { + *x = ListResult{} + if protoimpl.UnsafeEnabled { + mi := &file_packet_link_qualification_packet_link_qualification_proto_msgTypes[24] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListResult) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListResult) ProtoMessage() {} + +func (x *ListResult) ProtoReflect() protoreflect.Message { + mi := &file_packet_link_qualification_packet_link_qualification_proto_msgTypes[24] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListResult.ProtoReflect.Descriptor instead. +func (*ListResult) Descriptor() ([]byte, []int) { + return file_packet_link_qualification_packet_link_qualification_proto_rawDescGZIP(), []int{24} +} + +func (x *ListResult) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *ListResult) GetState() QualificationState { + if x != nil { + return x.State + } + return QualificationState_QUALIFICATION_STATE_UNSPECIFIED +} + +func (x *ListResult) GetInterfaceName() string { + if x != nil { + return x.InterfaceName + } + return "" +} + +var File_packet_link_qualification_packet_link_qualification_proto protoreflect.FileDescriptor + +var file_packet_link_qualification_packet_link_qualification_proto_rawDesc = []byte{ + 0x0a, 0x39, 0x70, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x5f, 0x6c, 0x69, 0x6e, 0x6b, 0x5f, 0x71, 0x75, + 0x61, 0x6c, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x70, 0x61, 0x63, 0x6b, + 0x65, 0x74, 0x5f, 0x6c, 0x69, 0x6e, 0x6b, 0x5f, 0x71, 0x75, 0x61, 0x6c, 0x69, 0x66, 0x69, 0x63, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1e, 0x67, 0x6e, 0x6f, + 0x69, 0x2e, 0x70, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x5f, 0x6c, 0x69, 0x6e, 0x6b, 0x5f, 0x71, 0x75, + 0x61, 0x6c, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0x2c, 0x67, 0x69, 0x74, + 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6f, 0x6e, 0x66, + 0x69, 0x67, 0x2f, 0x67, 0x6e, 0x6f, 0x69, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x74, 0x79, + 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x75, 0x72, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, + 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2f, 0x72, 0x70, 0x63, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x22, 0x6b, 0x0a, 0x0d, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x5a, 0x0a, 0x0a, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, + 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3a, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, + 0x70, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x5f, 0x6c, 0x69, 0x6e, 0x6b, 0x5f, 0x71, 0x75, 0x61, 0x6c, + 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x51, 0x75, 0x61, 0x6c, 0x69, 0x66, + 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0a, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x73, + 0x22, 0xb3, 0x01, 0x0a, 0x0e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x52, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x3a, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x70, 0x61, 0x63, 0x6b, 0x65, + 0x74, 0x5f, 0x6c, 0x69, 0x6e, 0x6b, 0x5f, 0x71, 0x75, 0x61, 0x6c, 0x69, 0x66, 0x69, 0x63, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, + 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x1a, 0x4d, 0x0a, 0x0b, 0x53, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x28, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xc4, 0x01, 0x0a, 0x0f, 0x4e, 0x54, 0x50, 0x53, 0x79, + 0x6e, 0x63, 0x65, 0x64, 0x54, 0x69, 0x6d, 0x69, 0x6e, 0x67, 0x12, 0x39, 0x0a, 0x0a, 0x73, 0x74, + 0x61, 0x72, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x73, 0x74, 0x61, 0x72, + 0x74, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x35, 0x0a, 0x08, 0x65, 0x6e, 0x64, 0x5f, 0x74, 0x69, 0x6d, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, + 0x61, 0x6d, 0x70, 0x52, 0x07, 0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x3f, 0x0a, 0x0d, + 0x74, 0x65, 0x61, 0x72, 0x64, 0x6f, 0x77, 0x6e, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, + 0x0c, 0x74, 0x65, 0x61, 0x72, 0x64, 0x6f, 0x77, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x22, 0xe2, 0x02, + 0x0a, 0x0f, 0x52, 0x50, 0x43, 0x53, 0x79, 0x6e, 0x63, 0x65, 0x64, 0x54, 0x69, 0x6d, 0x69, 0x6e, + 0x67, 0x12, 0x45, 0x0a, 0x11, 0x70, 0x72, 0x65, 0x5f, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x64, 0x75, + 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, + 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0f, 0x70, 0x72, 0x65, 0x53, 0x79, 0x6e, 0x63, + 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x40, 0x0a, 0x0e, 0x73, 0x65, 0x74, 0x75, + 0x70, 0x5f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0d, 0x73, 0x65, 0x74, + 0x75, 0x70, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x35, 0x0a, 0x08, 0x64, 0x75, + 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, + 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x08, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x12, 0x47, 0x0a, 0x12, 0x70, 0x6f, 0x73, 0x74, 0x5f, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x64, + 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, + 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x10, 0x70, 0x6f, 0x73, 0x74, 0x53, 0x79, + 0x6e, 0x63, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x46, 0x0a, 0x11, 0x74, 0x65, + 0x61, 0x72, 0x64, 0x6f, 0x77, 0x6e, 0x5f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x52, 0x10, 0x74, 0x65, 0x61, 0x72, 0x64, 0x6f, 0x77, 0x6e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x22, 0x8c, 0x05, 0x0a, 0x1a, 0x51, 0x75, 0x61, 0x6c, 0x69, 0x66, 0x69, 0x63, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, + 0x64, 0x12, 0x25, 0x0a, 0x0e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x5f, 0x6e, + 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x69, 0x6e, 0x74, 0x65, 0x72, + 0x66, 0x61, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x43, 0x0a, 0x03, 0x6e, 0x74, 0x70, 0x18, + 0x65, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x70, 0x61, 0x63, + 0x6b, 0x65, 0x74, 0x5f, 0x6c, 0x69, 0x6e, 0x6b, 0x5f, 0x71, 0x75, 0x61, 0x6c, 0x69, 0x66, 0x69, + 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4e, 0x54, 0x50, 0x53, 0x79, 0x6e, 0x63, 0x65, 0x64, + 0x54, 0x69, 0x6d, 0x69, 0x6e, 0x67, 0x48, 0x00, 0x52, 0x03, 0x6e, 0x74, 0x70, 0x12, 0x43, 0x0a, + 0x03, 0x72, 0x70, 0x63, 0x18, 0x66, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x67, 0x6e, 0x6f, + 0x69, 0x2e, 0x70, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x5f, 0x6c, 0x69, 0x6e, 0x6b, 0x5f, 0x71, 0x75, + 0x61, 0x6c, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x52, 0x50, 0x43, 0x53, + 0x79, 0x6e, 0x63, 0x65, 0x64, 0x54, 0x69, 0x6d, 0x69, 0x6e, 0x67, 0x48, 0x00, 0x52, 0x03, 0x72, + 0x70, 0x63, 0x12, 0x69, 0x0a, 0x10, 0x70, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x5f, 0x67, 0x65, 0x6e, + 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x6f, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3c, 0x2e, 0x67, + 0x6e, 0x6f, 0x69, 0x2e, 0x70, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x5f, 0x6c, 0x69, 0x6e, 0x6b, 0x5f, + 0x71, 0x75, 0x61, 0x6c, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x50, 0x61, + 0x63, 0x6b, 0x65, 0x74, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x43, 0x6f, 0x6e, + 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x01, 0x52, 0x0f, 0x70, 0x61, + 0x63, 0x6b, 0x65, 0x74, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x66, 0x0a, + 0x0f, 0x70, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x5f, 0x69, 0x6e, 0x6a, 0x65, 0x63, 0x74, 0x6f, 0x72, + 0x18, 0x70, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3b, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x70, 0x61, + 0x63, 0x6b, 0x65, 0x74, 0x5f, 0x6c, 0x69, 0x6e, 0x6b, 0x5f, 0x71, 0x75, 0x61, 0x6c, 0x69, 0x66, + 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x49, 0x6e, + 0x6a, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x48, 0x01, 0x52, 0x0e, 0x70, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x49, 0x6e, 0x6a, + 0x65, 0x63, 0x74, 0x6f, 0x72, 0x12, 0x5d, 0x0a, 0x0c, 0x70, 0x6d, 0x64, 0x5f, 0x6c, 0x6f, 0x6f, + 0x70, 0x62, 0x61, 0x63, 0x6b, 0x18, 0x71, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x38, 0x2e, 0x67, 0x6e, + 0x6f, 0x69, 0x2e, 0x70, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x5f, 0x6c, 0x69, 0x6e, 0x6b, 0x5f, 0x71, + 0x75, 0x61, 0x6c, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x50, 0x6d, 0x64, + 0x4c, 0x6f, 0x6f, 0x70, 0x62, 0x61, 0x63, 0x6b, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x01, 0x52, 0x0b, 0x70, 0x6d, 0x64, 0x4c, 0x6f, 0x6f, 0x70, + 0x62, 0x61, 0x63, 0x6b, 0x12, 0x60, 0x0a, 0x0d, 0x61, 0x73, 0x69, 0x63, 0x5f, 0x6c, 0x6f, 0x6f, + 0x70, 0x62, 0x61, 0x63, 0x6b, 0x18, 0x72, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x39, 0x2e, 0x67, 0x6e, + 0x6f, 0x69, 0x2e, 0x70, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x5f, 0x6c, 0x69, 0x6e, 0x6b, 0x5f, 0x71, + 0x75, 0x61, 0x6c, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x41, 0x73, 0x69, + 0x63, 0x4c, 0x6f, 0x6f, 0x70, 0x62, 0x61, 0x63, 0x6b, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, + 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x01, 0x52, 0x0c, 0x61, 0x73, 0x69, 0x63, 0x4c, 0x6f, + 0x6f, 0x70, 0x62, 0x61, 0x63, 0x6b, 0x42, 0x08, 0x0a, 0x06, 0x74, 0x69, 0x6d, 0x69, 0x6e, 0x67, + 0x42, 0x0f, 0x0a, 0x0d, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x5f, 0x74, 0x79, 0x70, + 0x65, 0x22, 0x60, 0x0a, 0x1c, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x47, 0x65, 0x6e, 0x65, 0x72, + 0x61, 0x74, 0x6f, 0x72, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x5f, 0x72, 0x61, 0x74, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0a, 0x70, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x61, + 0x74, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x5f, 0x73, 0x69, 0x7a, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0a, 0x70, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x53, + 0x69, 0x7a, 0x65, 0x22, 0xb3, 0x02, 0x0a, 0x1b, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x49, 0x6e, + 0x6a, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x12, 0x21, 0x0a, 0x0c, 0x70, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x5f, 0x63, 0x6f, + 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0b, 0x70, 0x61, 0x63, 0x6b, 0x65, + 0x74, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x61, 0x63, 0x6b, 0x65, 0x74, + 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0a, 0x70, 0x61, 0x63, + 0x6b, 0x65, 0x74, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x5d, 0x0a, 0x0c, 0x70, 0x6d, 0x64, 0x5f, 0x6c, + 0x6f, 0x6f, 0x70, 0x62, 0x61, 0x63, 0x6b, 0x18, 0x65, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x38, 0x2e, + 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x70, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x5f, 0x6c, 0x69, 0x6e, 0x6b, + 0x5f, 0x71, 0x75, 0x61, 0x6c, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x50, + 0x6d, 0x64, 0x4c, 0x6f, 0x6f, 0x70, 0x62, 0x61, 0x63, 0x6b, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, + 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x0b, 0x70, 0x6d, 0x64, 0x4c, 0x6f, + 0x6f, 0x70, 0x62, 0x61, 0x63, 0x6b, 0x12, 0x60, 0x0a, 0x0d, 0x61, 0x73, 0x69, 0x63, 0x5f, 0x6c, + 0x6f, 0x6f, 0x70, 0x62, 0x61, 0x63, 0x6b, 0x18, 0x66, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x39, 0x2e, + 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x70, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x5f, 0x6c, 0x69, 0x6e, 0x6b, + 0x5f, 0x71, 0x75, 0x61, 0x6c, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x41, + 0x73, 0x69, 0x63, 0x4c, 0x6f, 0x6f, 0x70, 0x62, 0x61, 0x63, 0x6b, 0x43, 0x6f, 0x6e, 0x66, 0x69, + 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x0c, 0x61, 0x73, 0x69, 0x63, + 0x4c, 0x6f, 0x6f, 0x70, 0x62, 0x61, 0x63, 0x6b, 0x42, 0x0f, 0x0a, 0x0d, 0x6c, 0x6f, 0x6f, 0x70, + 0x62, 0x61, 0x63, 0x6b, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x22, 0x1a, 0x0a, 0x18, 0x50, 0x6d, 0x64, + 0x4c, 0x6f, 0x6f, 0x70, 0x62, 0x61, 0x63, 0x6b, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x1b, 0x0a, 0x19, 0x41, 0x73, 0x69, 0x63, 0x4c, 0x6f, 0x6f, + 0x70, 0x62, 0x61, 0x63, 0x6b, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x22, 0x1e, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x10, 0x0a, 0x03, 0x69, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x03, 0x69, + 0x64, 0x73, 0x22, 0xd2, 0x01, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x52, 0x0a, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x18, 0x01, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x38, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x70, 0x61, 0x63, 0x6b, 0x65, + 0x74, 0x5f, 0x6c, 0x69, 0x6e, 0x6b, 0x5f, 0x71, 0x75, 0x61, 0x6c, 0x69, 0x66, 0x69, 0x63, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x2e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x07, 0x72, + 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x1a, 0x6f, 0x0a, 0x0c, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, + 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x49, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x33, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x70, + 0x61, 0x63, 0x6b, 0x65, 0x74, 0x5f, 0x6c, 0x69, 0x6e, 0x6b, 0x5f, 0x71, 0x75, 0x61, 0x6c, 0x69, + 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x51, 0x75, 0x61, 0x6c, 0x69, 0x66, 0x69, + 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xe2, 0x04, 0x0a, 0x13, 0x51, 0x75, 0x61, 0x6c, + 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, + 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, + 0x25, 0x0a, 0x0e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, + 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x48, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x32, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x70, 0x61, 0x63, + 0x6b, 0x65, 0x74, 0x5f, 0x6c, 0x69, 0x6e, 0x6b, 0x5f, 0x71, 0x75, 0x61, 0x6c, 0x69, 0x66, 0x69, + 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x51, 0x75, 0x61, 0x6c, 0x69, 0x66, 0x69, 0x63, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, + 0x12, 0x21, 0x0a, 0x0c, 0x70, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x5f, 0x73, 0x65, 0x6e, 0x74, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x70, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x53, + 0x65, 0x6e, 0x74, 0x12, 0x29, 0x0a, 0x10, 0x70, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x5f, 0x72, + 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0f, 0x70, + 0x61, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x64, 0x12, 0x23, + 0x0a, 0x0d, 0x70, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x5f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, + 0x06, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0c, 0x70, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x45, 0x72, + 0x72, 0x6f, 0x72, 0x12, 0x27, 0x0a, 0x0f, 0x70, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x5f, 0x64, + 0x72, 0x6f, 0x70, 0x70, 0x65, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0e, 0x70, 0x61, + 0x63, 0x6b, 0x65, 0x74, 0x73, 0x44, 0x72, 0x6f, 0x70, 0x70, 0x65, 0x64, 0x12, 0x39, 0x0a, 0x0a, + 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x73, 0x74, + 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x35, 0x0a, 0x08, 0x65, 0x6e, 0x64, 0x5f, 0x74, + 0x69, 0x6d, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, + 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x07, 0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x42, + 0x0a, 0x1e, 0x65, 0x78, 0x70, 0x65, 0x63, 0x74, 0x65, 0x64, 0x5f, 0x72, 0x61, 0x74, 0x65, 0x5f, + 0x62, 0x79, 0x74, 0x65, 0x73, 0x5f, 0x70, 0x65, 0x72, 0x5f, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, + 0x18, 0x0a, 0x20, 0x01, 0x28, 0x04, 0x52, 0x1a, 0x65, 0x78, 0x70, 0x65, 0x63, 0x74, 0x65, 0x64, + 0x52, 0x61, 0x74, 0x65, 0x42, 0x79, 0x74, 0x65, 0x73, 0x50, 0x65, 0x72, 0x53, 0x65, 0x63, 0x6f, + 0x6e, 0x64, 0x12, 0x4c, 0x0a, 0x23, 0x71, 0x75, 0x61, 0x6c, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x61, 0x74, 0x65, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x5f, 0x70, + 0x65, 0x72, 0x5f, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x04, 0x52, + 0x1f, 0x71, 0x75, 0x61, 0x6c, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x61, + 0x74, 0x65, 0x42, 0x79, 0x74, 0x65, 0x73, 0x50, 0x65, 0x72, 0x53, 0x65, 0x63, 0x6f, 0x6e, 0x64, + 0x12, 0x2a, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x12, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x21, 0x0a, 0x0d, + 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x10, 0x0a, + 0x03, 0x69, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x03, 0x69, 0x64, 0x73, 0x22, + 0xb7, 0x01, 0x0a, 0x0e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x55, 0x0a, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x18, 0x01, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x3b, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x70, 0x61, 0x63, 0x6b, 0x65, + 0x74, 0x5f, 0x6c, 0x69, 0x6e, 0x6b, 0x5f, 0x71, 0x75, 0x61, 0x6c, 0x69, 0x66, 0x69, 0x63, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x2e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, + 0x52, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x1a, 0x4e, 0x0a, 0x0c, 0x52, 0x65, 0x73, + 0x75, 0x6c, 0x74, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x28, 0x0a, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x15, 0x0a, 0x13, 0x43, 0x61, 0x70, + 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x69, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x22, 0xdf, 0x02, 0x0a, 0x14, 0x43, 0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x69, 0x65, + 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2e, 0x0a, 0x04, 0x74, 0x69, 0x6d, + 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, + 0x61, 0x6d, 0x70, 0x52, 0x04, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x6e, 0x74, 0x70, + 0x5f, 0x73, 0x79, 0x6e, 0x63, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x6e, + 0x74, 0x70, 0x53, 0x79, 0x6e, 0x63, 0x65, 0x64, 0x12, 0x53, 0x0a, 0x09, 0x67, 0x65, 0x6e, 0x65, + 0x72, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x35, 0x2e, 0x67, 0x6e, + 0x6f, 0x69, 0x2e, 0x70, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x5f, 0x6c, 0x69, 0x6e, 0x6b, 0x5f, 0x71, + 0x75, 0x61, 0x6c, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x47, 0x65, 0x6e, + 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x43, 0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x69, + 0x65, 0x73, 0x52, 0x09, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x53, 0x0a, + 0x09, 0x72, 0x65, 0x66, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x35, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x70, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x5f, 0x6c, + 0x69, 0x6e, 0x6b, 0x5f, 0x71, 0x75, 0x61, 0x6c, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x2e, 0x52, 0x65, 0x66, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x43, 0x61, 0x70, 0x61, 0x62, + 0x69, 0x6c, 0x69, 0x74, 0x69, 0x65, 0x73, 0x52, 0x09, 0x72, 0x65, 0x66, 0x6c, 0x65, 0x63, 0x74, + 0x6f, 0x72, 0x12, 0x4e, 0x0a, 0x24, 0x6d, 0x61, 0x78, 0x5f, 0x68, 0x69, 0x73, 0x74, 0x6f, 0x72, + 0x69, 0x63, 0x61, 0x6c, 0x5f, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x5f, 0x70, 0x65, 0x72, + 0x5f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, + 0x52, 0x20, 0x6d, 0x61, 0x78, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x69, 0x63, 0x61, 0x6c, 0x52, + 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x50, 0x65, 0x72, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, + 0x63, 0x65, 0x22, 0xe4, 0x02, 0x0a, 0x1b, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x47, 0x65, 0x6e, + 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x43, 0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x69, + 0x65, 0x73, 0x12, 0x17, 0x0a, 0x07, 0x6d, 0x61, 0x78, 0x5f, 0x62, 0x70, 0x73, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x04, 0x52, 0x06, 0x6d, 0x61, 0x78, 0x42, 0x70, 0x73, 0x12, 0x17, 0x0a, 0x07, 0x6d, + 0x61, 0x78, 0x5f, 0x70, 0x70, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x6d, 0x61, + 0x78, 0x50, 0x70, 0x73, 0x12, 0x17, 0x0a, 0x07, 0x6d, 0x69, 0x6e, 0x5f, 0x6d, 0x74, 0x75, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x6d, 0x69, 0x6e, 0x4d, 0x74, 0x75, 0x12, 0x17, 0x0a, + 0x07, 0x6d, 0x61, 0x78, 0x5f, 0x6d, 0x74, 0x75, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, + 0x6d, 0x61, 0x78, 0x4d, 0x74, 0x75, 0x12, 0x47, 0x0a, 0x12, 0x6d, 0x69, 0x6e, 0x5f, 0x73, 0x65, + 0x74, 0x75, 0x70, 0x5f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x10, 0x6d, + 0x69, 0x6e, 0x53, 0x65, 0x74, 0x75, 0x70, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, + 0x4d, 0x0a, 0x15, 0x6d, 0x69, 0x6e, 0x5f, 0x74, 0x65, 0x61, 0x72, 0x64, 0x6f, 0x77, 0x6e, 0x5f, + 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x13, 0x6d, 0x69, 0x6e, 0x54, 0x65, + 0x61, 0x72, 0x64, 0x6f, 0x77, 0x6e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x49, + 0x0a, 0x13, 0x6d, 0x69, 0x6e, 0x5f, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x5f, 0x69, 0x6e, 0x74, + 0x65, 0x72, 0x76, 0x61, 0x6c, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, + 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x11, 0x6d, 0x69, 0x6e, 0x53, 0x61, 0x6d, 0x70, 0x6c, + 0x65, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x22, 0xf8, 0x03, 0x0a, 0x1a, 0x50, 0x61, + 0x63, 0x6b, 0x65, 0x74, 0x49, 0x6e, 0x6a, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x43, 0x61, 0x70, 0x61, + 0x62, 0x69, 0x6c, 0x69, 0x74, 0x69, 0x65, 0x73, 0x12, 0x17, 0x0a, 0x07, 0x6d, 0x69, 0x6e, 0x5f, + 0x6d, 0x74, 0x75, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x6d, 0x69, 0x6e, 0x4d, 0x74, + 0x75, 0x12, 0x17, 0x0a, 0x07, 0x6d, 0x61, 0x78, 0x5f, 0x6d, 0x74, 0x75, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0d, 0x52, 0x06, 0x6d, 0x61, 0x78, 0x4d, 0x74, 0x75, 0x12, 0x30, 0x0a, 0x14, 0x6d, 0x69, + 0x6e, 0x5f, 0x69, 0x6e, 0x6a, 0x65, 0x63, 0x74, 0x65, 0x64, 0x5f, 0x70, 0x61, 0x63, 0x6b, 0x65, + 0x74, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x12, 0x6d, 0x69, 0x6e, 0x49, 0x6e, 0x6a, + 0x65, 0x63, 0x74, 0x65, 0x64, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x12, 0x30, 0x0a, 0x14, + 0x6d, 0x61, 0x78, 0x5f, 0x69, 0x6e, 0x6a, 0x65, 0x63, 0x74, 0x65, 0x64, 0x5f, 0x70, 0x61, 0x63, + 0x6b, 0x65, 0x74, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x12, 0x6d, 0x61, 0x78, 0x49, + 0x6e, 0x6a, 0x65, 0x63, 0x74, 0x65, 0x64, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x12, 0x47, + 0x0a, 0x12, 0x6d, 0x69, 0x6e, 0x5f, 0x73, 0x65, 0x74, 0x75, 0x70, 0x5f, 0x64, 0x75, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x10, 0x6d, 0x69, 0x6e, 0x53, 0x65, 0x74, 0x75, 0x70, 0x44, + 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x4d, 0x0a, 0x15, 0x6d, 0x69, 0x6e, 0x5f, 0x74, + 0x65, 0x61, 0x72, 0x64, 0x6f, 0x77, 0x6e, 0x5f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x52, 0x13, 0x6d, 0x69, 0x6e, 0x54, 0x65, 0x61, 0x72, 0x64, 0x6f, 0x77, 0x6e, 0x44, 0x75, + 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x49, 0x0a, 0x13, 0x6d, 0x69, 0x6e, 0x5f, 0x73, 0x61, + 0x6d, 0x70, 0x6c, 0x65, 0x5f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x18, 0x07, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x11, + 0x6d, 0x69, 0x6e, 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, + 0x6c, 0x12, 0x61, 0x0a, 0x0e, 0x6c, 0x6f, 0x6f, 0x70, 0x62, 0x61, 0x63, 0x6b, 0x5f, 0x6d, 0x6f, + 0x64, 0x65, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0e, 0x32, 0x3a, 0x2e, 0x67, 0x6e, 0x6f, 0x69, + 0x2e, 0x70, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x5f, 0x6c, 0x69, 0x6e, 0x6b, 0x5f, 0x71, 0x75, 0x61, + 0x6c, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x50, 0x61, 0x63, 0x6b, 0x65, + 0x74, 0x49, 0x6e, 0x6a, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x4c, 0x6f, 0x6f, 0x70, 0x62, 0x61, 0x63, + 0x6b, 0x4d, 0x6f, 0x64, 0x65, 0x52, 0x0d, 0x6c, 0x6f, 0x6f, 0x70, 0x62, 0x61, 0x63, 0x6b, 0x4d, + 0x6f, 0x64, 0x65, 0x73, 0x22, 0xe4, 0x01, 0x0a, 0x15, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, + 0x6f, 0x72, 0x43, 0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x69, 0x65, 0x73, 0x12, 0x66, + 0x0a, 0x10, 0x70, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, + 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3b, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, + 0x70, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x5f, 0x6c, 0x69, 0x6e, 0x6b, 0x5f, 0x71, 0x75, 0x61, 0x6c, + 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, + 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x43, 0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, + 0x69, 0x74, 0x69, 0x65, 0x73, 0x52, 0x0f, 0x70, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x47, 0x65, 0x6e, + 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x63, 0x0a, 0x0f, 0x70, 0x61, 0x63, 0x6b, 0x65, 0x74, + 0x5f, 0x69, 0x6e, 0x6a, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x3a, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x70, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x5f, 0x6c, 0x69, + 0x6e, 0x6b, 0x5f, 0x71, 0x75, 0x61, 0x6c, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x2e, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x49, 0x6e, 0x6a, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x43, + 0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x69, 0x65, 0x73, 0x52, 0x0e, 0x70, 0x61, 0x63, + 0x6b, 0x65, 0x74, 0x49, 0x6e, 0x6a, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x22, 0xb1, 0x01, 0x0a, 0x17, + 0x50, 0x6d, 0x64, 0x4c, 0x6f, 0x6f, 0x70, 0x62, 0x61, 0x63, 0x6b, 0x43, 0x61, 0x70, 0x61, 0x62, + 0x69, 0x6c, 0x69, 0x74, 0x69, 0x65, 0x73, 0x12, 0x47, 0x0a, 0x12, 0x6d, 0x69, 0x6e, 0x5f, 0x73, + 0x65, 0x74, 0x75, 0x70, 0x5f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x10, + 0x6d, 0x69, 0x6e, 0x53, 0x65, 0x74, 0x75, 0x70, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x12, 0x4d, 0x0a, 0x15, 0x6d, 0x69, 0x6e, 0x5f, 0x74, 0x65, 0x61, 0x72, 0x64, 0x6f, 0x77, 0x6e, + 0x5f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x13, 0x6d, 0x69, 0x6e, 0x54, + 0x65, 0x61, 0x72, 0x64, 0x6f, 0x77, 0x6e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, + 0xfc, 0x01, 0x0a, 0x18, 0x41, 0x73, 0x69, 0x63, 0x4c, 0x6f, 0x6f, 0x70, 0x62, 0x61, 0x63, 0x6b, + 0x43, 0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x69, 0x65, 0x73, 0x12, 0x47, 0x0a, 0x12, + 0x6d, 0x69, 0x6e, 0x5f, 0x73, 0x65, 0x74, 0x75, 0x70, 0x5f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x52, 0x10, 0x6d, 0x69, 0x6e, 0x53, 0x65, 0x74, 0x75, 0x70, 0x44, 0x75, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x4d, 0x0a, 0x15, 0x6d, 0x69, 0x6e, 0x5f, 0x74, 0x65, 0x61, + 0x72, 0x64, 0x6f, 0x77, 0x6e, 0x5f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, + 0x13, 0x6d, 0x69, 0x6e, 0x54, 0x65, 0x61, 0x72, 0x64, 0x6f, 0x77, 0x6e, 0x44, 0x75, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x48, 0x0a, 0x06, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x18, 0x03, + 0x20, 0x03, 0x28, 0x0e, 0x32, 0x30, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x70, 0x61, 0x63, 0x6b, + 0x65, 0x74, 0x5f, 0x6c, 0x69, 0x6e, 0x6b, 0x5f, 0x71, 0x75, 0x61, 0x6c, 0x69, 0x66, 0x69, 0x63, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x4d, 0x61, 0x74, 0x63, + 0x68, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x52, 0x06, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x22, 0xd2, + 0x01, 0x0a, 0x15, 0x52, 0x65, 0x66, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x43, 0x61, 0x70, 0x61, + 0x62, 0x69, 0x6c, 0x69, 0x74, 0x69, 0x65, 0x73, 0x12, 0x5a, 0x0a, 0x0c, 0x70, 0x6d, 0x64, 0x5f, + 0x6c, 0x6f, 0x6f, 0x70, 0x62, 0x61, 0x63, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x37, + 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x70, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x5f, 0x6c, 0x69, 0x6e, + 0x6b, 0x5f, 0x71, 0x75, 0x61, 0x6c, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, + 0x50, 0x6d, 0x64, 0x4c, 0x6f, 0x6f, 0x70, 0x62, 0x61, 0x63, 0x6b, 0x43, 0x61, 0x70, 0x61, 0x62, + 0x69, 0x6c, 0x69, 0x74, 0x69, 0x65, 0x73, 0x52, 0x0b, 0x70, 0x6d, 0x64, 0x4c, 0x6f, 0x6f, 0x70, + 0x62, 0x61, 0x63, 0x6b, 0x12, 0x5d, 0x0a, 0x0d, 0x61, 0x73, 0x69, 0x63, 0x5f, 0x6c, 0x6f, 0x6f, + 0x70, 0x62, 0x61, 0x63, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x38, 0x2e, 0x67, 0x6e, + 0x6f, 0x69, 0x2e, 0x70, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x5f, 0x6c, 0x69, 0x6e, 0x6b, 0x5f, 0x71, + 0x75, 0x61, 0x6c, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x41, 0x73, 0x69, + 0x63, 0x4c, 0x6f, 0x6f, 0x70, 0x62, 0x61, 0x63, 0x6b, 0x43, 0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, + 0x69, 0x74, 0x69, 0x65, 0x73, 0x52, 0x0c, 0x61, 0x73, 0x69, 0x63, 0x4c, 0x6f, 0x6f, 0x70, 0x62, + 0x61, 0x63, 0x6b, 0x22, 0x0d, 0x0a, 0x0b, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x22, 0x54, 0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x44, 0x0a, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x18, 0x01, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x70, 0x61, 0x63, 0x6b, 0x65, + 0x74, 0x5f, 0x6c, 0x69, 0x6e, 0x6b, 0x5f, 0x71, 0x75, 0x61, 0x6c, 0x69, 0x66, 0x69, 0x63, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, + 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x22, 0x8d, 0x01, 0x0a, 0x0a, 0x4c, 0x69, 0x73, + 0x74, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x48, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x32, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x70, 0x61, + 0x63, 0x6b, 0x65, 0x74, 0x5f, 0x6c, 0x69, 0x6e, 0x6b, 0x5f, 0x71, 0x75, 0x61, 0x6c, 0x69, 0x66, + 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x51, 0x75, 0x61, 0x6c, 0x69, 0x66, 0x69, 0x63, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, + 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x5f, 0x6e, + 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x69, 0x6e, 0x74, 0x65, 0x72, + 0x66, 0x61, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x2a, 0xfb, 0x01, 0x0a, 0x12, 0x51, 0x75, 0x61, + 0x6c, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, + 0x23, 0x0a, 0x1f, 0x51, 0x55, 0x41, 0x4c, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x49, 0x4f, 0x4e, + 0x5f, 0x53, 0x54, 0x41, 0x54, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, + 0x45, 0x44, 0x10, 0x00, 0x12, 0x1d, 0x0a, 0x19, 0x51, 0x55, 0x41, 0x4c, 0x49, 0x46, 0x49, 0x43, + 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x45, 0x5f, 0x45, 0x52, 0x52, 0x4f, + 0x52, 0x10, 0x01, 0x12, 0x1c, 0x0a, 0x18, 0x51, 0x55, 0x41, 0x4c, 0x49, 0x46, 0x49, 0x43, 0x41, + 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x45, 0x5f, 0x49, 0x44, 0x4c, 0x45, 0x10, + 0x02, 0x12, 0x1d, 0x0a, 0x19, 0x51, 0x55, 0x41, 0x4c, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x49, + 0x4f, 0x4e, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x45, 0x5f, 0x53, 0x45, 0x54, 0x55, 0x50, 0x10, 0x03, + 0x12, 0x1f, 0x0a, 0x1b, 0x51, 0x55, 0x41, 0x4c, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x49, 0x4f, + 0x4e, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x45, 0x5f, 0x52, 0x55, 0x4e, 0x4e, 0x49, 0x4e, 0x47, 0x10, + 0x04, 0x12, 0x20, 0x0a, 0x1c, 0x51, 0x55, 0x41, 0x4c, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x49, + 0x4f, 0x4e, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x45, 0x5f, 0x54, 0x45, 0x41, 0x52, 0x44, 0x4f, 0x57, + 0x4e, 0x10, 0x05, 0x12, 0x21, 0x0a, 0x1d, 0x51, 0x55, 0x41, 0x4c, 0x49, 0x46, 0x49, 0x43, 0x41, + 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x45, 0x5f, 0x43, 0x4f, 0x4d, 0x50, 0x4c, + 0x45, 0x54, 0x45, 0x44, 0x10, 0x06, 0x2a, 0x9a, 0x01, 0x0a, 0x1a, 0x50, 0x61, 0x63, 0x6b, 0x65, + 0x74, 0x49, 0x6e, 0x6a, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x4c, 0x6f, 0x6f, 0x70, 0x62, 0x61, 0x63, + 0x6b, 0x4d, 0x6f, 0x64, 0x65, 0x12, 0x2d, 0x0a, 0x29, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, + 0x49, 0x4e, 0x4a, 0x45, 0x43, 0x54, 0x4f, 0x52, 0x5f, 0x4c, 0x4f, 0x4f, 0x50, 0x42, 0x41, 0x43, + 0x4b, 0x5f, 0x4d, 0x4f, 0x44, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, + 0x45, 0x44, 0x10, 0x00, 0x12, 0x25, 0x0a, 0x21, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x49, + 0x4e, 0x4a, 0x45, 0x43, 0x54, 0x4f, 0x52, 0x5f, 0x4c, 0x4f, 0x4f, 0x50, 0x42, 0x41, 0x43, 0x4b, + 0x5f, 0x4d, 0x4f, 0x44, 0x45, 0x5f, 0x50, 0x4d, 0x44, 0x10, 0x01, 0x12, 0x26, 0x0a, 0x22, 0x50, + 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x49, 0x4e, 0x4a, 0x45, 0x43, 0x54, 0x4f, 0x52, 0x5f, 0x4c, + 0x4f, 0x4f, 0x50, 0x42, 0x41, 0x43, 0x4b, 0x5f, 0x4d, 0x4f, 0x44, 0x45, 0x5f, 0x41, 0x53, 0x49, + 0x43, 0x10, 0x02, 0x2a, 0x87, 0x01, 0x0a, 0x10, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x4d, 0x61, + 0x74, 0x63, 0x68, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x12, 0x22, 0x0a, 0x1e, 0x48, 0x45, 0x41, 0x44, + 0x45, 0x52, 0x5f, 0x4d, 0x41, 0x54, 0x43, 0x48, 0x5f, 0x46, 0x49, 0x45, 0x4c, 0x44, 0x5f, 0x55, + 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x19, 0x0a, 0x15, + 0x48, 0x45, 0x41, 0x44, 0x45, 0x52, 0x5f, 0x4d, 0x41, 0x54, 0x43, 0x48, 0x5f, 0x46, 0x49, 0x45, + 0x4c, 0x44, 0x5f, 0x4c, 0x32, 0x10, 0x01, 0x12, 0x19, 0x0a, 0x15, 0x48, 0x45, 0x41, 0x44, 0x45, + 0x52, 0x5f, 0x4d, 0x41, 0x54, 0x43, 0x48, 0x5f, 0x46, 0x49, 0x45, 0x4c, 0x44, 0x5f, 0x4c, 0x33, + 0x10, 0x02, 0x12, 0x19, 0x0a, 0x15, 0x48, 0x45, 0x41, 0x44, 0x45, 0x52, 0x5f, 0x4d, 0x41, 0x54, + 0x43, 0x48, 0x5f, 0x46, 0x49, 0x45, 0x4c, 0x44, 0x5f, 0x4c, 0x34, 0x10, 0x03, 0x32, 0xa3, 0x04, + 0x0a, 0x11, 0x4c, 0x69, 0x6e, 0x6b, 0x51, 0x75, 0x61, 0x6c, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x12, 0x67, 0x0a, 0x06, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x12, 0x2d, 0x2e, + 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x70, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x5f, 0x6c, 0x69, 0x6e, 0x6b, + 0x5f, 0x71, 0x75, 0x61, 0x6c, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x43, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2e, 0x2e, 0x67, + 0x6e, 0x6f, 0x69, 0x2e, 0x70, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x5f, 0x6c, 0x69, 0x6e, 0x6b, 0x5f, + 0x71, 0x75, 0x61, 0x6c, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x43, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5e, 0x0a, 0x03, + 0x47, 0x65, 0x74, 0x12, 0x2a, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x70, 0x61, 0x63, 0x6b, 0x65, + 0x74, 0x5f, 0x6c, 0x69, 0x6e, 0x6b, 0x5f, 0x71, 0x75, 0x61, 0x6c, 0x69, 0x66, 0x69, 0x63, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x2b, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x70, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x5f, 0x6c, 0x69, + 0x6e, 0x6b, 0x5f, 0x71, 0x75, 0x61, 0x6c, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x79, 0x0a, 0x0c, + 0x43, 0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x69, 0x65, 0x73, 0x12, 0x33, 0x2e, 0x67, + 0x6e, 0x6f, 0x69, 0x2e, 0x70, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x5f, 0x6c, 0x69, 0x6e, 0x6b, 0x5f, + 0x71, 0x75, 0x61, 0x6c, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x43, 0x61, + 0x70, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x69, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x34, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x70, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x5f, + 0x6c, 0x69, 0x6e, 0x6b, 0x5f, 0x71, 0x75, 0x61, 0x6c, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x2e, 0x43, 0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x69, 0x65, 0x73, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x67, 0x0a, 0x06, 0x44, 0x65, 0x6c, 0x65, 0x74, + 0x65, 0x12, 0x2d, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x70, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x5f, + 0x6c, 0x69, 0x6e, 0x6b, 0x5f, 0x71, 0x75, 0x61, 0x6c, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x2e, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x70, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x5f, 0x6c, + 0x69, 0x6e, 0x6b, 0x5f, 0x71, 0x75, 0x61, 0x6c, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x61, 0x0a, 0x04, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x2b, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, + 0x70, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x5f, 0x6c, 0x69, 0x6e, 0x6b, 0x5f, 0x71, 0x75, 0x61, 0x6c, + 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2c, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x70, 0x61, 0x63, + 0x6b, 0x65, 0x74, 0x5f, 0x6c, 0x69, 0x6e, 0x6b, 0x5f, 0x71, 0x75, 0x61, 0x6c, 0x69, 0x66, 0x69, + 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x42, 0x47, 0xd2, 0x3e, 0x05, 0x31, 0x2e, 0x31, 0x2e, 0x30, 0x5a, 0x3d, 0x67, + 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6f, + 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x67, 0x6e, 0x6f, 0x69, 0x2f, 0x70, 0x61, 0x63, 0x6b, 0x65, 0x74, + 0x5f, 0x6c, 0x69, 0x6e, 0x6b, 0x5f, 0x71, 0x75, 0x61, 0x6c, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x3b, 0x6c, 0x69, 0x6e, 0x6b, 0x71, 0x75, 0x61, 0x6c, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_packet_link_qualification_packet_link_qualification_proto_rawDescOnce sync.Once + file_packet_link_qualification_packet_link_qualification_proto_rawDescData = file_packet_link_qualification_packet_link_qualification_proto_rawDesc +) + +func file_packet_link_qualification_packet_link_qualification_proto_rawDescGZIP() []byte { + file_packet_link_qualification_packet_link_qualification_proto_rawDescOnce.Do(func() { + file_packet_link_qualification_packet_link_qualification_proto_rawDescData = protoimpl.X.CompressGZIP(file_packet_link_qualification_packet_link_qualification_proto_rawDescData) + }) + return file_packet_link_qualification_packet_link_qualification_proto_rawDescData +} + +var file_packet_link_qualification_packet_link_qualification_proto_enumTypes = make([]protoimpl.EnumInfo, 3) +var file_packet_link_qualification_packet_link_qualification_proto_msgTypes = make([]protoimpl.MessageInfo, 28) +var file_packet_link_qualification_packet_link_qualification_proto_goTypes = []interface{}{ + (QualificationState)(0), // 0: gnoi.packet_link_qualification.QualificationState + (PacketInjectorLoopbackMode)(0), // 1: gnoi.packet_link_qualification.PacketInjectorLoopbackMode + (HeaderMatchField)(0), // 2: gnoi.packet_link_qualification.HeaderMatchField + (*CreateRequest)(nil), // 3: gnoi.packet_link_qualification.CreateRequest + (*CreateResponse)(nil), // 4: gnoi.packet_link_qualification.CreateResponse + (*NTPSyncedTiming)(nil), // 5: gnoi.packet_link_qualification.NTPSyncedTiming + (*RPCSyncedTiming)(nil), // 6: gnoi.packet_link_qualification.RPCSyncedTiming + (*QualificationConfiguration)(nil), // 7: gnoi.packet_link_qualification.QualificationConfiguration + (*PacketGeneratorConfiguration)(nil), // 8: gnoi.packet_link_qualification.PacketGeneratorConfiguration + (*PacketInjectorConfiguration)(nil), // 9: gnoi.packet_link_qualification.PacketInjectorConfiguration + (*PmdLoopbackConfiguration)(nil), // 10: gnoi.packet_link_qualification.PmdLoopbackConfiguration + (*AsicLoopbackConfiguration)(nil), // 11: gnoi.packet_link_qualification.AsicLoopbackConfiguration + (*GetRequest)(nil), // 12: gnoi.packet_link_qualification.GetRequest + (*GetResponse)(nil), // 13: gnoi.packet_link_qualification.GetResponse + (*QualificationResult)(nil), // 14: gnoi.packet_link_qualification.QualificationResult + (*DeleteRequest)(nil), // 15: gnoi.packet_link_qualification.DeleteRequest + (*DeleteResponse)(nil), // 16: gnoi.packet_link_qualification.DeleteResponse + (*CapabilitiesRequest)(nil), // 17: gnoi.packet_link_qualification.CapabilitiesRequest + (*CapabilitiesResponse)(nil), // 18: gnoi.packet_link_qualification.CapabilitiesResponse + (*PacketGeneratorCapabilities)(nil), // 19: gnoi.packet_link_qualification.PacketGeneratorCapabilities + (*PacketInjectorCapabilities)(nil), // 20: gnoi.packet_link_qualification.PacketInjectorCapabilities + (*GeneratorCapabilities)(nil), // 21: gnoi.packet_link_qualification.GeneratorCapabilities + (*PmdLoopbackCapabilities)(nil), // 22: gnoi.packet_link_qualification.PmdLoopbackCapabilities + (*AsicLoopbackCapabilities)(nil), // 23: gnoi.packet_link_qualification.AsicLoopbackCapabilities + (*ReflectorCapabilities)(nil), // 24: gnoi.packet_link_qualification.ReflectorCapabilities + (*ListRequest)(nil), // 25: gnoi.packet_link_qualification.ListRequest + (*ListResponse)(nil), // 26: gnoi.packet_link_qualification.ListResponse + (*ListResult)(nil), // 27: gnoi.packet_link_qualification.ListResult + nil, // 28: gnoi.packet_link_qualification.CreateResponse.StatusEntry + nil, // 29: gnoi.packet_link_qualification.GetResponse.ResultsEntry + nil, // 30: gnoi.packet_link_qualification.DeleteResponse.ResultsEntry + (*timestamppb.Timestamp)(nil), // 31: google.protobuf.Timestamp + (*durationpb.Duration)(nil), // 32: google.protobuf.Duration + (*status.Status)(nil), // 33: google.rpc.Status +} +var file_packet_link_qualification_packet_link_qualification_proto_depIdxs = []int32{ + 7, // 0: gnoi.packet_link_qualification.CreateRequest.interfaces:type_name -> gnoi.packet_link_qualification.QualificationConfiguration + 28, // 1: gnoi.packet_link_qualification.CreateResponse.status:type_name -> gnoi.packet_link_qualification.CreateResponse.StatusEntry + 31, // 2: gnoi.packet_link_qualification.NTPSyncedTiming.start_time:type_name -> google.protobuf.Timestamp + 31, // 3: gnoi.packet_link_qualification.NTPSyncedTiming.end_time:type_name -> google.protobuf.Timestamp + 31, // 4: gnoi.packet_link_qualification.NTPSyncedTiming.teardown_time:type_name -> google.protobuf.Timestamp + 32, // 5: gnoi.packet_link_qualification.RPCSyncedTiming.pre_sync_duration:type_name -> google.protobuf.Duration + 32, // 6: gnoi.packet_link_qualification.RPCSyncedTiming.setup_duration:type_name -> google.protobuf.Duration + 32, // 7: gnoi.packet_link_qualification.RPCSyncedTiming.duration:type_name -> google.protobuf.Duration + 32, // 8: gnoi.packet_link_qualification.RPCSyncedTiming.post_sync_duration:type_name -> google.protobuf.Duration + 32, // 9: gnoi.packet_link_qualification.RPCSyncedTiming.teardown_duration:type_name -> google.protobuf.Duration + 5, // 10: gnoi.packet_link_qualification.QualificationConfiguration.ntp:type_name -> gnoi.packet_link_qualification.NTPSyncedTiming + 6, // 11: gnoi.packet_link_qualification.QualificationConfiguration.rpc:type_name -> gnoi.packet_link_qualification.RPCSyncedTiming + 8, // 12: gnoi.packet_link_qualification.QualificationConfiguration.packet_generator:type_name -> gnoi.packet_link_qualification.PacketGeneratorConfiguration + 9, // 13: gnoi.packet_link_qualification.QualificationConfiguration.packet_injector:type_name -> gnoi.packet_link_qualification.PacketInjectorConfiguration + 10, // 14: gnoi.packet_link_qualification.QualificationConfiguration.pmd_loopback:type_name -> gnoi.packet_link_qualification.PmdLoopbackConfiguration + 11, // 15: gnoi.packet_link_qualification.QualificationConfiguration.asic_loopback:type_name -> gnoi.packet_link_qualification.AsicLoopbackConfiguration + 10, // 16: gnoi.packet_link_qualification.PacketInjectorConfiguration.pmd_loopback:type_name -> gnoi.packet_link_qualification.PmdLoopbackConfiguration + 11, // 17: gnoi.packet_link_qualification.PacketInjectorConfiguration.asic_loopback:type_name -> gnoi.packet_link_qualification.AsicLoopbackConfiguration + 29, // 18: gnoi.packet_link_qualification.GetResponse.results:type_name -> gnoi.packet_link_qualification.GetResponse.ResultsEntry + 0, // 19: gnoi.packet_link_qualification.QualificationResult.state:type_name -> gnoi.packet_link_qualification.QualificationState + 31, // 20: gnoi.packet_link_qualification.QualificationResult.start_time:type_name -> google.protobuf.Timestamp + 31, // 21: gnoi.packet_link_qualification.QualificationResult.end_time:type_name -> google.protobuf.Timestamp + 33, // 22: gnoi.packet_link_qualification.QualificationResult.status:type_name -> google.rpc.Status + 30, // 23: gnoi.packet_link_qualification.DeleteResponse.results:type_name -> gnoi.packet_link_qualification.DeleteResponse.ResultsEntry + 31, // 24: gnoi.packet_link_qualification.CapabilitiesResponse.time:type_name -> google.protobuf.Timestamp + 21, // 25: gnoi.packet_link_qualification.CapabilitiesResponse.generator:type_name -> gnoi.packet_link_qualification.GeneratorCapabilities + 24, // 26: gnoi.packet_link_qualification.CapabilitiesResponse.reflector:type_name -> gnoi.packet_link_qualification.ReflectorCapabilities + 32, // 27: gnoi.packet_link_qualification.PacketGeneratorCapabilities.min_setup_duration:type_name -> google.protobuf.Duration + 32, // 28: gnoi.packet_link_qualification.PacketGeneratorCapabilities.min_teardown_duration:type_name -> google.protobuf.Duration + 32, // 29: gnoi.packet_link_qualification.PacketGeneratorCapabilities.min_sample_interval:type_name -> google.protobuf.Duration + 32, // 30: gnoi.packet_link_qualification.PacketInjectorCapabilities.min_setup_duration:type_name -> google.protobuf.Duration + 32, // 31: gnoi.packet_link_qualification.PacketInjectorCapabilities.min_teardown_duration:type_name -> google.protobuf.Duration + 32, // 32: gnoi.packet_link_qualification.PacketInjectorCapabilities.min_sample_interval:type_name -> google.protobuf.Duration + 1, // 33: gnoi.packet_link_qualification.PacketInjectorCapabilities.loopback_modes:type_name -> gnoi.packet_link_qualification.PacketInjectorLoopbackMode + 19, // 34: gnoi.packet_link_qualification.GeneratorCapabilities.packet_generator:type_name -> gnoi.packet_link_qualification.PacketGeneratorCapabilities + 20, // 35: gnoi.packet_link_qualification.GeneratorCapabilities.packet_injector:type_name -> gnoi.packet_link_qualification.PacketInjectorCapabilities + 32, // 36: gnoi.packet_link_qualification.PmdLoopbackCapabilities.min_setup_duration:type_name -> google.protobuf.Duration + 32, // 37: gnoi.packet_link_qualification.PmdLoopbackCapabilities.min_teardown_duration:type_name -> google.protobuf.Duration + 32, // 38: gnoi.packet_link_qualification.AsicLoopbackCapabilities.min_setup_duration:type_name -> google.protobuf.Duration + 32, // 39: gnoi.packet_link_qualification.AsicLoopbackCapabilities.min_teardown_duration:type_name -> google.protobuf.Duration + 2, // 40: gnoi.packet_link_qualification.AsicLoopbackCapabilities.fields:type_name -> gnoi.packet_link_qualification.HeaderMatchField + 22, // 41: gnoi.packet_link_qualification.ReflectorCapabilities.pmd_loopback:type_name -> gnoi.packet_link_qualification.PmdLoopbackCapabilities + 23, // 42: gnoi.packet_link_qualification.ReflectorCapabilities.asic_loopback:type_name -> gnoi.packet_link_qualification.AsicLoopbackCapabilities + 27, // 43: gnoi.packet_link_qualification.ListResponse.results:type_name -> gnoi.packet_link_qualification.ListResult + 0, // 44: gnoi.packet_link_qualification.ListResult.state:type_name -> gnoi.packet_link_qualification.QualificationState + 33, // 45: gnoi.packet_link_qualification.CreateResponse.StatusEntry.value:type_name -> google.rpc.Status + 14, // 46: gnoi.packet_link_qualification.GetResponse.ResultsEntry.value:type_name -> gnoi.packet_link_qualification.QualificationResult + 33, // 47: gnoi.packet_link_qualification.DeleteResponse.ResultsEntry.value:type_name -> google.rpc.Status + 3, // 48: gnoi.packet_link_qualification.LinkQualification.Create:input_type -> gnoi.packet_link_qualification.CreateRequest + 12, // 49: gnoi.packet_link_qualification.LinkQualification.Get:input_type -> gnoi.packet_link_qualification.GetRequest + 17, // 50: gnoi.packet_link_qualification.LinkQualification.Capabilities:input_type -> gnoi.packet_link_qualification.CapabilitiesRequest + 15, // 51: gnoi.packet_link_qualification.LinkQualification.Delete:input_type -> gnoi.packet_link_qualification.DeleteRequest + 25, // 52: gnoi.packet_link_qualification.LinkQualification.List:input_type -> gnoi.packet_link_qualification.ListRequest + 4, // 53: gnoi.packet_link_qualification.LinkQualification.Create:output_type -> gnoi.packet_link_qualification.CreateResponse + 13, // 54: gnoi.packet_link_qualification.LinkQualification.Get:output_type -> gnoi.packet_link_qualification.GetResponse + 18, // 55: gnoi.packet_link_qualification.LinkQualification.Capabilities:output_type -> gnoi.packet_link_qualification.CapabilitiesResponse + 16, // 56: gnoi.packet_link_qualification.LinkQualification.Delete:output_type -> gnoi.packet_link_qualification.DeleteResponse + 26, // 57: gnoi.packet_link_qualification.LinkQualification.List:output_type -> gnoi.packet_link_qualification.ListResponse + 53, // [53:58] is the sub-list for method output_type + 48, // [48:53] is the sub-list for method input_type + 48, // [48:48] is the sub-list for extension type_name + 48, // [48:48] is the sub-list for extension extendee + 0, // [0:48] is the sub-list for field type_name +} + +func init() { file_packet_link_qualification_packet_link_qualification_proto_init() } +func file_packet_link_qualification_packet_link_qualification_proto_init() { + if File_packet_link_qualification_packet_link_qualification_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_packet_link_qualification_packet_link_qualification_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_packet_link_qualification_packet_link_qualification_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_packet_link_qualification_packet_link_qualification_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*NTPSyncedTiming); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_packet_link_qualification_packet_link_qualification_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RPCSyncedTiming); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_packet_link_qualification_packet_link_qualification_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QualificationConfiguration); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_packet_link_qualification_packet_link_qualification_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PacketGeneratorConfiguration); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_packet_link_qualification_packet_link_qualification_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PacketInjectorConfiguration); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_packet_link_qualification_packet_link_qualification_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PmdLoopbackConfiguration); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_packet_link_qualification_packet_link_qualification_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AsicLoopbackConfiguration); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_packet_link_qualification_packet_link_qualification_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_packet_link_qualification_packet_link_qualification_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_packet_link_qualification_packet_link_qualification_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QualificationResult); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_packet_link_qualification_packet_link_qualification_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeleteRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_packet_link_qualification_packet_link_qualification_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeleteResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_packet_link_qualification_packet_link_qualification_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CapabilitiesRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_packet_link_qualification_packet_link_qualification_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CapabilitiesResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_packet_link_qualification_packet_link_qualification_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PacketGeneratorCapabilities); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_packet_link_qualification_packet_link_qualification_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PacketInjectorCapabilities); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_packet_link_qualification_packet_link_qualification_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GeneratorCapabilities); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_packet_link_qualification_packet_link_qualification_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PmdLoopbackCapabilities); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_packet_link_qualification_packet_link_qualification_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AsicLoopbackCapabilities); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_packet_link_qualification_packet_link_qualification_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ReflectorCapabilities); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_packet_link_qualification_packet_link_qualification_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_packet_link_qualification_packet_link_qualification_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_packet_link_qualification_packet_link_qualification_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListResult); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_packet_link_qualification_packet_link_qualification_proto_msgTypes[4].OneofWrappers = []interface{}{ + (*QualificationConfiguration_Ntp)(nil), + (*QualificationConfiguration_Rpc)(nil), + (*QualificationConfiguration_PacketGenerator)(nil), + (*QualificationConfiguration_PacketInjector)(nil), + (*QualificationConfiguration_PmdLoopback)(nil), + (*QualificationConfiguration_AsicLoopback)(nil), + } + file_packet_link_qualification_packet_link_qualification_proto_msgTypes[6].OneofWrappers = []interface{}{ + (*PacketInjectorConfiguration_PmdLoopback)(nil), + (*PacketInjectorConfiguration_AsicLoopback)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_packet_link_qualification_packet_link_qualification_proto_rawDesc, + NumEnums: 3, + NumMessages: 28, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_packet_link_qualification_packet_link_qualification_proto_goTypes, + DependencyIndexes: file_packet_link_qualification_packet_link_qualification_proto_depIdxs, + EnumInfos: file_packet_link_qualification_packet_link_qualification_proto_enumTypes, + MessageInfos: file_packet_link_qualification_packet_link_qualification_proto_msgTypes, + }.Build() + File_packet_link_qualification_packet_link_qualification_proto = out.File + file_packet_link_qualification_packet_link_qualification_proto_rawDesc = nil + file_packet_link_qualification_packet_link_qualification_proto_goTypes = nil + file_packet_link_qualification_packet_link_qualification_proto_depIdxs = nil +} diff --git a/src/sonic-framework/gnoi/packet_link_qualification/packet_link_qualification.proto b/src/sonic-framework/gnoi/packet_link_qualification/packet_link_qualification.proto new file mode 100644 index 000000000000..89ccd686786b --- /dev/null +++ b/src/sonic-framework/gnoi/packet_link_qualification/packet_link_qualification.proto @@ -0,0 +1,382 @@ +// A generic network operational interface gRPC service to perform packet based +// link qualification operations on a network device. +syntax = "proto3"; + +package gnoi.packet_link_qualification; + +import "github.com/openconfig/gnoi/types/types.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; +import "google/rpc/status.proto"; + +option go_package = + "github.com/openconfig/gnoi/packet_link_qualification;linkqual"; + +option (types.gnoi_version) = "1.1.0"; + +service LinkQualification { + // Create will dispatch a create operation for each interface and return. + // The rpc will only return an error in the case that gNOI service cannot + // handle the RPC request. Create will return an error on failure to + // create the qualification. + rpc Create(CreateRequest) returns (CreateResponse); + + // Get will return the status for the provided qualification ids. + rpc Get(GetRequest) returns (GetResponse); + + // Capabilities will return the capabilities of the gnoi.LinkQualification + // service implementation. This RPC is used to allow the caller to + // orchestrate the peer requirements of the service to complete a link + // qualification between two devices. + rpc Capabilities(CapabilitiesRequest) returns (CapabilitiesResponse); + + // Delete will remove the qualification results for the provided ids. + // If the qualification is not in QUALIFICATION_STATE_COMPLETED + // or QUALIFICATION_STATE_ERROR, the qualification will be canceled then + // deleted as requested. + // If the qualification cannot be stopped or deleted a status will be returned + // with the error. + // If the id is not found NOT_FOUND will be returned. + rpc Delete(DeleteRequest) returns (DeleteResponse); + + // List qualifications currently on the target. + rpc List(ListRequest) returns (ListResponse); +} + +// CreateRequest contains the list of interfaces to be Qualified. +// Each interface must only appear once and all IDs to be used +// by qualification must be unique on the device. +message CreateRequest { + repeated QualificationConfiguration interfaces = 1; +} + +// CreateResponse will return a map of the status of each CreateRequest. +// The map key is the qualification id requested in the CreateRequest. +// Valid Status responses are: +// OK: create has been accepted. +// NOT_FOUND: interface_name could not be found on the service. +// INVALID_ARGUMENT: if any of the configuration is not supported. +// ALREADY_EXISTS: if the qualification id is already in use. +message CreateResponse { + map status = 2; +} + +message NTPSyncedTiming { + // The timestamp for the start of the qualification. Based on the + // provided configuration the qualification setup must + // at least start at (start_time - min_setup_time). + google.protobuf.Timestamp start_time = 1; + // The timestamp for the end of qualification. + google.protobuf.Timestamp end_time = 2; + // Timestamp to begin teardown. If unset teardown will start + // immediately after end_time. + // This value allows for a peer to wait for before tearing down + // the port under test. + // teardown_time must occur after end_time. + google.protobuf.Timestamp teardown_time = 3; +} + +// RPCSyncedTiming will be all synchronization by assuming the start rpc's are +// sent very close temporally with enough overlap in duration to get valid +// results. +// The pre_qual_wait will allow the caller to adjust any setup timing +// differences between peers. The post_qual_wait will allow for the caller to +// adjust any teardown differences in timing between peers. +// pre_qual_wait cannot be less than selected endpoint type's min_setup_time. +// post_qual_wait cannot be less than the selected endpoint type's +// min_teardown_time. +message RPCSyncedTiming { + // pre_sync_duration is the time the service should wait before starting + // setup. + // For generators this would be the time the remote side needs to put itself + // into loopback before generating packets. + // For loopbacks this value would be expected to be zero or unset. + google.protobuf.Duration pre_sync_duration = 1; + + // The requested setup time for the endpoint. setup_duration must be >= + // min_setup_duration in the service capabilities. If the service + // completes setup before setup_duration it must wait setup_duration + // before moving to qualification. + google.protobuf.Duration setup_duration = 2; + + // duration is the length of the qualification. + google.protobuf.Duration duration = 3; + + // post_sync_duration is the amount time a side should wait before starting + // its teardown. + // For generators this value would be expected to be zero or unset. + // For loopbacks this would be the duration it takes for the generator + // to stop sending packets before starting a teardown. + google.protobuf.Duration post_sync_duration = 4; + + // This requested teardown duration for the endpoint. teardown_duration + // must be >= min_teardown_duration in the service capabilities. If the + // service completes before the teardown_duration it must wait teardown + // duration before completing. + google.protobuf.Duration teardown_duration = 5; +} + +message QualificationConfiguration { + // Id to be used for this interface qualification run. + string id = 1; + + // interface name on the device must be unique to the device. + string interface_name = 2; + + // timing allows for specifying either NTP or by using the Create RPC as + // the synchronization method for the qualification. + oneof timing { + NTPSyncedTiming ntp = 101; + RPCSyncedTiming rpc = 102; + } + + // endpoint_type is how this side of the link will be configured for the + // qualification. + oneof endpoint_type { + PacketGeneratorConfiguration packet_generator = 111; + PacketInjectorConfiguration packet_injector = 112; + PmdLoopbackConfiguration pmd_loopback = 113; + AsicLoopbackConfiguration asic_loopback = 114; + } +} + +// A packet generator implementation defines that the generator of the side of +// the link will be responsible for generating a stream of packets at the +// provided rate and size. +message PacketGeneratorConfiguration { + // Packet per second rate to use for this test. + uint64 packet_rate = 1; + + // Size of packets to inject. + // if unspecified, the default value is 1500 bytes. + uint32 packet_size = 2; +} + +// A packet injector implementation defines that the generator side of the link +// will be responsible for both setting the interface into a loopback as well +// as injecting individual packets up to packet_count into the closed loop at +// the packet_size. These packets will form a closed loop as both sides of the +// loop will forward the same set of packets for the duration of the +// qualification. +message PacketInjectorConfiguration { + // Number of packets to inject into the closed loop. + uint32 packet_count = 1; + + // Size of packets to inject. + // if unspecified, the default value is 1500 bytes. + uint32 packet_size = 2; + + // Loopback mode for this qualification. + oneof loopback_mode { + // PMD based loopback encompasses either PHY based port + // loopbacks or port based ASIC loopbacks which do + // use forwarding engine processing. + // Their use may limit the stats available for the + // qualification. + PmdLoopbackConfiguration pmd_loopback = 101; + // ASIC based loops are done inside the forwarding + // engine and must have stats available to the + // qualification. + AsicLoopbackConfiguration asic_loopback = 102; + } +} + +message PmdLoopbackConfiguration { + +} + +message AsicLoopbackConfiguration { + // This is where any l2/l3/l4 match criteria would be described. +} +// GetRequest returns the status for the provided ids. +message GetRequest { + repeated string ids = 1; +} + +// GetResponse returns a map containing the values for all requested +// Qualification results. If the QualificationResult state is +// QUALIFICATION_STATE_ERROR the caller should inspect the status field for +// the exact error code and message. +// Expected errors codes: +// NOT_FOUND when the requested id was not found by the service. +// INVALID_ARGUMENT for any configuration parameter which is unsupported. +message GetResponse { + map results = 1; +} + +// States of qualification. +enum QualificationState { + QUALIFICATION_STATE_UNSPECIFIED = 0; + QUALIFICATION_STATE_ERROR = 1; // The qualification has errored. + QUALIFICATION_STATE_IDLE = 2; // Initial state for the qualification. + QUALIFICATION_STATE_SETUP = 3; // Interface is being configured. + QUALIFICATION_STATE_RUNNING = 4; // Qualification underway. + QUALIFICATION_STATE_TEARDOWN = 5; // Interface is being reset. + QUALIFICATION_STATE_COMPLETED = 6; // Qualification is complete. +} + +message QualificationResult { + // ID of the qualification. + string id = 1; + + // Interface name of the qualification. + string interface_name = 2; + + // The state the test was in when the results were snapshotted. + QualificationState state = 3; + + // The number of qualification packets sent. + uint64 packets_sent = 4; + + // The number of qualification packets received. + uint64 packets_received = 5; + + // The number of packets transmitted that experienced corruption. + uint64 packets_error = 6; + + // The number of packets dropped by the device due to internal drop, + // lookup or forwarding errors. + uint64 packets_dropped = 7; + + // The qualification start time. Also when the first snapshot of + // results are taken. + google.protobuf.Timestamp start_time = 8; + + // The qualification end time or the current snapshot time since epoch. + google.protobuf.Timestamp end_time = 9; + + // Expected rate for the qualification. This is the computed or + // observed rate that the service expected to be maintained + // throughout the qualification duration. + uint64 expected_rate_bytes_per_second = 10; + + // The qualification rate observed during the qualification. + // It is updated every min_sample_interval in bytes per second. + uint64 qualification_rate_bytes_per_second = 11; + + // Status response for the Qualification result. Will only be set if the + // state is QUALIFICATION_STATE_ERROR. + google.rpc.Status status = 12; +} + +// DeleteRequest will delete the qualification results for the provided id. +message DeleteRequest { + repeated string ids = 1; +} + +// Delete response will contain a list of all id's in the request to be deleted. +// If the id was not found NOT_FOUND will be returned. +message DeleteResponse { + map results = 1; +} + +message CapabilitiesRequest { + +} + +message CapabilitiesResponse { + // Current timestamp on the service. + google.protobuf.Timestamp time = 1; + // Indicates that the device's time is currently synchronised via NTP. + bool ntp_synced = 2; + + // Capabilities that the generator and reflect support on the + // service. If the top level field is unset the service cannot act + // as any defined generator or reflector. + GeneratorCapabilities generator = 3; + ReflectorCapabilities reflector = 4; + + // Maximum number of results allowed to be stored per interface. + // The minimum supported just be 2 or greater. + uint64 max_historical_results_per_interface = 5; +} + +message PacketGeneratorCapabilities { + uint64 max_bps = 1; // bits per second + uint64 max_pps = 2; // packets per second + uint32 min_mtu = 3; // minimum MTU supported. + uint32 max_mtu = 4; // max MTU supported. + // The minimum duration required to set up a packet generator-based + // qualification. + google.protobuf.Duration min_setup_duration = 5; + // The minimum time required to return the affected interface to the + // pre-test state. + google.protobuf.Duration min_teardown_duration = 6; + // The minimum interval between samples for statistics relating to the + // qualification. + google.protobuf.Duration min_sample_interval = 7; +} + +enum PacketInjectorLoopbackMode { + PACKET_INJECTOR_LOOPBACK_MODE_UNSPECIFIED = 0; + PACKET_INJECTOR_LOOPBACK_MODE_PMD = 1; + PACKET_INJECTOR_LOOPBACK_MODE_ASIC = 2; +} + +message PacketInjectorCapabilities { + // The definitions of fields 1-7 are the same as those described in the + // PacketGeneratorCapabilities message. + uint32 min_mtu = 1; + uint32 max_mtu = 2; + uint32 min_injected_packets = 3; + uint32 max_injected_packets = 4; + google.protobuf.Duration min_setup_duration = 5; + google.protobuf.Duration min_teardown_duration = 6; + google.protobuf.Duration min_sample_interval = 7; + // Loopback modes that are supported by the device when using the packet + // injector mode. + repeated PacketInjectorLoopbackMode loopback_modes = 8; +} + +// If the service does not support any of the defined +// modes then the message should be unset. +message GeneratorCapabilities { + PacketGeneratorCapabilities packet_generator = 1; + PacketInjectorCapabilities packet_injector = 2; +} + +// PMD or port based loopbacks are expect to have limited ability +// to report packet counters. Packet rate/errors/transmitted/received +// may not be available on the remote side for these types of loopbacks. +message PmdLoopbackCapabilities { + google.protobuf.Duration min_setup_duration = 1; + google.protobuf.Duration min_teardown_duration = 2; +} + +enum HeaderMatchField { + HEADER_MATCH_FIELD_UNSPECIFIED = 0; + HEADER_MATCH_FIELD_L2 = 1; + HEADER_MATCH_FIELD_L3 = 2; + HEADER_MATCH_FIELD_L4 = 3; +} + +message AsicLoopbackCapabilities { + // The minimum time required to set up the ASIC loopback mode. + google.protobuf.Duration min_setup_duration = 1; + // The minimum time required to return the interfaces to their pre-test state + // following a qualification. + google.protobuf.Duration min_teardown_duration = 2; + repeated HeaderMatchField fields = 3; +} + +// If the service does not support any of the defined +// modes then the message should be unset. +message ReflectorCapabilities { + PmdLoopbackCapabilities pmd_loopback = 1; + AsicLoopbackCapabilities asic_loopback = 2; +} + +message ListRequest { + +} + +message ListResponse { + // The results that have not yet been deleted from the device. + repeated ListResult results = 1; +} + +message ListResult { + string id = 1; + QualificationState state = 2; + string interface_name = 3; +} diff --git a/src/sonic-framework/gnoi/packet_link_qualification/packet_link_qualification_grpc.pb.go b/src/sonic-framework/gnoi/packet_link_qualification/packet_link_qualification_grpc.pb.go new file mode 100755 index 000000000000..64ac5aca22b3 --- /dev/null +++ b/src/sonic-framework/gnoi/packet_link_qualification/packet_link_qualification_grpc.pb.go @@ -0,0 +1,249 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.2.0 +// - protoc v3.21.10 +// source: packet_link_qualification/packet_link_qualification.proto + +package linkqual + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +// LinkQualificationClient is the client API for LinkQualification service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type LinkQualificationClient interface { + Create(ctx context.Context, in *CreateRequest, opts ...grpc.CallOption) (*CreateResponse, error) + Get(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (*GetResponse, error) + Capabilities(ctx context.Context, in *CapabilitiesRequest, opts ...grpc.CallOption) (*CapabilitiesResponse, error) + Delete(ctx context.Context, in *DeleteRequest, opts ...grpc.CallOption) (*DeleteResponse, error) + List(ctx context.Context, in *ListRequest, opts ...grpc.CallOption) (*ListResponse, error) +} + +type linkQualificationClient struct { + cc grpc.ClientConnInterface +} + +func NewLinkQualificationClient(cc grpc.ClientConnInterface) LinkQualificationClient { + return &linkQualificationClient{cc} +} + +func (c *linkQualificationClient) Create(ctx context.Context, in *CreateRequest, opts ...grpc.CallOption) (*CreateResponse, error) { + out := new(CreateResponse) + err := c.cc.Invoke(ctx, "/gnoi.packet_link_qualification.LinkQualification/Create", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *linkQualificationClient) Get(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (*GetResponse, error) { + out := new(GetResponse) + err := c.cc.Invoke(ctx, "/gnoi.packet_link_qualification.LinkQualification/Get", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *linkQualificationClient) Capabilities(ctx context.Context, in *CapabilitiesRequest, opts ...grpc.CallOption) (*CapabilitiesResponse, error) { + out := new(CapabilitiesResponse) + err := c.cc.Invoke(ctx, "/gnoi.packet_link_qualification.LinkQualification/Capabilities", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *linkQualificationClient) Delete(ctx context.Context, in *DeleteRequest, opts ...grpc.CallOption) (*DeleteResponse, error) { + out := new(DeleteResponse) + err := c.cc.Invoke(ctx, "/gnoi.packet_link_qualification.LinkQualification/Delete", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *linkQualificationClient) List(ctx context.Context, in *ListRequest, opts ...grpc.CallOption) (*ListResponse, error) { + out := new(ListResponse) + err := c.cc.Invoke(ctx, "/gnoi.packet_link_qualification.LinkQualification/List", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// LinkQualificationServer is the server API for LinkQualification service. +// All implementations must embed UnimplementedLinkQualificationServer +// for forward compatibility +type LinkQualificationServer interface { + Create(context.Context, *CreateRequest) (*CreateResponse, error) + Get(context.Context, *GetRequest) (*GetResponse, error) + Capabilities(context.Context, *CapabilitiesRequest) (*CapabilitiesResponse, error) + Delete(context.Context, *DeleteRequest) (*DeleteResponse, error) + List(context.Context, *ListRequest) (*ListResponse, error) + mustEmbedUnimplementedLinkQualificationServer() +} + +// UnimplementedLinkQualificationServer must be embedded to have forward compatible implementations. +type UnimplementedLinkQualificationServer struct { +} + +func (UnimplementedLinkQualificationServer) Create(context.Context, *CreateRequest) (*CreateResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Create not implemented") +} +func (UnimplementedLinkQualificationServer) Get(context.Context, *GetRequest) (*GetResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Get not implemented") +} +func (UnimplementedLinkQualificationServer) Capabilities(context.Context, *CapabilitiesRequest) (*CapabilitiesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Capabilities not implemented") +} +func (UnimplementedLinkQualificationServer) Delete(context.Context, *DeleteRequest) (*DeleteResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Delete not implemented") +} +func (UnimplementedLinkQualificationServer) List(context.Context, *ListRequest) (*ListResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method List not implemented") +} +func (UnimplementedLinkQualificationServer) mustEmbedUnimplementedLinkQualificationServer() {} + +// UnsafeLinkQualificationServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to LinkQualificationServer will +// result in compilation errors. +type UnsafeLinkQualificationServer interface { + mustEmbedUnimplementedLinkQualificationServer() +} + +func RegisterLinkQualificationServer(s grpc.ServiceRegistrar, srv LinkQualificationServer) { + s.RegisterService(&LinkQualification_ServiceDesc, srv) +} + +func _LinkQualification_Create_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(LinkQualificationServer).Create(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/gnoi.packet_link_qualification.LinkQualification/Create", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(LinkQualificationServer).Create(ctx, req.(*CreateRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _LinkQualification_Get_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(LinkQualificationServer).Get(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/gnoi.packet_link_qualification.LinkQualification/Get", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(LinkQualificationServer).Get(ctx, req.(*GetRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _LinkQualification_Capabilities_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CapabilitiesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(LinkQualificationServer).Capabilities(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/gnoi.packet_link_qualification.LinkQualification/Capabilities", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(LinkQualificationServer).Capabilities(ctx, req.(*CapabilitiesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _LinkQualification_Delete_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(LinkQualificationServer).Delete(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/gnoi.packet_link_qualification.LinkQualification/Delete", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(LinkQualificationServer).Delete(ctx, req.(*DeleteRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _LinkQualification_List_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(LinkQualificationServer).List(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/gnoi.packet_link_qualification.LinkQualification/List", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(LinkQualificationServer).List(ctx, req.(*ListRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// LinkQualification_ServiceDesc is the grpc.ServiceDesc for LinkQualification service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var LinkQualification_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "gnoi.packet_link_qualification.LinkQualification", + HandlerType: (*LinkQualificationServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Create", + Handler: _LinkQualification_Create_Handler, + }, + { + MethodName: "Get", + Handler: _LinkQualification_Get_Handler, + }, + { + MethodName: "Capabilities", + Handler: _LinkQualification_Capabilities_Handler, + }, + { + MethodName: "Delete", + Handler: _LinkQualification_Delete_Handler, + }, + { + MethodName: "List", + Handler: _LinkQualification_List_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "packet_link_qualification/packet_link_qualification.proto", +} diff --git a/src/sonic-framework/gnoi/regenerate-files.sh b/src/sonic-framework/gnoi/regenerate-files.sh new file mode 100755 index 000000000000..a23fc1ded2bf --- /dev/null +++ b/src/sonic-framework/gnoi/regenerate-files.sh @@ -0,0 +1,56 @@ +#!/bin/bash +set -euo pipefail + +BASE=$(bazel info bazel-genfiles) +GNOI_NS='github.com/openconfig/gnoi' + +copy_generated() { + pkg="$1" + # Default to using package name for proto if $2 is unset + proto="$1" && [ "${2++}" ] && proto="$2" + # Bazel go_rules will create empty files containing "// +build ignore\n\npackage ignore" + # in the case where the protoc compiler doesn't generate any output. See: + # https://github.com/bazelbuild/rules_go/blob/03a8b8e90eebe699d7/go/tools/builders/protoc.go#L190 + for file in "${BASE}"/"${pkg}"/"${proto}"_go_proto_/"${GNOI_NS}"/"${pkg}"/*.pb.go; do + [[ $(head -n 1 "${file}") == "// +build ignore" ]] || cp "${file}" "${pkg}"/ + done +} + +bazel build //bgp:all +copy_generated "bgp" +bazel build //bootconfig:all +copy_generated "bootconfig" +bazel build //cert:all +copy_generated "cert" +bazel build //common:all +copy_generated "common" +bazel build //containerz:all +copy_generated "containerz" +bazel build //debug:all +copy_generated "debug" +bazel build //diag:all +copy_generated "diag" +bazel build //factory_reset:all +copy_generated "factory_reset" +bazel build //file:all +copy_generated "file" +bazel build //healthz:all +copy_generated "healthz" +bazel build //layer2:all +copy_generated "layer2" +bazel build //mpls:all +copy_generated "mpls" +bazel build //os:all +copy_generated "os" +bazel build //otdr:all +copy_generated "otdr" +bazel build //packet_capture:all +copy_generated "packet_capture" "pcap" +bazel build //packet_link_qualification:all +copy_generated "packet_link_qualification" "linkqual" +bazel build //system:all +copy_generated "system" +bazel build //types:all +copy_generated "types" +bazel build //wavelength_router:all +copy_generated "wavelength_router" diff --git a/src/sonic-framework/gnoi/system/BUILD.bazel b/src/sonic-framework/gnoi/system/BUILD.bazel new file mode 100644 index 000000000000..647da9a9013f --- /dev/null +++ b/src/sonic-framework/gnoi/system/BUILD.bazel @@ -0,0 +1,67 @@ +load("@rules_proto//proto:defs.bzl", "proto_library") +load("@io_bazel_rules_go//go:def.bzl", "go_library") +load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library") +load("@com_github_grpc_grpc//bazel:cc_grpc_library.bzl", "cc_grpc_library") +load("//:common.bzl", "use_new_compilers") + +#Copyright 2021 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +package( + default_visibility = ["//visibility:public"], + licenses = ["notice"], +) + +use_new_compilers() + +proto_library( + name = "system_proto", + srcs = ["system.proto"], + deps = [ + "//common:common_proto", + "//types:types_proto", + ], +) + +cc_proto_library( + name = "system_cc_proto", + deps = [":system_proto"], +) + +cc_grpc_library( + name = "system_cc_grpc_proto", + srcs = [":system_proto"], + grpc_only = True, + deps = [":system_cc_proto"], +) + +go_proto_library( + name = "system_go_proto", + compilers = [ + "go_protoc_gen_go", + "go_protoc_gen_go_grpc", + ], + importpath = "github.com/openconfig/gnoi/system", + proto = ":system_proto", + deps = [ + "//common", + "//types", + ], +) + +go_library( + name = "system", + embed = [":system_go_proto"], + importpath = "github.com/openconfig/gnoi/system", +) diff --git a/src/sonic-framework/gnoi/system/system.pb.go b/src/sonic-framework/gnoi/system/system.pb.go new file mode 100644 index 000000000000..c10ec8cfcc6f --- /dev/null +++ b/src/sonic-framework/gnoi/system/system.pb.go @@ -0,0 +1,2493 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.30.0 +// protoc v3.21.10 +// source: system/system.proto + +package system + +import ( + common "github.com/openconfig/gnoi/common" + types "github.com/openconfig/gnoi/types" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type RebootMethod int32 + +const ( + RebootMethod_UNKNOWN RebootMethod = 0 + RebootMethod_COLD RebootMethod = 1 + RebootMethod_POWERDOWN RebootMethod = 2 + RebootMethod_HALT RebootMethod = 3 + RebootMethod_WARM RebootMethod = 4 + RebootMethod_NSF RebootMethod = 5 + RebootMethod_POWERUP RebootMethod = 7 +) + +// Enum value maps for RebootMethod. +var ( + RebootMethod_name = map[int32]string{ + 0: "UNKNOWN", + 1: "COLD", + 2: "POWERDOWN", + 3: "HALT", + 4: "WARM", + 5: "NSF", + 7: "POWERUP", + } + RebootMethod_value = map[string]int32{ + "UNKNOWN": 0, + "COLD": 1, + "POWERDOWN": 2, + "HALT": 3, + "WARM": 4, + "NSF": 5, + "POWERUP": 7, + } +) + +func (x RebootMethod) Enum() *RebootMethod { + p := new(RebootMethod) + *p = x + return p +} + +func (x RebootMethod) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (RebootMethod) Descriptor() protoreflect.EnumDescriptor { + return file_system_system_proto_enumTypes[0].Descriptor() +} + +func (RebootMethod) Type() protoreflect.EnumType { + return &file_system_system_proto_enumTypes[0] +} + +func (x RebootMethod) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use RebootMethod.Descriptor instead. +func (RebootMethod) EnumDescriptor() ([]byte, []int) { + return file_system_system_proto_rawDescGZIP(), []int{0} +} + +type RebootStatus_Status int32 + +const ( + RebootStatus_STATUS_UNKNOWN RebootStatus_Status = 0 + RebootStatus_STATUS_SUCCESS RebootStatus_Status = 1 + RebootStatus_STATUS_RETRIABLE_FAILURE RebootStatus_Status = 2 + RebootStatus_STATUS_FAILURE RebootStatus_Status = 3 +) + +// Enum value maps for RebootStatus_Status. +var ( + RebootStatus_Status_name = map[int32]string{ + 0: "STATUS_UNKNOWN", + 1: "STATUS_SUCCESS", + 2: "STATUS_RETRIABLE_FAILURE", + 3: "STATUS_FAILURE", + } + RebootStatus_Status_value = map[string]int32{ + "STATUS_UNKNOWN": 0, + "STATUS_SUCCESS": 1, + "STATUS_RETRIABLE_FAILURE": 2, + "STATUS_FAILURE": 3, + } +) + +func (x RebootStatus_Status) Enum() *RebootStatus_Status { + p := new(RebootStatus_Status) + *p = x + return p +} + +func (x RebootStatus_Status) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (RebootStatus_Status) Descriptor() protoreflect.EnumDescriptor { + return file_system_system_proto_enumTypes[1].Descriptor() +} + +func (RebootStatus_Status) Type() protoreflect.EnumType { + return &file_system_system_proto_enumTypes[1] +} + +func (x RebootStatus_Status) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use RebootStatus_Status.Descriptor instead. +func (RebootStatus_Status) EnumDescriptor() ([]byte, []int) { + return file_system_system_proto_rawDescGZIP(), []int{8, 0} +} + +type TracerouteRequest_L4Protocol int32 + +const ( + TracerouteRequest_ICMP TracerouteRequest_L4Protocol = 0 + TracerouteRequest_TCP TracerouteRequest_L4Protocol = 1 + TracerouteRequest_UDP TracerouteRequest_L4Protocol = 2 +) + +// Enum value maps for TracerouteRequest_L4Protocol. +var ( + TracerouteRequest_L4Protocol_name = map[int32]string{ + 0: "ICMP", + 1: "TCP", + 2: "UDP", + } + TracerouteRequest_L4Protocol_value = map[string]int32{ + "ICMP": 0, + "TCP": 1, + "UDP": 2, + } +) + +func (x TracerouteRequest_L4Protocol) Enum() *TracerouteRequest_L4Protocol { + p := new(TracerouteRequest_L4Protocol) + *p = x + return p +} + +func (x TracerouteRequest_L4Protocol) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (TracerouteRequest_L4Protocol) Descriptor() protoreflect.EnumDescriptor { + return file_system_system_proto_enumTypes[2].Descriptor() +} + +func (TracerouteRequest_L4Protocol) Type() protoreflect.EnumType { + return &file_system_system_proto_enumTypes[2] +} + +func (x TracerouteRequest_L4Protocol) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use TracerouteRequest_L4Protocol.Descriptor instead. +func (TracerouteRequest_L4Protocol) EnumDescriptor() ([]byte, []int) { + return file_system_system_proto_rawDescGZIP(), []int{13, 0} +} + +type TracerouteResponse_State int32 + +const ( + TracerouteResponse_DEFAULT TracerouteResponse_State = 0 + TracerouteResponse_NONE TracerouteResponse_State = 1 + TracerouteResponse_UNKNOWN TracerouteResponse_State = 2 + TracerouteResponse_ICMP TracerouteResponse_State = 3 + TracerouteResponse_HOST_UNREACHABLE TracerouteResponse_State = 4 + TracerouteResponse_NETWORK_UNREACHABLE TracerouteResponse_State = 5 + TracerouteResponse_PROTOCOL_UNREACHABLE TracerouteResponse_State = 6 + TracerouteResponse_SOURCE_ROUTE_FAILED TracerouteResponse_State = 7 + TracerouteResponse_FRAGMENTATION_NEEDED TracerouteResponse_State = 8 + TracerouteResponse_PROHIBITED TracerouteResponse_State = 9 + TracerouteResponse_PRECEDENCE_VIOLATION TracerouteResponse_State = 10 + TracerouteResponse_PRECEDENCE_CUTOFF TracerouteResponse_State = 11 +) + +// Enum value maps for TracerouteResponse_State. +var ( + TracerouteResponse_State_name = map[int32]string{ + 0: "DEFAULT", + 1: "NONE", + 2: "UNKNOWN", + 3: "ICMP", + 4: "HOST_UNREACHABLE", + 5: "NETWORK_UNREACHABLE", + 6: "PROTOCOL_UNREACHABLE", + 7: "SOURCE_ROUTE_FAILED", + 8: "FRAGMENTATION_NEEDED", + 9: "PROHIBITED", + 10: "PRECEDENCE_VIOLATION", + 11: "PRECEDENCE_CUTOFF", + } + TracerouteResponse_State_value = map[string]int32{ + "DEFAULT": 0, + "NONE": 1, + "UNKNOWN": 2, + "ICMP": 3, + "HOST_UNREACHABLE": 4, + "NETWORK_UNREACHABLE": 5, + "PROTOCOL_UNREACHABLE": 6, + "SOURCE_ROUTE_FAILED": 7, + "FRAGMENTATION_NEEDED": 8, + "PROHIBITED": 9, + "PRECEDENCE_VIOLATION": 10, + "PRECEDENCE_CUTOFF": 11, + } +) + +func (x TracerouteResponse_State) Enum() *TracerouteResponse_State { + p := new(TracerouteResponse_State) + *p = x + return p +} + +func (x TracerouteResponse_State) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (TracerouteResponse_State) Descriptor() protoreflect.EnumDescriptor { + return file_system_system_proto_enumTypes[3].Descriptor() +} + +func (TracerouteResponse_State) Type() protoreflect.EnumType { + return &file_system_system_proto_enumTypes[3] +} + +func (x TracerouteResponse_State) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use TracerouteResponse_State.Descriptor instead. +func (TracerouteResponse_State) EnumDescriptor() ([]byte, []int) { + return file_system_system_proto_rawDescGZIP(), []int{14, 0} +} + +type KillProcessRequest_Signal int32 + +const ( + KillProcessRequest_SIGNAL_UNSPECIFIED KillProcessRequest_Signal = 0 + KillProcessRequest_SIGNAL_TERM KillProcessRequest_Signal = 1 + KillProcessRequest_SIGNAL_KILL KillProcessRequest_Signal = 2 + KillProcessRequest_SIGNAL_HUP KillProcessRequest_Signal = 3 + KillProcessRequest_SIGNAL_ABRT KillProcessRequest_Signal = 4 +) + +// Enum value maps for KillProcessRequest_Signal. +var ( + KillProcessRequest_Signal_name = map[int32]string{ + 0: "SIGNAL_UNSPECIFIED", + 1: "SIGNAL_TERM", + 2: "SIGNAL_KILL", + 3: "SIGNAL_HUP", + 4: "SIGNAL_ABRT", + } + KillProcessRequest_Signal_value = map[string]int32{ + "SIGNAL_UNSPECIFIED": 0, + "SIGNAL_TERM": 1, + "SIGNAL_KILL": 2, + "SIGNAL_HUP": 3, + "SIGNAL_ABRT": 4, + } +) + +func (x KillProcessRequest_Signal) Enum() *KillProcessRequest_Signal { + p := new(KillProcessRequest_Signal) + *p = x + return p +} + +func (x KillProcessRequest_Signal) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (KillProcessRequest_Signal) Descriptor() protoreflect.EnumDescriptor { + return file_system_system_proto_enumTypes[4].Descriptor() +} + +func (KillProcessRequest_Signal) Type() protoreflect.EnumType { + return &file_system_system_proto_enumTypes[4] +} + +func (x KillProcessRequest_Signal) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use KillProcessRequest_Signal.Descriptor instead. +func (KillProcessRequest_Signal) EnumDescriptor() ([]byte, []int) { + return file_system_system_proto_rawDescGZIP(), []int{18, 0} +} + +type SwitchControlProcessorRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ControlProcessor *types.Path `protobuf:"bytes,1,opt,name=control_processor,json=controlProcessor,proto3" json:"control_processor,omitempty"` +} + +func (x *SwitchControlProcessorRequest) Reset() { + *x = SwitchControlProcessorRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_system_system_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SwitchControlProcessorRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SwitchControlProcessorRequest) ProtoMessage() {} + +func (x *SwitchControlProcessorRequest) ProtoReflect() protoreflect.Message { + mi := &file_system_system_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SwitchControlProcessorRequest.ProtoReflect.Descriptor instead. +func (*SwitchControlProcessorRequest) Descriptor() ([]byte, []int) { + return file_system_system_proto_rawDescGZIP(), []int{0} +} + +func (x *SwitchControlProcessorRequest) GetControlProcessor() *types.Path { + if x != nil { + return x.ControlProcessor + } + return nil +} + +type SwitchControlProcessorResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ControlProcessor *types.Path `protobuf:"bytes,1,opt,name=control_processor,json=controlProcessor,proto3" json:"control_processor,omitempty"` + Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` + Uptime int64 `protobuf:"varint,3,opt,name=uptime,proto3" json:"uptime,omitempty"` +} + +func (x *SwitchControlProcessorResponse) Reset() { + *x = SwitchControlProcessorResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_system_system_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SwitchControlProcessorResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SwitchControlProcessorResponse) ProtoMessage() {} + +func (x *SwitchControlProcessorResponse) ProtoReflect() protoreflect.Message { + mi := &file_system_system_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SwitchControlProcessorResponse.ProtoReflect.Descriptor instead. +func (*SwitchControlProcessorResponse) Descriptor() ([]byte, []int) { + return file_system_system_proto_rawDescGZIP(), []int{1} +} + +func (x *SwitchControlProcessorResponse) GetControlProcessor() *types.Path { + if x != nil { + return x.ControlProcessor + } + return nil +} + +func (x *SwitchControlProcessorResponse) GetVersion() string { + if x != nil { + return x.Version + } + return "" +} + +func (x *SwitchControlProcessorResponse) GetUptime() int64 { + if x != nil { + return x.Uptime + } + return 0 +} + +type RebootRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Method RebootMethod `protobuf:"varint,1,opt,name=method,proto3,enum=gnoi.system.RebootMethod" json:"method,omitempty"` + Delay uint64 `protobuf:"varint,2,opt,name=delay,proto3" json:"delay,omitempty"` + Message string `protobuf:"bytes,3,opt,name=message,proto3" json:"message,omitempty"` + Subcomponents []*types.Path `protobuf:"bytes,4,rep,name=subcomponents,proto3" json:"subcomponents,omitempty"` + Force bool `protobuf:"varint,5,opt,name=force,proto3" json:"force,omitempty"` +} + +func (x *RebootRequest) Reset() { + *x = RebootRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_system_system_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RebootRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RebootRequest) ProtoMessage() {} + +func (x *RebootRequest) ProtoReflect() protoreflect.Message { + mi := &file_system_system_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RebootRequest.ProtoReflect.Descriptor instead. +func (*RebootRequest) Descriptor() ([]byte, []int) { + return file_system_system_proto_rawDescGZIP(), []int{2} +} + +func (x *RebootRequest) GetMethod() RebootMethod { + if x != nil { + return x.Method + } + return RebootMethod_UNKNOWN +} + +func (x *RebootRequest) GetDelay() uint64 { + if x != nil { + return x.Delay + } + return 0 +} + +func (x *RebootRequest) GetMessage() string { + if x != nil { + return x.Message + } + return "" +} + +func (x *RebootRequest) GetSubcomponents() []*types.Path { + if x != nil { + return x.Subcomponents + } + return nil +} + +func (x *RebootRequest) GetForce() bool { + if x != nil { + return x.Force + } + return false +} + +type RebootResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *RebootResponse) Reset() { + *x = RebootResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_system_system_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RebootResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RebootResponse) ProtoMessage() {} + +func (x *RebootResponse) ProtoReflect() protoreflect.Message { + mi := &file_system_system_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RebootResponse.ProtoReflect.Descriptor instead. +func (*RebootResponse) Descriptor() ([]byte, []int) { + return file_system_system_proto_rawDescGZIP(), []int{3} +} + +type CancelRebootRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` + Subcomponents []*types.Path `protobuf:"bytes,2,rep,name=subcomponents,proto3" json:"subcomponents,omitempty"` +} + +func (x *CancelRebootRequest) Reset() { + *x = CancelRebootRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_system_system_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CancelRebootRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CancelRebootRequest) ProtoMessage() {} + +func (x *CancelRebootRequest) ProtoReflect() protoreflect.Message { + mi := &file_system_system_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CancelRebootRequest.ProtoReflect.Descriptor instead. +func (*CancelRebootRequest) Descriptor() ([]byte, []int) { + return file_system_system_proto_rawDescGZIP(), []int{4} +} + +func (x *CancelRebootRequest) GetMessage() string { + if x != nil { + return x.Message + } + return "" +} + +func (x *CancelRebootRequest) GetSubcomponents() []*types.Path { + if x != nil { + return x.Subcomponents + } + return nil +} + +type CancelRebootResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *CancelRebootResponse) Reset() { + *x = CancelRebootResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_system_system_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CancelRebootResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CancelRebootResponse) ProtoMessage() {} + +func (x *CancelRebootResponse) ProtoReflect() protoreflect.Message { + mi := &file_system_system_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CancelRebootResponse.ProtoReflect.Descriptor instead. +func (*CancelRebootResponse) Descriptor() ([]byte, []int) { + return file_system_system_proto_rawDescGZIP(), []int{5} +} + +type RebootStatusRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Subcomponents []*types.Path `protobuf:"bytes,1,rep,name=subcomponents,proto3" json:"subcomponents,omitempty"` +} + +func (x *RebootStatusRequest) Reset() { + *x = RebootStatusRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_system_system_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RebootStatusRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RebootStatusRequest) ProtoMessage() {} + +func (x *RebootStatusRequest) ProtoReflect() protoreflect.Message { + mi := &file_system_system_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RebootStatusRequest.ProtoReflect.Descriptor instead. +func (*RebootStatusRequest) Descriptor() ([]byte, []int) { + return file_system_system_proto_rawDescGZIP(), []int{6} +} + +func (x *RebootStatusRequest) GetSubcomponents() []*types.Path { + if x != nil { + return x.Subcomponents + } + return nil +} + +type RebootStatusResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Active bool `protobuf:"varint,1,opt,name=active,proto3" json:"active,omitempty"` + Wait uint64 `protobuf:"varint,2,opt,name=wait,proto3" json:"wait,omitempty"` + When uint64 `protobuf:"varint,3,opt,name=when,proto3" json:"when,omitempty"` + Reason string `protobuf:"bytes,4,opt,name=reason,proto3" json:"reason,omitempty"` + Count uint32 `protobuf:"varint,5,opt,name=count,proto3" json:"count,omitempty"` + Method RebootMethod `protobuf:"varint,6,opt,name=method,proto3,enum=gnoi.system.RebootMethod" json:"method,omitempty"` + Status *RebootStatus `protobuf:"bytes,7,opt,name=status,proto3" json:"status,omitempty"` +} + +func (x *RebootStatusResponse) Reset() { + *x = RebootStatusResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_system_system_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RebootStatusResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RebootStatusResponse) ProtoMessage() {} + +func (x *RebootStatusResponse) ProtoReflect() protoreflect.Message { + mi := &file_system_system_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RebootStatusResponse.ProtoReflect.Descriptor instead. +func (*RebootStatusResponse) Descriptor() ([]byte, []int) { + return file_system_system_proto_rawDescGZIP(), []int{7} +} + +func (x *RebootStatusResponse) GetActive() bool { + if x != nil { + return x.Active + } + return false +} + +func (x *RebootStatusResponse) GetWait() uint64 { + if x != nil { + return x.Wait + } + return 0 +} + +func (x *RebootStatusResponse) GetWhen() uint64 { + if x != nil { + return x.When + } + return 0 +} + +func (x *RebootStatusResponse) GetReason() string { + if x != nil { + return x.Reason + } + return "" +} + +func (x *RebootStatusResponse) GetCount() uint32 { + if x != nil { + return x.Count + } + return 0 +} + +func (x *RebootStatusResponse) GetMethod() RebootMethod { + if x != nil { + return x.Method + } + return RebootMethod_UNKNOWN +} + +func (x *RebootStatusResponse) GetStatus() *RebootStatus { + if x != nil { + return x.Status + } + return nil +} + +type RebootStatus struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Status RebootStatus_Status `protobuf:"varint,1,opt,name=status,proto3,enum=gnoi.system.RebootStatus_Status" json:"status,omitempty"` + Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` +} + +func (x *RebootStatus) Reset() { + *x = RebootStatus{} + if protoimpl.UnsafeEnabled { + mi := &file_system_system_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RebootStatus) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RebootStatus) ProtoMessage() {} + +func (x *RebootStatus) ProtoReflect() protoreflect.Message { + mi := &file_system_system_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RebootStatus.ProtoReflect.Descriptor instead. +func (*RebootStatus) Descriptor() ([]byte, []int) { + return file_system_system_proto_rawDescGZIP(), []int{8} +} + +func (x *RebootStatus) GetStatus() RebootStatus_Status { + if x != nil { + return x.Status + } + return RebootStatus_STATUS_UNKNOWN +} + +func (x *RebootStatus) GetMessage() string { + if x != nil { + return x.Message + } + return "" +} + +type TimeRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *TimeRequest) Reset() { + *x = TimeRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_system_system_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TimeRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TimeRequest) ProtoMessage() {} + +func (x *TimeRequest) ProtoReflect() protoreflect.Message { + mi := &file_system_system_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TimeRequest.ProtoReflect.Descriptor instead. +func (*TimeRequest) Descriptor() ([]byte, []int) { + return file_system_system_proto_rawDescGZIP(), []int{9} +} + +type TimeResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Time uint64 `protobuf:"varint,1,opt,name=time,proto3" json:"time,omitempty"` +} + +func (x *TimeResponse) Reset() { + *x = TimeResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_system_system_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TimeResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TimeResponse) ProtoMessage() {} + +func (x *TimeResponse) ProtoReflect() protoreflect.Message { + mi := &file_system_system_proto_msgTypes[10] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TimeResponse.ProtoReflect.Descriptor instead. +func (*TimeResponse) Descriptor() ([]byte, []int) { + return file_system_system_proto_rawDescGZIP(), []int{10} +} + +func (x *TimeResponse) GetTime() uint64 { + if x != nil { + return x.Time + } + return 0 +} + +type PingRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Destination string `protobuf:"bytes,1,opt,name=destination,proto3" json:"destination,omitempty"` + Source string `protobuf:"bytes,2,opt,name=source,proto3" json:"source,omitempty"` + Count int32 `protobuf:"varint,3,opt,name=count,proto3" json:"count,omitempty"` + Interval int64 `protobuf:"varint,4,opt,name=interval,proto3" json:"interval,omitempty"` + Wait int64 `protobuf:"varint,5,opt,name=wait,proto3" json:"wait,omitempty"` + Size int32 `protobuf:"varint,6,opt,name=size,proto3" json:"size,omitempty"` + DoNotFragment bool `protobuf:"varint,7,opt,name=do_not_fragment,json=doNotFragment,proto3" json:"do_not_fragment,omitempty"` + DoNotResolve bool `protobuf:"varint,8,opt,name=do_not_resolve,json=doNotResolve,proto3" json:"do_not_resolve,omitempty"` + L3Protocol types.L3Protocol `protobuf:"varint,9,opt,name=l3protocol,proto3,enum=gnoi.types.L3Protocol" json:"l3protocol,omitempty"` + NetworkInstance string `protobuf:"bytes,10,opt,name=network_instance,json=networkInstance,proto3" json:"network_instance,omitempty"` +} + +func (x *PingRequest) Reset() { + *x = PingRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_system_system_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PingRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PingRequest) ProtoMessage() {} + +func (x *PingRequest) ProtoReflect() protoreflect.Message { + mi := &file_system_system_proto_msgTypes[11] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PingRequest.ProtoReflect.Descriptor instead. +func (*PingRequest) Descriptor() ([]byte, []int) { + return file_system_system_proto_rawDescGZIP(), []int{11} +} + +func (x *PingRequest) GetDestination() string { + if x != nil { + return x.Destination + } + return "" +} + +func (x *PingRequest) GetSource() string { + if x != nil { + return x.Source + } + return "" +} + +func (x *PingRequest) GetCount() int32 { + if x != nil { + return x.Count + } + return 0 +} + +func (x *PingRequest) GetInterval() int64 { + if x != nil { + return x.Interval + } + return 0 +} + +func (x *PingRequest) GetWait() int64 { + if x != nil { + return x.Wait + } + return 0 +} + +func (x *PingRequest) GetSize() int32 { + if x != nil { + return x.Size + } + return 0 +} + +func (x *PingRequest) GetDoNotFragment() bool { + if x != nil { + return x.DoNotFragment + } + return false +} + +func (x *PingRequest) GetDoNotResolve() bool { + if x != nil { + return x.DoNotResolve + } + return false +} + +func (x *PingRequest) GetL3Protocol() types.L3Protocol { + if x != nil { + return x.L3Protocol + } + return types.L3Protocol(0) +} + +func (x *PingRequest) GetNetworkInstance() string { + if x != nil { + return x.NetworkInstance + } + return "" +} + +type PingResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Source string `protobuf:"bytes,1,opt,name=source,proto3" json:"source,omitempty"` + Time int64 `protobuf:"varint,2,opt,name=time,proto3" json:"time,omitempty"` + Sent int32 `protobuf:"varint,3,opt,name=sent,proto3" json:"sent,omitempty"` + Received int32 `protobuf:"varint,4,opt,name=received,proto3" json:"received,omitempty"` + MinTime int64 `protobuf:"varint,5,opt,name=min_time,json=minTime,proto3" json:"min_time,omitempty"` + AvgTime int64 `protobuf:"varint,6,opt,name=avg_time,json=avgTime,proto3" json:"avg_time,omitempty"` + MaxTime int64 `protobuf:"varint,7,opt,name=max_time,json=maxTime,proto3" json:"max_time,omitempty"` + StdDev int64 `protobuf:"varint,8,opt,name=std_dev,json=stdDev,proto3" json:"std_dev,omitempty"` + Bytes int32 `protobuf:"varint,11,opt,name=bytes,proto3" json:"bytes,omitempty"` + Sequence int32 `protobuf:"varint,12,opt,name=sequence,proto3" json:"sequence,omitempty"` + Ttl int32 `protobuf:"varint,13,opt,name=ttl,proto3" json:"ttl,omitempty"` +} + +func (x *PingResponse) Reset() { + *x = PingResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_system_system_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PingResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PingResponse) ProtoMessage() {} + +func (x *PingResponse) ProtoReflect() protoreflect.Message { + mi := &file_system_system_proto_msgTypes[12] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PingResponse.ProtoReflect.Descriptor instead. +func (*PingResponse) Descriptor() ([]byte, []int) { + return file_system_system_proto_rawDescGZIP(), []int{12} +} + +func (x *PingResponse) GetSource() string { + if x != nil { + return x.Source + } + return "" +} + +func (x *PingResponse) GetTime() int64 { + if x != nil { + return x.Time + } + return 0 +} + +func (x *PingResponse) GetSent() int32 { + if x != nil { + return x.Sent + } + return 0 +} + +func (x *PingResponse) GetReceived() int32 { + if x != nil { + return x.Received + } + return 0 +} + +func (x *PingResponse) GetMinTime() int64 { + if x != nil { + return x.MinTime + } + return 0 +} + +func (x *PingResponse) GetAvgTime() int64 { + if x != nil { + return x.AvgTime + } + return 0 +} + +func (x *PingResponse) GetMaxTime() int64 { + if x != nil { + return x.MaxTime + } + return 0 +} + +func (x *PingResponse) GetStdDev() int64 { + if x != nil { + return x.StdDev + } + return 0 +} + +func (x *PingResponse) GetBytes() int32 { + if x != nil { + return x.Bytes + } + return 0 +} + +func (x *PingResponse) GetSequence() int32 { + if x != nil { + return x.Sequence + } + return 0 +} + +func (x *PingResponse) GetTtl() int32 { + if x != nil { + return x.Ttl + } + return 0 +} + +type TracerouteRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Source string `protobuf:"bytes,1,opt,name=source,proto3" json:"source,omitempty"` + Destination string `protobuf:"bytes,2,opt,name=destination,proto3" json:"destination,omitempty"` + InitialTtl uint32 `protobuf:"varint,3,opt,name=initial_ttl,json=initialTtl,proto3" json:"initial_ttl,omitempty"` + MaxTtl int32 `protobuf:"varint,4,opt,name=max_ttl,json=maxTtl,proto3" json:"max_ttl,omitempty"` + Wait int64 `protobuf:"varint,5,opt,name=wait,proto3" json:"wait,omitempty"` + DoNotFragment bool `protobuf:"varint,6,opt,name=do_not_fragment,json=doNotFragment,proto3" json:"do_not_fragment,omitempty"` + DoNotResolve bool `protobuf:"varint,7,opt,name=do_not_resolve,json=doNotResolve,proto3" json:"do_not_resolve,omitempty"` + L3Protocol types.L3Protocol `protobuf:"varint,8,opt,name=l3protocol,proto3,enum=gnoi.types.L3Protocol" json:"l3protocol,omitempty"` + L4Protocol TracerouteRequest_L4Protocol `protobuf:"varint,9,opt,name=l4protocol,proto3,enum=gnoi.system.TracerouteRequest_L4Protocol" json:"l4protocol,omitempty"` + DoNotLookupAsn bool `protobuf:"varint,10,opt,name=do_not_lookup_asn,json=doNotLookupAsn,proto3" json:"do_not_lookup_asn,omitempty"` + NetworkInstance string `protobuf:"bytes,11,opt,name=network_instance,json=networkInstance,proto3" json:"network_instance,omitempty"` +} + +func (x *TracerouteRequest) Reset() { + *x = TracerouteRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_system_system_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TracerouteRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TracerouteRequest) ProtoMessage() {} + +func (x *TracerouteRequest) ProtoReflect() protoreflect.Message { + mi := &file_system_system_proto_msgTypes[13] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TracerouteRequest.ProtoReflect.Descriptor instead. +func (*TracerouteRequest) Descriptor() ([]byte, []int) { + return file_system_system_proto_rawDescGZIP(), []int{13} +} + +func (x *TracerouteRequest) GetSource() string { + if x != nil { + return x.Source + } + return "" +} + +func (x *TracerouteRequest) GetDestination() string { + if x != nil { + return x.Destination + } + return "" +} + +func (x *TracerouteRequest) GetInitialTtl() uint32 { + if x != nil { + return x.InitialTtl + } + return 0 +} + +func (x *TracerouteRequest) GetMaxTtl() int32 { + if x != nil { + return x.MaxTtl + } + return 0 +} + +func (x *TracerouteRequest) GetWait() int64 { + if x != nil { + return x.Wait + } + return 0 +} + +func (x *TracerouteRequest) GetDoNotFragment() bool { + if x != nil { + return x.DoNotFragment + } + return false +} + +func (x *TracerouteRequest) GetDoNotResolve() bool { + if x != nil { + return x.DoNotResolve + } + return false +} + +func (x *TracerouteRequest) GetL3Protocol() types.L3Protocol { + if x != nil { + return x.L3Protocol + } + return types.L3Protocol(0) +} + +func (x *TracerouteRequest) GetL4Protocol() TracerouteRequest_L4Protocol { + if x != nil { + return x.L4Protocol + } + return TracerouteRequest_ICMP +} + +func (x *TracerouteRequest) GetDoNotLookupAsn() bool { + if x != nil { + return x.DoNotLookupAsn + } + return false +} + +func (x *TracerouteRequest) GetNetworkInstance() string { + if x != nil { + return x.NetworkInstance + } + return "" +} + +type TracerouteResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + DestinationName string `protobuf:"bytes,1,opt,name=destination_name,json=destinationName,proto3" json:"destination_name,omitempty"` + DestinationAddress string `protobuf:"bytes,2,opt,name=destination_address,json=destinationAddress,proto3" json:"destination_address,omitempty"` + Hops int32 `protobuf:"varint,3,opt,name=hops,proto3" json:"hops,omitempty"` + PacketSize int32 `protobuf:"varint,4,opt,name=packet_size,json=packetSize,proto3" json:"packet_size,omitempty"` + Hop int32 `protobuf:"varint,5,opt,name=hop,proto3" json:"hop,omitempty"` + Address string `protobuf:"bytes,6,opt,name=address,proto3" json:"address,omitempty"` + Name string `protobuf:"bytes,7,opt,name=name,proto3" json:"name,omitempty"` + Rtt int64 `protobuf:"varint,8,opt,name=rtt,proto3" json:"rtt,omitempty"` + State TracerouteResponse_State `protobuf:"varint,9,opt,name=state,proto3,enum=gnoi.system.TracerouteResponse_State" json:"state,omitempty"` + IcmpCode int32 `protobuf:"varint,10,opt,name=icmp_code,json=icmpCode,proto3" json:"icmp_code,omitempty"` + Mpls map[string]string `protobuf:"bytes,11,rep,name=mpls,proto3" json:"mpls,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + AsPath []int32 `protobuf:"varint,12,rep,packed,name=as_path,json=asPath,proto3" json:"as_path,omitempty"` + IcmpExtData []*TracerouteResponse_IcmpExtData `protobuf:"bytes,13,rep,name=icmp_ext_data,json=icmpExtData,proto3" json:"icmp_ext_data,omitempty"` +} + +func (x *TracerouteResponse) Reset() { + *x = TracerouteResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_system_system_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TracerouteResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TracerouteResponse) ProtoMessage() {} + +func (x *TracerouteResponse) ProtoReflect() protoreflect.Message { + mi := &file_system_system_proto_msgTypes[14] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TracerouteResponse.ProtoReflect.Descriptor instead. +func (*TracerouteResponse) Descriptor() ([]byte, []int) { + return file_system_system_proto_rawDescGZIP(), []int{14} +} + +func (x *TracerouteResponse) GetDestinationName() string { + if x != nil { + return x.DestinationName + } + return "" +} + +func (x *TracerouteResponse) GetDestinationAddress() string { + if x != nil { + return x.DestinationAddress + } + return "" +} + +func (x *TracerouteResponse) GetHops() int32 { + if x != nil { + return x.Hops + } + return 0 +} + +func (x *TracerouteResponse) GetPacketSize() int32 { + if x != nil { + return x.PacketSize + } + return 0 +} + +func (x *TracerouteResponse) GetHop() int32 { + if x != nil { + return x.Hop + } + return 0 +} + +func (x *TracerouteResponse) GetAddress() string { + if x != nil { + return x.Address + } + return "" +} + +func (x *TracerouteResponse) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *TracerouteResponse) GetRtt() int64 { + if x != nil { + return x.Rtt + } + return 0 +} + +func (x *TracerouteResponse) GetState() TracerouteResponse_State { + if x != nil { + return x.State + } + return TracerouteResponse_DEFAULT +} + +func (x *TracerouteResponse) GetIcmpCode() int32 { + if x != nil { + return x.IcmpCode + } + return 0 +} + +func (x *TracerouteResponse) GetMpls() map[string]string { + if x != nil { + return x.Mpls + } + return nil +} + +func (x *TracerouteResponse) GetAsPath() []int32 { + if x != nil { + return x.AsPath + } + return nil +} + +func (x *TracerouteResponse) GetIcmpExtData() []*TracerouteResponse_IcmpExtData { + if x != nil { + return x.IcmpExtData + } + return nil +} + +type Package struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Filename string `protobuf:"bytes,1,opt,name=filename,proto3" json:"filename,omitempty"` + Version string `protobuf:"bytes,4,opt,name=version,proto3" json:"version,omitempty"` + Activate bool `protobuf:"varint,5,opt,name=activate,proto3" json:"activate,omitempty"` + RemoteDownload *common.RemoteDownload `protobuf:"bytes,6,opt,name=remote_download,json=remoteDownload,proto3" json:"remote_download,omitempty"` +} + +func (x *Package) Reset() { + *x = Package{} + if protoimpl.UnsafeEnabled { + mi := &file_system_system_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Package) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Package) ProtoMessage() {} + +func (x *Package) ProtoReflect() protoreflect.Message { + mi := &file_system_system_proto_msgTypes[15] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Package.ProtoReflect.Descriptor instead. +func (*Package) Descriptor() ([]byte, []int) { + return file_system_system_proto_rawDescGZIP(), []int{15} +} + +func (x *Package) GetFilename() string { + if x != nil { + return x.Filename + } + return "" +} + +func (x *Package) GetVersion() string { + if x != nil { + return x.Version + } + return "" +} + +func (x *Package) GetActivate() bool { + if x != nil { + return x.Activate + } + return false +} + +func (x *Package) GetRemoteDownload() *common.RemoteDownload { + if x != nil { + return x.RemoteDownload + } + return nil +} + +type SetPackageRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Request: + // + // *SetPackageRequest_Package + // *SetPackageRequest_Contents + // *SetPackageRequest_Hash + Request isSetPackageRequest_Request `protobuf_oneof:"request"` +} + +func (x *SetPackageRequest) Reset() { + *x = SetPackageRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_system_system_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SetPackageRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SetPackageRequest) ProtoMessage() {} + +func (x *SetPackageRequest) ProtoReflect() protoreflect.Message { + mi := &file_system_system_proto_msgTypes[16] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SetPackageRequest.ProtoReflect.Descriptor instead. +func (*SetPackageRequest) Descriptor() ([]byte, []int) { + return file_system_system_proto_rawDescGZIP(), []int{16} +} + +func (m *SetPackageRequest) GetRequest() isSetPackageRequest_Request { + if m != nil { + return m.Request + } + return nil +} + +func (x *SetPackageRequest) GetPackage() *Package { + if x, ok := x.GetRequest().(*SetPackageRequest_Package); ok { + return x.Package + } + return nil +} + +func (x *SetPackageRequest) GetContents() []byte { + if x, ok := x.GetRequest().(*SetPackageRequest_Contents); ok { + return x.Contents + } + return nil +} + +func (x *SetPackageRequest) GetHash() *types.HashType { + if x, ok := x.GetRequest().(*SetPackageRequest_Hash); ok { + return x.Hash + } + return nil +} + +type isSetPackageRequest_Request interface { + isSetPackageRequest_Request() +} + +type SetPackageRequest_Package struct { + Package *Package `protobuf:"bytes,1,opt,name=package,proto3,oneof"` +} + +type SetPackageRequest_Contents struct { + Contents []byte `protobuf:"bytes,2,opt,name=contents,proto3,oneof"` +} + +type SetPackageRequest_Hash struct { + Hash *types.HashType `protobuf:"bytes,3,opt,name=hash,proto3,oneof"` +} + +func (*SetPackageRequest_Package) isSetPackageRequest_Request() {} + +func (*SetPackageRequest_Contents) isSetPackageRequest_Request() {} + +func (*SetPackageRequest_Hash) isSetPackageRequest_Request() {} + +type SetPackageResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *SetPackageResponse) Reset() { + *x = SetPackageResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_system_system_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SetPackageResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SetPackageResponse) ProtoMessage() {} + +func (x *SetPackageResponse) ProtoReflect() protoreflect.Message { + mi := &file_system_system_proto_msgTypes[17] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SetPackageResponse.ProtoReflect.Descriptor instead. +func (*SetPackageResponse) Descriptor() ([]byte, []int) { + return file_system_system_proto_rawDescGZIP(), []int{17} +} + +type KillProcessRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Pid uint32 `protobuf:"varint,1,opt,name=pid,proto3" json:"pid,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + Signal KillProcessRequest_Signal `protobuf:"varint,3,opt,name=signal,proto3,enum=gnoi.system.KillProcessRequest_Signal" json:"signal,omitempty"` + Restart bool `protobuf:"varint,4,opt,name=restart,proto3" json:"restart,omitempty"` +} + +func (x *KillProcessRequest) Reset() { + *x = KillProcessRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_system_system_proto_msgTypes[18] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *KillProcessRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*KillProcessRequest) ProtoMessage() {} + +func (x *KillProcessRequest) ProtoReflect() protoreflect.Message { + mi := &file_system_system_proto_msgTypes[18] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use KillProcessRequest.ProtoReflect.Descriptor instead. +func (*KillProcessRequest) Descriptor() ([]byte, []int) { + return file_system_system_proto_rawDescGZIP(), []int{18} +} + +func (x *KillProcessRequest) GetPid() uint32 { + if x != nil { + return x.Pid + } + return 0 +} + +func (x *KillProcessRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *KillProcessRequest) GetSignal() KillProcessRequest_Signal { + if x != nil { + return x.Signal + } + return KillProcessRequest_SIGNAL_UNSPECIFIED +} + +func (x *KillProcessRequest) GetRestart() bool { + if x != nil { + return x.Restart + } + return false +} + +type KillProcessResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *KillProcessResponse) Reset() { + *x = KillProcessResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_system_system_proto_msgTypes[19] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *KillProcessResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*KillProcessResponse) ProtoMessage() {} + +func (x *KillProcessResponse) ProtoReflect() protoreflect.Message { + mi := &file_system_system_proto_msgTypes[19] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use KillProcessResponse.ProtoReflect.Descriptor instead. +func (*KillProcessResponse) Descriptor() ([]byte, []int) { + return file_system_system_proto_rawDescGZIP(), []int{19} +} + +type TracerouteResponse_IcmpExtData struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Class uint32 `protobuf:"varint,1,opt,name=class,proto3" json:"class,omitempty"` + Type uint32 `protobuf:"varint,2,opt,name=type,proto3" json:"type,omitempty"` + Data []uint32 `protobuf:"varint,3,rep,packed,name=data,proto3" json:"data,omitempty"` +} + +func (x *TracerouteResponse_IcmpExtData) Reset() { + *x = TracerouteResponse_IcmpExtData{} + if protoimpl.UnsafeEnabled { + mi := &file_system_system_proto_msgTypes[20] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TracerouteResponse_IcmpExtData) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TracerouteResponse_IcmpExtData) ProtoMessage() {} + +func (x *TracerouteResponse_IcmpExtData) ProtoReflect() protoreflect.Message { + mi := &file_system_system_proto_msgTypes[20] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TracerouteResponse_IcmpExtData.ProtoReflect.Descriptor instead. +func (*TracerouteResponse_IcmpExtData) Descriptor() ([]byte, []int) { + return file_system_system_proto_rawDescGZIP(), []int{14, 0} +} + +func (x *TracerouteResponse_IcmpExtData) GetClass() uint32 { + if x != nil { + return x.Class + } + return 0 +} + +func (x *TracerouteResponse_IcmpExtData) GetType() uint32 { + if x != nil { + return x.Type + } + return 0 +} + +func (x *TracerouteResponse_IcmpExtData) GetData() []uint32 { + if x != nil { + return x.Data + } + return nil +} + +var File_system_system_proto protoreflect.FileDescriptor + +var file_system_system_proto_rawDesc = []byte{ + 0x0a, 0x13, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2f, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0b, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x73, 0x79, 0x73, 0x74, + 0x65, 0x6d, 0x1a, 0x2e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, + 0x70, 0x65, 0x6e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x67, 0x6e, 0x6f, 0x69, 0x2f, 0x63, + 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x1a, 0x2c, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, + 0x70, 0x65, 0x6e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x67, 0x6e, 0x6f, 0x69, 0x2f, 0x74, + 0x79, 0x70, 0x65, 0x73, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x22, 0x5e, 0x0a, 0x1d, 0x53, 0x77, 0x69, 0x74, 0x63, 0x68, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, + 0x6c, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x3d, 0x0a, 0x11, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x5f, 0x70, 0x72, 0x6f, + 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x67, + 0x6e, 0x6f, 0x69, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x50, 0x61, 0x74, 0x68, 0x52, 0x10, + 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, + 0x22, 0x91, 0x01, 0x0a, 0x1e, 0x53, 0x77, 0x69, 0x74, 0x63, 0x68, 0x43, 0x6f, 0x6e, 0x74, 0x72, + 0x6f, 0x6c, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x3d, 0x0a, 0x11, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x5f, 0x70, + 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, + 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x50, 0x61, 0x74, 0x68, + 0x52, 0x10, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, + 0x6f, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x06, + 0x75, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x75, 0x70, + 0x74, 0x69, 0x6d, 0x65, 0x22, 0xc0, 0x01, 0x0a, 0x0d, 0x52, 0x65, 0x62, 0x6f, 0x6f, 0x74, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x31, 0x0a, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x19, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x73, 0x79, + 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x52, 0x65, 0x62, 0x6f, 0x6f, 0x74, 0x4d, 0x65, 0x74, 0x68, 0x6f, + 0x64, 0x52, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x64, 0x65, 0x6c, + 0x61, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x64, 0x65, 0x6c, 0x61, 0x79, 0x12, + 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x36, 0x0a, 0x0d, 0x73, 0x75, 0x62, + 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x10, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x50, 0x61, + 0x74, 0x68, 0x52, 0x0d, 0x73, 0x75, 0x62, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, + 0x73, 0x12, 0x14, 0x0a, 0x05, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, + 0x52, 0x05, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x22, 0x10, 0x0a, 0x0e, 0x52, 0x65, 0x62, 0x6f, 0x6f, + 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x67, 0x0a, 0x13, 0x43, 0x61, 0x6e, + 0x63, 0x65, 0x6c, 0x52, 0x65, 0x62, 0x6f, 0x6f, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x36, 0x0a, 0x0d, 0x73, 0x75, + 0x62, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x10, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x50, + 0x61, 0x74, 0x68, 0x52, 0x0d, 0x73, 0x75, 0x62, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, + 0x74, 0x73, 0x22, 0x16, 0x0a, 0x14, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x52, 0x65, 0x62, 0x6f, + 0x6f, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x4d, 0x0a, 0x13, 0x52, 0x65, + 0x62, 0x6f, 0x6f, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x36, 0x0a, 0x0d, 0x73, 0x75, 0x62, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, + 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, + 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x50, 0x61, 0x74, 0x68, 0x52, 0x0d, 0x73, 0x75, 0x62, 0x63, + 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x73, 0x22, 0xea, 0x01, 0x0a, 0x14, 0x52, 0x65, + 0x62, 0x6f, 0x6f, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x06, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x77, 0x61, + 0x69, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x04, 0x77, 0x61, 0x69, 0x74, 0x12, 0x12, + 0x0a, 0x04, 0x77, 0x68, 0x65, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x04, 0x77, 0x68, + 0x65, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x06, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, + 0x75, 0x6e, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x12, 0x31, 0x0a, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0e, + 0x32, 0x19, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x52, + 0x65, 0x62, 0x6f, 0x6f, 0x74, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x52, 0x06, 0x6d, 0x65, 0x74, + 0x68, 0x6f, 0x64, 0x12, 0x31, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x07, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x73, 0x79, 0x73, 0x74, 0x65, + 0x6d, 0x2e, 0x52, 0x65, 0x62, 0x6f, 0x6f, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, + 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0xc6, 0x01, 0x0a, 0x0c, 0x52, 0x65, 0x62, 0x6f, 0x6f, + 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x38, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x20, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x73, + 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x52, 0x65, 0x62, 0x6f, 0x6f, 0x74, 0x53, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x62, 0x0a, 0x06, 0x53, + 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x12, 0x0a, 0x0e, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, + 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x12, 0x0a, 0x0e, 0x53, 0x54, 0x41, + 0x54, 0x55, 0x53, 0x5f, 0x53, 0x55, 0x43, 0x43, 0x45, 0x53, 0x53, 0x10, 0x01, 0x12, 0x1c, 0x0a, + 0x18, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x52, 0x45, 0x54, 0x52, 0x49, 0x41, 0x42, 0x4c, + 0x45, 0x5f, 0x46, 0x41, 0x49, 0x4c, 0x55, 0x52, 0x45, 0x10, 0x02, 0x12, 0x12, 0x0a, 0x0e, 0x53, + 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x46, 0x41, 0x49, 0x4c, 0x55, 0x52, 0x45, 0x10, 0x03, 0x22, + 0x0d, 0x0a, 0x0b, 0x54, 0x69, 0x6d, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x22, + 0x0a, 0x0c, 0x54, 0x69, 0x6d, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x12, + 0x0a, 0x04, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x04, 0x74, 0x69, + 0x6d, 0x65, 0x22, 0xd2, 0x02, 0x0a, 0x0b, 0x50, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x14, 0x0a, 0x05, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x12, 0x12, + 0x0a, 0x04, 0x77, 0x61, 0x69, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x77, 0x61, + 0x69, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x12, 0x26, 0x0a, 0x0f, 0x64, 0x6f, 0x5f, 0x6e, 0x6f, 0x74, + 0x5f, 0x66, 0x72, 0x61, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x0d, 0x64, 0x6f, 0x4e, 0x6f, 0x74, 0x46, 0x72, 0x61, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x24, + 0x0a, 0x0e, 0x64, 0x6f, 0x5f, 0x6e, 0x6f, 0x74, 0x5f, 0x72, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, + 0x18, 0x08, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x64, 0x6f, 0x4e, 0x6f, 0x74, 0x52, 0x65, 0x73, + 0x6f, 0x6c, 0x76, 0x65, 0x12, 0x36, 0x0a, 0x0a, 0x6c, 0x33, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, + 0x6f, 0x6c, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x16, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, + 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x4c, 0x33, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, + 0x52, 0x0a, 0x6c, 0x33, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x12, 0x29, 0x0a, 0x10, + 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x5f, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, + 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x49, + 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x22, 0x98, 0x02, 0x0a, 0x0c, 0x50, 0x69, 0x6e, 0x67, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x12, 0x12, 0x0a, 0x04, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, + 0x74, 0x69, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x04, 0x73, 0x65, 0x6e, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x63, 0x65, + 0x69, 0x76, 0x65, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x72, 0x65, 0x63, 0x65, + 0x69, 0x76, 0x65, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x6d, 0x69, 0x6e, 0x5f, 0x74, 0x69, 0x6d, 0x65, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x6d, 0x69, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x12, + 0x19, 0x0a, 0x08, 0x61, 0x76, 0x67, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x07, 0x61, 0x76, 0x67, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x6d, 0x61, + 0x78, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x6d, 0x61, + 0x78, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x73, 0x74, 0x64, 0x5f, 0x64, 0x65, 0x76, + 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x73, 0x74, 0x64, 0x44, 0x65, 0x76, 0x12, 0x14, + 0x0a, 0x05, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x62, + 0x79, 0x74, 0x65, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, + 0x18, 0x0c, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, + 0x12, 0x10, 0x0a, 0x03, 0x74, 0x74, 0x6c, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x74, + 0x74, 0x6c, 0x22, 0xec, 0x03, 0x0a, 0x11, 0x54, 0x72, 0x61, 0x63, 0x65, 0x72, 0x6f, 0x75, 0x74, + 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x12, 0x1f, 0x0a, 0x0b, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x5f, 0x74, 0x74, + 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0a, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, + 0x54, 0x74, 0x6c, 0x12, 0x17, 0x0a, 0x07, 0x6d, 0x61, 0x78, 0x5f, 0x74, 0x74, 0x6c, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x6d, 0x61, 0x78, 0x54, 0x74, 0x6c, 0x12, 0x12, 0x0a, 0x04, + 0x77, 0x61, 0x69, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x77, 0x61, 0x69, 0x74, + 0x12, 0x26, 0x0a, 0x0f, 0x64, 0x6f, 0x5f, 0x6e, 0x6f, 0x74, 0x5f, 0x66, 0x72, 0x61, 0x67, 0x6d, + 0x65, 0x6e, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0d, 0x64, 0x6f, 0x4e, 0x6f, 0x74, + 0x46, 0x72, 0x61, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x24, 0x0a, 0x0e, 0x64, 0x6f, 0x5f, 0x6e, + 0x6f, 0x74, 0x5f, 0x72, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, + 0x52, 0x0c, 0x64, 0x6f, 0x4e, 0x6f, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x12, 0x36, + 0x0a, 0x0a, 0x6c, 0x33, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x18, 0x08, 0x20, 0x01, + 0x28, 0x0e, 0x32, 0x16, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, + 0x4c, 0x33, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x52, 0x0a, 0x6c, 0x33, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x12, 0x49, 0x0a, 0x0a, 0x6c, 0x34, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x63, 0x6f, 0x6c, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x29, 0x2e, 0x67, 0x6e, 0x6f, + 0x69, 0x2e, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x54, 0x72, 0x61, 0x63, 0x65, 0x72, 0x6f, + 0x75, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x4c, 0x34, 0x50, 0x72, 0x6f, + 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x52, 0x0a, 0x6c, 0x34, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, + 0x6c, 0x12, 0x29, 0x0a, 0x11, 0x64, 0x6f, 0x5f, 0x6e, 0x6f, 0x74, 0x5f, 0x6c, 0x6f, 0x6f, 0x6b, + 0x75, 0x70, 0x5f, 0x61, 0x73, 0x6e, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0e, 0x64, 0x6f, + 0x4e, 0x6f, 0x74, 0x4c, 0x6f, 0x6f, 0x6b, 0x75, 0x70, 0x41, 0x73, 0x6e, 0x12, 0x29, 0x0a, 0x10, + 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x5f, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, + 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x49, + 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x22, 0x28, 0x0a, 0x0a, 0x4c, 0x34, 0x50, 0x72, 0x6f, + 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x12, 0x08, 0x0a, 0x04, 0x49, 0x43, 0x4d, 0x50, 0x10, 0x00, 0x12, + 0x07, 0x0a, 0x03, 0x54, 0x43, 0x50, 0x10, 0x01, 0x12, 0x07, 0x0a, 0x03, 0x55, 0x44, 0x50, 0x10, + 0x02, 0x22, 0xf5, 0x06, 0x0a, 0x12, 0x54, 0x72, 0x61, 0x63, 0x65, 0x72, 0x6f, 0x75, 0x74, 0x65, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x29, 0x0a, 0x10, 0x64, 0x65, 0x73, 0x74, + 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0f, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4e, + 0x61, 0x6d, 0x65, 0x12, 0x2f, 0x0a, 0x13, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x12, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x64, 0x64, + 0x72, 0x65, 0x73, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x6f, 0x70, 0x73, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x04, 0x68, 0x6f, 0x70, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x61, 0x63, 0x6b, + 0x65, 0x74, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x70, + 0x61, 0x63, 0x6b, 0x65, 0x74, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x68, 0x6f, 0x70, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x68, 0x6f, 0x70, 0x12, 0x18, 0x0a, 0x07, 0x61, + 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, + 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x07, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x72, 0x74, 0x74, + 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x72, 0x74, 0x74, 0x12, 0x3b, 0x0a, 0x05, 0x73, + 0x74, 0x61, 0x74, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x25, 0x2e, 0x67, 0x6e, 0x6f, + 0x69, 0x2e, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x54, 0x72, 0x61, 0x63, 0x65, 0x72, 0x6f, + 0x75, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x53, 0x74, 0x61, 0x74, + 0x65, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x69, 0x63, 0x6d, 0x70, + 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x69, 0x63, 0x6d, + 0x70, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x3d, 0x0a, 0x04, 0x6d, 0x70, 0x6c, 0x73, 0x18, 0x0b, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x73, 0x79, 0x73, 0x74, 0x65, + 0x6d, 0x2e, 0x54, 0x72, 0x61, 0x63, 0x65, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x4d, 0x70, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x04, + 0x6d, 0x70, 0x6c, 0x73, 0x12, 0x17, 0x0a, 0x07, 0x61, 0x73, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x18, + 0x0c, 0x20, 0x03, 0x28, 0x05, 0x52, 0x06, 0x61, 0x73, 0x50, 0x61, 0x74, 0x68, 0x12, 0x4f, 0x0a, + 0x0d, 0x69, 0x63, 0x6d, 0x70, 0x5f, 0x65, 0x78, 0x74, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x0d, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x73, 0x79, 0x73, 0x74, + 0x65, 0x6d, 0x2e, 0x54, 0x72, 0x61, 0x63, 0x65, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x49, 0x63, 0x6d, 0x70, 0x45, 0x78, 0x74, 0x44, 0x61, 0x74, + 0x61, 0x52, 0x0b, 0x69, 0x63, 0x6d, 0x70, 0x45, 0x78, 0x74, 0x44, 0x61, 0x74, 0x61, 0x1a, 0x4b, + 0x0a, 0x0b, 0x49, 0x63, 0x6d, 0x70, 0x45, 0x78, 0x74, 0x44, 0x61, 0x74, 0x61, 0x12, 0x14, 0x0a, + 0x05, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x63, 0x6c, + 0x61, 0x73, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0d, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, + 0x03, 0x20, 0x03, 0x28, 0x0d, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x1a, 0x37, 0x0a, 0x09, 0x4d, + 0x70, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x3a, 0x02, 0x38, 0x01, 0x22, 0xf2, 0x01, 0x0a, 0x05, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x0b, + 0x0a, 0x07, 0x44, 0x45, 0x46, 0x41, 0x55, 0x4c, 0x54, 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x4e, + 0x4f, 0x4e, 0x45, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, + 0x10, 0x02, 0x12, 0x08, 0x0a, 0x04, 0x49, 0x43, 0x4d, 0x50, 0x10, 0x03, 0x12, 0x14, 0x0a, 0x10, + 0x48, 0x4f, 0x53, 0x54, 0x5f, 0x55, 0x4e, 0x52, 0x45, 0x41, 0x43, 0x48, 0x41, 0x42, 0x4c, 0x45, + 0x10, 0x04, 0x12, 0x17, 0x0a, 0x13, 0x4e, 0x45, 0x54, 0x57, 0x4f, 0x52, 0x4b, 0x5f, 0x55, 0x4e, + 0x52, 0x45, 0x41, 0x43, 0x48, 0x41, 0x42, 0x4c, 0x45, 0x10, 0x05, 0x12, 0x18, 0x0a, 0x14, 0x50, + 0x52, 0x4f, 0x54, 0x4f, 0x43, 0x4f, 0x4c, 0x5f, 0x55, 0x4e, 0x52, 0x45, 0x41, 0x43, 0x48, 0x41, + 0x42, 0x4c, 0x45, 0x10, 0x06, 0x12, 0x17, 0x0a, 0x13, 0x53, 0x4f, 0x55, 0x52, 0x43, 0x45, 0x5f, + 0x52, 0x4f, 0x55, 0x54, 0x45, 0x5f, 0x46, 0x41, 0x49, 0x4c, 0x45, 0x44, 0x10, 0x07, 0x12, 0x18, + 0x0a, 0x14, 0x46, 0x52, 0x41, 0x47, 0x4d, 0x45, 0x4e, 0x54, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, + 0x4e, 0x45, 0x45, 0x44, 0x45, 0x44, 0x10, 0x08, 0x12, 0x0e, 0x0a, 0x0a, 0x50, 0x52, 0x4f, 0x48, + 0x49, 0x42, 0x49, 0x54, 0x45, 0x44, 0x10, 0x09, 0x12, 0x18, 0x0a, 0x14, 0x50, 0x52, 0x45, 0x43, + 0x45, 0x44, 0x45, 0x4e, 0x43, 0x45, 0x5f, 0x56, 0x49, 0x4f, 0x4c, 0x41, 0x54, 0x49, 0x4f, 0x4e, + 0x10, 0x0a, 0x12, 0x15, 0x0a, 0x11, 0x50, 0x52, 0x45, 0x43, 0x45, 0x44, 0x45, 0x4e, 0x43, 0x45, + 0x5f, 0x43, 0x55, 0x54, 0x4f, 0x46, 0x46, 0x10, 0x0b, 0x22, 0xa1, 0x01, 0x0a, 0x07, 0x50, 0x61, + 0x63, 0x6b, 0x61, 0x67, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x6e, 0x61, 0x6d, + 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x6e, 0x61, 0x6d, + 0x65, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x61, + 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x61, + 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x65, 0x12, 0x44, 0x0a, 0x0f, 0x72, 0x65, 0x6d, 0x6f, 0x74, + 0x65, 0x5f, 0x64, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1b, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x52, + 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x0e, 0x72, + 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x22, 0x9a, 0x01, + 0x0a, 0x11, 0x53, 0x65, 0x74, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x30, 0x0a, 0x07, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x73, 0x79, 0x73, 0x74, + 0x65, 0x6d, 0x2e, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x48, 0x00, 0x52, 0x07, 0x70, 0x61, + 0x63, 0x6b, 0x61, 0x67, 0x65, 0x12, 0x1c, 0x0a, 0x08, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, + 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x48, 0x00, 0x52, 0x08, 0x63, 0x6f, 0x6e, 0x74, 0x65, + 0x6e, 0x74, 0x73, 0x12, 0x2a, 0x0a, 0x04, 0x68, 0x61, 0x73, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x48, + 0x61, 0x73, 0x68, 0x54, 0x79, 0x70, 0x65, 0x48, 0x00, 0x52, 0x04, 0x68, 0x61, 0x73, 0x68, 0x42, + 0x09, 0x0a, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x14, 0x0a, 0x12, 0x53, 0x65, + 0x74, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0xf9, 0x01, 0x0a, 0x12, 0x4b, 0x69, 0x6c, 0x6c, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x70, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0d, 0x52, 0x03, 0x70, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x3e, 0x0a, + 0x06, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x26, 0x2e, + 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x4b, 0x69, 0x6c, 0x6c, + 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x53, + 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x52, 0x06, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x12, 0x18, 0x0a, + 0x07, 0x72, 0x65, 0x73, 0x74, 0x61, 0x72, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, + 0x72, 0x65, 0x73, 0x74, 0x61, 0x72, 0x74, 0x22, 0x63, 0x0a, 0x06, 0x53, 0x69, 0x67, 0x6e, 0x61, + 0x6c, 0x12, 0x16, 0x0a, 0x12, 0x53, 0x49, 0x47, 0x4e, 0x41, 0x4c, 0x5f, 0x55, 0x4e, 0x53, 0x50, + 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0f, 0x0a, 0x0b, 0x53, 0x49, 0x47, + 0x4e, 0x41, 0x4c, 0x5f, 0x54, 0x45, 0x52, 0x4d, 0x10, 0x01, 0x12, 0x0f, 0x0a, 0x0b, 0x53, 0x49, + 0x47, 0x4e, 0x41, 0x4c, 0x5f, 0x4b, 0x49, 0x4c, 0x4c, 0x10, 0x02, 0x12, 0x0e, 0x0a, 0x0a, 0x53, + 0x49, 0x47, 0x4e, 0x41, 0x4c, 0x5f, 0x48, 0x55, 0x50, 0x10, 0x03, 0x12, 0x0f, 0x0a, 0x0b, 0x53, + 0x49, 0x47, 0x4e, 0x41, 0x4c, 0x5f, 0x41, 0x42, 0x52, 0x54, 0x10, 0x04, 0x22, 0x15, 0x0a, 0x13, + 0x4b, 0x69, 0x6c, 0x6c, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x2a, 0x64, 0x0a, 0x0c, 0x52, 0x65, 0x62, 0x6f, 0x6f, 0x74, 0x4d, 0x65, 0x74, + 0x68, 0x6f, 0x64, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, + 0x12, 0x08, 0x0a, 0x04, 0x43, 0x4f, 0x4c, 0x44, 0x10, 0x01, 0x12, 0x0d, 0x0a, 0x09, 0x50, 0x4f, + 0x57, 0x45, 0x52, 0x44, 0x4f, 0x57, 0x4e, 0x10, 0x02, 0x12, 0x08, 0x0a, 0x04, 0x48, 0x41, 0x4c, + 0x54, 0x10, 0x03, 0x12, 0x08, 0x0a, 0x04, 0x57, 0x41, 0x52, 0x4d, 0x10, 0x04, 0x12, 0x07, 0x0a, + 0x03, 0x4e, 0x53, 0x46, 0x10, 0x05, 0x12, 0x0b, 0x0a, 0x07, 0x50, 0x4f, 0x57, 0x45, 0x52, 0x55, + 0x50, 0x10, 0x07, 0x22, 0x04, 0x08, 0x06, 0x10, 0x06, 0x32, 0xea, 0x05, 0x0a, 0x06, 0x53, 0x79, + 0x73, 0x74, 0x65, 0x6d, 0x12, 0x3f, 0x0a, 0x04, 0x50, 0x69, 0x6e, 0x67, 0x12, 0x18, 0x2e, 0x67, + 0x6e, 0x6f, 0x69, 0x2e, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x50, 0x69, 0x6e, 0x67, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x73, 0x79, + 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x50, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x00, 0x30, 0x01, 0x12, 0x51, 0x0a, 0x0a, 0x54, 0x72, 0x61, 0x63, 0x65, 0x72, 0x6f, + 0x75, 0x74, 0x65, 0x12, 0x1e, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x73, 0x79, 0x73, 0x74, 0x65, + 0x6d, 0x2e, 0x54, 0x72, 0x61, 0x63, 0x65, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x73, 0x79, 0x73, 0x74, 0x65, + 0x6d, 0x2e, 0x54, 0x72, 0x61, 0x63, 0x65, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x30, 0x01, 0x12, 0x3d, 0x0a, 0x04, 0x54, 0x69, 0x6d, 0x65, + 0x12, 0x18, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x54, + 0x69, 0x6d, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x67, 0x6e, 0x6f, + 0x69, 0x2e, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x51, 0x0a, 0x0a, 0x53, 0x65, 0x74, 0x50, 0x61, + 0x63, 0x6b, 0x61, 0x67, 0x65, 0x12, 0x1e, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x73, 0x79, 0x73, + 0x74, 0x65, 0x6d, 0x2e, 0x53, 0x65, 0x74, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x73, 0x79, 0x73, + 0x74, 0x65, 0x6d, 0x2e, 0x53, 0x65, 0x74, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x28, 0x01, 0x12, 0x73, 0x0a, 0x16, 0x53, 0x77, + 0x69, 0x74, 0x63, 0x68, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x50, 0x72, 0x6f, 0x63, 0x65, + 0x73, 0x73, 0x6f, 0x72, 0x12, 0x2a, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x73, 0x79, 0x73, 0x74, + 0x65, 0x6d, 0x2e, 0x53, 0x77, 0x69, 0x74, 0x63, 0x68, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, + 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x2b, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x53, + 0x77, 0x69, 0x74, 0x63, 0x68, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x50, 0x72, 0x6f, 0x63, + 0x65, 0x73, 0x73, 0x6f, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, + 0x43, 0x0a, 0x06, 0x52, 0x65, 0x62, 0x6f, 0x6f, 0x74, 0x12, 0x1a, 0x2e, 0x67, 0x6e, 0x6f, 0x69, + 0x2e, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x52, 0x65, 0x62, 0x6f, 0x6f, 0x74, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x73, 0x79, 0x73, + 0x74, 0x65, 0x6d, 0x2e, 0x52, 0x65, 0x62, 0x6f, 0x6f, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x00, 0x12, 0x55, 0x0a, 0x0c, 0x52, 0x65, 0x62, 0x6f, 0x6f, 0x74, 0x53, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x12, 0x20, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x73, 0x79, 0x73, 0x74, + 0x65, 0x6d, 0x2e, 0x52, 0x65, 0x62, 0x6f, 0x6f, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x73, 0x79, + 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x52, 0x65, 0x62, 0x6f, 0x6f, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x55, 0x0a, 0x0c, 0x43, + 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x52, 0x65, 0x62, 0x6f, 0x6f, 0x74, 0x12, 0x20, 0x2e, 0x67, 0x6e, + 0x6f, 0x69, 0x2e, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, + 0x52, 0x65, 0x62, 0x6f, 0x6f, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, + 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x43, 0x61, 0x6e, 0x63, + 0x65, 0x6c, 0x52, 0x65, 0x62, 0x6f, 0x6f, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x00, 0x12, 0x52, 0x0a, 0x0b, 0x4b, 0x69, 0x6c, 0x6c, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, + 0x73, 0x12, 0x1f, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, + 0x4b, 0x69, 0x6c, 0x6c, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, + 0x2e, 0x4b, 0x69, 0x6c, 0x6c, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x2b, 0xd2, 0x3e, 0x05, 0x31, 0x2e, 0x34, 0x2e, 0x30, + 0x5a, 0x21, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x70, 0x65, + 0x6e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x67, 0x6e, 0x6f, 0x69, 0x2f, 0x73, 0x79, 0x73, + 0x74, 0x65, 0x6d, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_system_system_proto_rawDescOnce sync.Once + file_system_system_proto_rawDescData = file_system_system_proto_rawDesc +) + +func file_system_system_proto_rawDescGZIP() []byte { + file_system_system_proto_rawDescOnce.Do(func() { + file_system_system_proto_rawDescData = protoimpl.X.CompressGZIP(file_system_system_proto_rawDescData) + }) + return file_system_system_proto_rawDescData +} + +var file_system_system_proto_enumTypes = make([]protoimpl.EnumInfo, 5) +var file_system_system_proto_msgTypes = make([]protoimpl.MessageInfo, 22) +var file_system_system_proto_goTypes = []interface{}{ + (RebootMethod)(0), // 0: gnoi.system.RebootMethod + (RebootStatus_Status)(0), // 1: gnoi.system.RebootStatus.Status + (TracerouteRequest_L4Protocol)(0), // 2: gnoi.system.TracerouteRequest.L4Protocol + (TracerouteResponse_State)(0), // 3: gnoi.system.TracerouteResponse.State + (KillProcessRequest_Signal)(0), // 4: gnoi.system.KillProcessRequest.Signal + (*SwitchControlProcessorRequest)(nil), // 5: gnoi.system.SwitchControlProcessorRequest + (*SwitchControlProcessorResponse)(nil), // 6: gnoi.system.SwitchControlProcessorResponse + (*RebootRequest)(nil), // 7: gnoi.system.RebootRequest + (*RebootResponse)(nil), // 8: gnoi.system.RebootResponse + (*CancelRebootRequest)(nil), // 9: gnoi.system.CancelRebootRequest + (*CancelRebootResponse)(nil), // 10: gnoi.system.CancelRebootResponse + (*RebootStatusRequest)(nil), // 11: gnoi.system.RebootStatusRequest + (*RebootStatusResponse)(nil), // 12: gnoi.system.RebootStatusResponse + (*RebootStatus)(nil), // 13: gnoi.system.RebootStatus + (*TimeRequest)(nil), // 14: gnoi.system.TimeRequest + (*TimeResponse)(nil), // 15: gnoi.system.TimeResponse + (*PingRequest)(nil), // 16: gnoi.system.PingRequest + (*PingResponse)(nil), // 17: gnoi.system.PingResponse + (*TracerouteRequest)(nil), // 18: gnoi.system.TracerouteRequest + (*TracerouteResponse)(nil), // 19: gnoi.system.TracerouteResponse + (*Package)(nil), // 20: gnoi.system.Package + (*SetPackageRequest)(nil), // 21: gnoi.system.SetPackageRequest + (*SetPackageResponse)(nil), // 22: gnoi.system.SetPackageResponse + (*KillProcessRequest)(nil), // 23: gnoi.system.KillProcessRequest + (*KillProcessResponse)(nil), // 24: gnoi.system.KillProcessResponse + (*TracerouteResponse_IcmpExtData)(nil), // 25: gnoi.system.TracerouteResponse.IcmpExtData + nil, // 26: gnoi.system.TracerouteResponse.MplsEntry + (*types.Path)(nil), // 27: gnoi.types.Path + (types.L3Protocol)(0), // 28: gnoi.types.L3Protocol + (*common.RemoteDownload)(nil), // 29: gnoi.common.RemoteDownload + (*types.HashType)(nil), // 30: gnoi.types.HashType +} +var file_system_system_proto_depIdxs = []int32{ + 27, // 0: gnoi.system.SwitchControlProcessorRequest.control_processor:type_name -> gnoi.types.Path + 27, // 1: gnoi.system.SwitchControlProcessorResponse.control_processor:type_name -> gnoi.types.Path + 0, // 2: gnoi.system.RebootRequest.method:type_name -> gnoi.system.RebootMethod + 27, // 3: gnoi.system.RebootRequest.subcomponents:type_name -> gnoi.types.Path + 27, // 4: gnoi.system.CancelRebootRequest.subcomponents:type_name -> gnoi.types.Path + 27, // 5: gnoi.system.RebootStatusRequest.subcomponents:type_name -> gnoi.types.Path + 0, // 6: gnoi.system.RebootStatusResponse.method:type_name -> gnoi.system.RebootMethod + 13, // 7: gnoi.system.RebootStatusResponse.status:type_name -> gnoi.system.RebootStatus + 1, // 8: gnoi.system.RebootStatus.status:type_name -> gnoi.system.RebootStatus.Status + 28, // 9: gnoi.system.PingRequest.l3protocol:type_name -> gnoi.types.L3Protocol + 28, // 10: gnoi.system.TracerouteRequest.l3protocol:type_name -> gnoi.types.L3Protocol + 2, // 11: gnoi.system.TracerouteRequest.l4protocol:type_name -> gnoi.system.TracerouteRequest.L4Protocol + 3, // 12: gnoi.system.TracerouteResponse.state:type_name -> gnoi.system.TracerouteResponse.State + 26, // 13: gnoi.system.TracerouteResponse.mpls:type_name -> gnoi.system.TracerouteResponse.MplsEntry + 25, // 14: gnoi.system.TracerouteResponse.icmp_ext_data:type_name -> gnoi.system.TracerouteResponse.IcmpExtData + 29, // 15: gnoi.system.Package.remote_download:type_name -> gnoi.common.RemoteDownload + 20, // 16: gnoi.system.SetPackageRequest.package:type_name -> gnoi.system.Package + 30, // 17: gnoi.system.SetPackageRequest.hash:type_name -> gnoi.types.HashType + 4, // 18: gnoi.system.KillProcessRequest.signal:type_name -> gnoi.system.KillProcessRequest.Signal + 16, // 19: gnoi.system.System.Ping:input_type -> gnoi.system.PingRequest + 18, // 20: gnoi.system.System.Traceroute:input_type -> gnoi.system.TracerouteRequest + 14, // 21: gnoi.system.System.Time:input_type -> gnoi.system.TimeRequest + 21, // 22: gnoi.system.System.SetPackage:input_type -> gnoi.system.SetPackageRequest + 5, // 23: gnoi.system.System.SwitchControlProcessor:input_type -> gnoi.system.SwitchControlProcessorRequest + 7, // 24: gnoi.system.System.Reboot:input_type -> gnoi.system.RebootRequest + 11, // 25: gnoi.system.System.RebootStatus:input_type -> gnoi.system.RebootStatusRequest + 9, // 26: gnoi.system.System.CancelReboot:input_type -> gnoi.system.CancelRebootRequest + 23, // 27: gnoi.system.System.KillProcess:input_type -> gnoi.system.KillProcessRequest + 17, // 28: gnoi.system.System.Ping:output_type -> gnoi.system.PingResponse + 19, // 29: gnoi.system.System.Traceroute:output_type -> gnoi.system.TracerouteResponse + 15, // 30: gnoi.system.System.Time:output_type -> gnoi.system.TimeResponse + 22, // 31: gnoi.system.System.SetPackage:output_type -> gnoi.system.SetPackageResponse + 6, // 32: gnoi.system.System.SwitchControlProcessor:output_type -> gnoi.system.SwitchControlProcessorResponse + 8, // 33: gnoi.system.System.Reboot:output_type -> gnoi.system.RebootResponse + 12, // 34: gnoi.system.System.RebootStatus:output_type -> gnoi.system.RebootStatusResponse + 10, // 35: gnoi.system.System.CancelReboot:output_type -> gnoi.system.CancelRebootResponse + 24, // 36: gnoi.system.System.KillProcess:output_type -> gnoi.system.KillProcessResponse + 28, // [28:37] is the sub-list for method output_type + 19, // [19:28] is the sub-list for method input_type + 19, // [19:19] is the sub-list for extension type_name + 19, // [19:19] is the sub-list for extension extendee + 0, // [0:19] is the sub-list for field type_name +} + +func init() { file_system_system_proto_init() } +func file_system_system_proto_init() { + if File_system_system_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_system_system_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SwitchControlProcessorRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_system_system_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SwitchControlProcessorResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_system_system_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RebootRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_system_system_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RebootResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_system_system_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CancelRebootRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_system_system_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CancelRebootResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_system_system_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RebootStatusRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_system_system_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RebootStatusResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_system_system_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RebootStatus); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_system_system_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TimeRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_system_system_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TimeResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_system_system_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PingRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_system_system_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PingResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_system_system_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TracerouteRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_system_system_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TracerouteResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_system_system_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Package); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_system_system_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SetPackageRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_system_system_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SetPackageResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_system_system_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*KillProcessRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_system_system_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*KillProcessResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_system_system_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TracerouteResponse_IcmpExtData); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_system_system_proto_msgTypes[16].OneofWrappers = []interface{}{ + (*SetPackageRequest_Package)(nil), + (*SetPackageRequest_Contents)(nil), + (*SetPackageRequest_Hash)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_system_system_proto_rawDesc, + NumEnums: 5, + NumMessages: 22, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_system_system_proto_goTypes, + DependencyIndexes: file_system_system_proto_depIdxs, + EnumInfos: file_system_system_proto_enumTypes, + MessageInfos: file_system_system_proto_msgTypes, + }.Build() + File_system_system_proto = out.File + file_system_system_proto_rawDesc = nil + file_system_system_proto_goTypes = nil + file_system_system_proto_depIdxs = nil +} diff --git a/src/sonic-framework/gnoi/system/system.proto b/src/sonic-framework/gnoi/system/system.proto new file mode 100644 index 000000000000..7793a1dd2bcb --- /dev/null +++ b/src/sonic-framework/gnoi/system/system.proto @@ -0,0 +1,369 @@ +// +// Copyright 2017 Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +// Generic Network Operation Interface, GNOI, defines a set of RPC's used for +// the operational aspects of network targets. These services are meant to be +// used in conjunction with GNMI for all target state and operational aspects +// of a network target. The gnoi.system.Service is the only mandatory vendor +// implementation. + +syntax = "proto3"; + +package gnoi.system; + +import "common/common.proto"; +import "types/types.proto"; + +option go_package = "github.com/openconfig/gnoi/system"; + +option (types.gnoi_version) = "1.4.0"; + +// The gNOI service is a collection of operational RPC's that allow for the +// management of a target outside of the configuration and telemetry pipeline. +service System { + // Ping executes the ping command on the target and streams back + // the results. Some targets may not stream any results until all + // results are in. The stream should provide single ping packet responses + // and must provide summary statistics. + rpc Ping(PingRequest) returns (stream PingResponse) {} + + // Traceroute executes the traceroute command on the target and streams back + // the results. Some targets may not stream any results until all + // results are in. If a hop count is not explicitly provided, + // 30 is used. + rpc Traceroute(TracerouteRequest) returns (stream TracerouteResponse) {} + + // Time returns the current time on the target. Time is typically used to + // test if a target is actually responding. + rpc Time(TimeRequest) returns (TimeResponse) {} + + // SetPackage places a software package (possibly including bootable images) + // on the target. The file is sent in sequential messages, each message + // up to 64KB of data. A final message must be sent that includes the hash + // of the data sent. An error is returned if the location does not exist or + // there is an error writing the data. If no checksum is received, the target + // must assume the operation is incomplete and remove the partially + // transmitted file. The target should initially write the file to a temporary + // location so a failure does not destroy the original file. + rpc SetPackage(stream SetPackageRequest) returns (SetPackageResponse) {} + + // SwitchControlProcessor will switch from the current route processor to the + // provided route processor. If the current route processor is the same as the + // one provided it is a NOOP. If the target does not exist an error is + // returned. + rpc SwitchControlProcessor(SwitchControlProcessorRequest) + returns (SwitchControlProcessorResponse) {} + + // Reboot causes the target to reboot, possibly at some point in the future. + // If the method of reboot is not supported then the Reboot RPC will fail. + // If the reboot is immediate the command will block until the subcomponents + // have restarted. + // If a reboot on the active control processor is pending the service must + // reject all other reboot requests. + // If a reboot request for active control processor is initiated with other + // pending reboot requests it must be rejected. + rpc Reboot(RebootRequest) returns (RebootResponse) {} + + // RebootStatus returns the status of reboot for the target. + rpc RebootStatus(RebootStatusRequest) returns (RebootStatusResponse) {} + + // CancelReboot cancels any pending reboot request. + rpc CancelReboot(CancelRebootRequest) returns (CancelRebootResponse) {} + + // KillProcess kills an OS process and optionally restarts it. + rpc KillProcess(KillProcessRequest) returns (KillProcessResponse) {} +} + +message SwitchControlProcessorRequest { + // Path to the target Control Processor. + types.Path control_processor = 1; +} + +message SwitchControlProcessorResponse { + // Path to the Control Processor that the system switched to. + types.Path control_processor = 1; + // Current software version of the target Control Processor. + string version = 2; + // Uptime of the target Control Processor in nanoseconds. + int64 uptime = 3; +} + +// A RebootRequest requests the specified target be rebooted using the specified +// method after the specified delay. Only the COLD method with a delay of 0 +// is guaranteed to be accepted for all target types. +message RebootRequest { + RebootMethod method = 1; + // Delay in nanoseconds before issuing reboot. + uint64 delay = 2; + // Informational reason for the reboot. + string message = 3; + // Optional sub-components to reboot. + repeated types.Path subcomponents = 4; + // Force reboot if sanity checks fail. (ex. uncommited configuration) + bool force = 5; +} + +message RebootResponse { +} + +// A RebootMethod determines what should be done with a target when a Reboot is +// requested. Only the COLD method is required to be supported by all +// targets. A target should return 'INVALID_ARGUMENT` if UNKNOWN or any other +// unsupported method is called. +// +// It is vendor defined if a WARM reboot is the same as an NSF reboot. +enum RebootMethod { + UNKNOWN = 0; // Invalid default method. + COLD = 1; // Shutdown and restart OS and all hardware. + POWERDOWN = 2; // Halt and power down, if possible. + HALT = 3; // Halt, if possible. + WARM = 4; // Reload configuration but not underlying hardware. + NSF = 5; // Non-stop-forwarding reboot, if possible. + // RESET method is deprecated in favor of the gNOI FactoryReset.Start(). + reserved 6; + POWERUP = 7; // Apply power, no-op if power is already on. +} + +// A CancelRebootRequest requests the cancelation of any outstanding reboot +// request. +message CancelRebootRequest { + string message = 1; // informational reason for the cancel + repeated types.Path subcomponents = 2; // optional sub-components. +} + +message CancelRebootResponse { +} + +message RebootStatusRequest { + repeated types.Path subcomponents = 1; // optional sub-component. +} + +message RebootStatusResponse { + bool active = 1; // If reboot is active. + uint64 wait = 2; // Time left until reboot. + uint64 when = 3; // Time to reboot in nanoseconds since the epoch. + string reason = 4; // Reason for reboot. + uint32 count = 5; // Number of reboots since active. + RebootMethod method = 6; // Type of reboot. + RebootStatus status = 7; // Applicable only when active = false. +} + +message RebootStatus { + enum Status { + STATUS_UNKNOWN = 0; + STATUS_SUCCESS = 1; + STATUS_RETRIABLE_FAILURE = 2; + STATUS_FAILURE = 3; + } + + Status status = 1; + string message = 2; +} + +// A TimeRequest requests the current time accodring to the target. +message TimeRequest { +} + +message TimeResponse { + uint64 time = 1; // Current time in nanoseconds since epoch. +} + +// A PingRequest describes the ping operation to perform. Only the destination +// fields is required. Any field not specified is set to a reasonable server +// specified value. Not all fields are supported by all vendors. +// +// A count of 0 defaults to a vendor specified value, typically 5. A count of +// -1 means continue until the RPC times out or is canceled. +// +// If the interval is -1 then a flood ping is issued. +// +// If the size is 0, the vendor default size will be used (typically 56 bytes). +message PingRequest { + string destination = 1; // Destination address to ping. required. + string source = 2; // Source address to ping from. + int32 count = 3; // Number of packets. + int64 interval = 4; // Nanoseconds between requests. + int64 wait = 5; // Nanoseconds to wait for a response. + int32 size = 6; // Size of request packet. (excluding ICMP header) + bool do_not_fragment = 7; // Set the do not fragment bit. (IPv4 destinations) + bool do_not_resolve = 8; // Do not try resolve the address returned. + types.L3Protocol l3protocol = 9; // Layer3 protocol requested for the ping. + string network_instance = 10; // Network instance to ping the destination in +} + +// A PingResponse represents either the reponse to a single ping packet +// (the bytes field is non-zero) or the summary statistics (sent is non-zero). +// +// For a single ping packet, time is the round trip time, in nanoseconds. For +// summary statistics, it is the time spent by the ping operation. The time is +// not always present in summary statistics. The std_dev is not always present +// in summary statistics. +message PingResponse { + string source = 1; // Source of received bytes. + int64 time = 2; + + int32 sent = 3; // Total packets sent. + int32 received = 4; // Total packets received. + int64 min_time = 5; // Minimum round trip time in nanoseconds. + int64 avg_time = 6; // Average round trip time in nanoseconds. + int64 max_time = 7; // Maximum round trip time in nanoseconds. + int64 std_dev = 8; // Standard deviation in round trip time. + + int32 bytes = 11; // Bytes received. + int32 sequence = 12; // Sequence number of received packet. + int32 ttl = 13; // Remaining time to live value. +} + +// A TracerouteRequest describes the traceroute operation to perform. Only the +// destination field is required. Any field not specified is set to a +// reasonable server specified value. Not all fields are supported by all +// vendors. +// +// If the hop_count is -1 the traceroute will continue forever. +// +message TracerouteRequest { + string source = 1; // Source address to ping from. + string destination = 2; // Destination address to ping. + uint32 initial_ttl = 3; // Initial TTL. (default=1) + int32 max_ttl = 4; // Maximum number of hops. (default=30) + int64 wait = 5; // Nanoseconds to wait for a response. + bool do_not_fragment = 6; // Set the do not fragment bit. (IPv4 destinations) + bool do_not_resolve = 7; // Do not try resolve the address returned. + types.L3Protocol l3protocol = 8; // Layer-3 protocol requested for the ping. + enum L4Protocol { + ICMP = 0; // Use ICMP ECHO for probes. + TCP = 1; // Use TCP SYN for probes. + UDP = 2; // Use UDP for probes. + } + L4Protocol l4protocol = 9; + bool do_not_lookup_asn = 10; // Do not try to lookup ASN + string network_instance = 11; // Network instance to trace the destination in +} + +// A TraceRouteResponse contains the result of a single traceoute packet. +// +// There may be an optional initial response that provides information about the +// traceroute request itself and contains at least one of the fields in the the +// initial block of fields and none of the fields following that block. All +// subsequent responses should not contain any of these fields. +// +// Typically multiple responses are received for each hop, as the packets are +// received. +// +// The mpls field maps names to values. Example names include "Label", "CoS", +// "TTL", "S", and "MRU". +// [Perhaps we should list the canonical names that must be used when +// applicable]. +message TracerouteResponse { + // The following fields are only filled in for the first message. + // If any of these fields are specified, all fields following this + // block are left unspecified. + string destination_name = 1; + string destination_address = 2; + int32 hops = 3; + int32 packet_size = 4; + + // State is the resulting state of a single traceoroute packet. + enum State { + DEFAULT = 0; // Normal hop response. + NONE = 1; // No response. + UNKNOWN = 2; // Unknown response state. + ICMP = 3; // See icmp_code field. + HOST_UNREACHABLE = 4; // Host unreachable. + NETWORK_UNREACHABLE = 5; // Network unreachable. + PROTOCOL_UNREACHABLE = 6; // Protocol unreachable. + SOURCE_ROUTE_FAILED = 7; // Source route failed. + FRAGMENTATION_NEEDED = 8; // Fragmentation needed. + PROHIBITED = 9; // Communication administratively prohibited. + PRECEDENCE_VIOLATION = 10; // Host precedence violation. + PRECEDENCE_CUTOFF = 11; // Precedence cutoff in effect. + } + + message IcmpExtData{ + uint32 class = 1; // class number + uint32 type = 2; // class type + repeated uint32 data = 3; // raw words associated with this data + } + + // The following fields provide the disposition of a single traceroute + // packet. + int32 hop = 5; // Hop number. required. + string address = 6; // Address of responding hop. required. + string name = 7; // Name of responding hop. + int64 rtt = 8; // Round trip time in nanoseconds. + State state = 9; // State of this hop. + int32 icmp_code = 10; // Code terminating hop. + map mpls = 11; // MPLS key/value pairs. + repeated int32 as_path = 12; // AS path. + repeated IcmpExtData icmp_ext_data = 13; // ICMP extension data +} + +// Package defines a single package file to be placed on the target. +message Package { + // Destination path and filename of the package. + string filename = 1; + // Version of the package. (vendor internal name) + string version = 4; + // Indicates that the package should be made active after receipt on + // the device. For system image packages, the new image is expected to + // be active after a reboot. + bool activate = 5; + // Details for the device to download the package from a remote location. + common.RemoteDownload remote_download = 6; +} + +// SetPackageRequest will place the package onto the target and optionally mark +// it as the next bootable image. The initial message must be a package +// message containing the filename and information about the file. Following the +// initial message the contents are then streamed in maximum 64k chunks. The +// final message must be a hash message contains the hash of the file contents. +message SetPackageRequest { + oneof request { + Package package = 1; + bytes contents = 2; + types.HashType hash = 3; // Verification hash of data. + } +} + +message SetPackageResponse { +} + +// KillProcessRequest describes the process kill operation. Either a pid or +// process name must be specified, and a termination signal must be specified. +message KillProcessRequest { + // Process ID of the process to be killed. + uint32 pid = 1; + // Name of the process to be killed. + string name = 2; + // Termination signal sent to the process. + enum Signal { + SIGNAL_UNSPECIFIED = 0; // Invalid default. + SIGNAL_TERM = 1; // Terminate the process gracefully. + SIGNAL_KILL = 2; // Terminate the process immediately. + SIGNAL_HUP = 3; // Reload the process configuration. + // Terminate the process immediately and dump a core file. + SIGNAL_ABRT = 4; + } + + Signal signal = 3; + // Whether the process should be restarted after termination. + // This value is ignored when the termination signal is SIGHUP. + bool restart = 4; +} + +// KillProcessResponse describes the result of the process kill operation. +message KillProcessResponse { +} diff --git a/src/sonic-framework/gnoi/system/system_grpc.pb.go b/src/sonic-framework/gnoi/system/system_grpc.pb.go new file mode 100755 index 000000000000..628e3347f551 --- /dev/null +++ b/src/sonic-framework/gnoi/system/system_grpc.pb.go @@ -0,0 +1,482 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.2.0 +// - protoc v3.21.10 +// source: system/system.proto + +package system + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +// SystemClient is the client API for System service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type SystemClient interface { + Ping(ctx context.Context, in *PingRequest, opts ...grpc.CallOption) (System_PingClient, error) + Traceroute(ctx context.Context, in *TracerouteRequest, opts ...grpc.CallOption) (System_TracerouteClient, error) + Time(ctx context.Context, in *TimeRequest, opts ...grpc.CallOption) (*TimeResponse, error) + SetPackage(ctx context.Context, opts ...grpc.CallOption) (System_SetPackageClient, error) + SwitchControlProcessor(ctx context.Context, in *SwitchControlProcessorRequest, opts ...grpc.CallOption) (*SwitchControlProcessorResponse, error) + Reboot(ctx context.Context, in *RebootRequest, opts ...grpc.CallOption) (*RebootResponse, error) + RebootStatus(ctx context.Context, in *RebootStatusRequest, opts ...grpc.CallOption) (*RebootStatusResponse, error) + CancelReboot(ctx context.Context, in *CancelRebootRequest, opts ...grpc.CallOption) (*CancelRebootResponse, error) + KillProcess(ctx context.Context, in *KillProcessRequest, opts ...grpc.CallOption) (*KillProcessResponse, error) +} + +type systemClient struct { + cc grpc.ClientConnInterface +} + +func NewSystemClient(cc grpc.ClientConnInterface) SystemClient { + return &systemClient{cc} +} + +func (c *systemClient) Ping(ctx context.Context, in *PingRequest, opts ...grpc.CallOption) (System_PingClient, error) { + stream, err := c.cc.NewStream(ctx, &System_ServiceDesc.Streams[0], "/gnoi.system.System/Ping", opts...) + if err != nil { + return nil, err + } + x := &systemPingClient{stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +type System_PingClient interface { + Recv() (*PingResponse, error) + grpc.ClientStream +} + +type systemPingClient struct { + grpc.ClientStream +} + +func (x *systemPingClient) Recv() (*PingResponse, error) { + m := new(PingResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *systemClient) Traceroute(ctx context.Context, in *TracerouteRequest, opts ...grpc.CallOption) (System_TracerouteClient, error) { + stream, err := c.cc.NewStream(ctx, &System_ServiceDesc.Streams[1], "/gnoi.system.System/Traceroute", opts...) + if err != nil { + return nil, err + } + x := &systemTracerouteClient{stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +type System_TracerouteClient interface { + Recv() (*TracerouteResponse, error) + grpc.ClientStream +} + +type systemTracerouteClient struct { + grpc.ClientStream +} + +func (x *systemTracerouteClient) Recv() (*TracerouteResponse, error) { + m := new(TracerouteResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *systemClient) Time(ctx context.Context, in *TimeRequest, opts ...grpc.CallOption) (*TimeResponse, error) { + out := new(TimeResponse) + err := c.cc.Invoke(ctx, "/gnoi.system.System/Time", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *systemClient) SetPackage(ctx context.Context, opts ...grpc.CallOption) (System_SetPackageClient, error) { + stream, err := c.cc.NewStream(ctx, &System_ServiceDesc.Streams[2], "/gnoi.system.System/SetPackage", opts...) + if err != nil { + return nil, err + } + x := &systemSetPackageClient{stream} + return x, nil +} + +type System_SetPackageClient interface { + Send(*SetPackageRequest) error + CloseAndRecv() (*SetPackageResponse, error) + grpc.ClientStream +} + +type systemSetPackageClient struct { + grpc.ClientStream +} + +func (x *systemSetPackageClient) Send(m *SetPackageRequest) error { + return x.ClientStream.SendMsg(m) +} + +func (x *systemSetPackageClient) CloseAndRecv() (*SetPackageResponse, error) { + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + m := new(SetPackageResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *systemClient) SwitchControlProcessor(ctx context.Context, in *SwitchControlProcessorRequest, opts ...grpc.CallOption) (*SwitchControlProcessorResponse, error) { + out := new(SwitchControlProcessorResponse) + err := c.cc.Invoke(ctx, "/gnoi.system.System/SwitchControlProcessor", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *systemClient) Reboot(ctx context.Context, in *RebootRequest, opts ...grpc.CallOption) (*RebootResponse, error) { + out := new(RebootResponse) + err := c.cc.Invoke(ctx, "/gnoi.system.System/Reboot", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *systemClient) RebootStatus(ctx context.Context, in *RebootStatusRequest, opts ...grpc.CallOption) (*RebootStatusResponse, error) { + out := new(RebootStatusResponse) + err := c.cc.Invoke(ctx, "/gnoi.system.System/RebootStatus", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *systemClient) CancelReboot(ctx context.Context, in *CancelRebootRequest, opts ...grpc.CallOption) (*CancelRebootResponse, error) { + out := new(CancelRebootResponse) + err := c.cc.Invoke(ctx, "/gnoi.system.System/CancelReboot", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *systemClient) KillProcess(ctx context.Context, in *KillProcessRequest, opts ...grpc.CallOption) (*KillProcessResponse, error) { + out := new(KillProcessResponse) + err := c.cc.Invoke(ctx, "/gnoi.system.System/KillProcess", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// SystemServer is the server API for System service. +// All implementations must embed UnimplementedSystemServer +// for forward compatibility +type SystemServer interface { + Ping(*PingRequest, System_PingServer) error + Traceroute(*TracerouteRequest, System_TracerouteServer) error + Time(context.Context, *TimeRequest) (*TimeResponse, error) + SetPackage(System_SetPackageServer) error + SwitchControlProcessor(context.Context, *SwitchControlProcessorRequest) (*SwitchControlProcessorResponse, error) + Reboot(context.Context, *RebootRequest) (*RebootResponse, error) + RebootStatus(context.Context, *RebootStatusRequest) (*RebootStatusResponse, error) + CancelReboot(context.Context, *CancelRebootRequest) (*CancelRebootResponse, error) + KillProcess(context.Context, *KillProcessRequest) (*KillProcessResponse, error) + mustEmbedUnimplementedSystemServer() +} + +// UnimplementedSystemServer must be embedded to have forward compatible implementations. +type UnimplementedSystemServer struct { +} + +func (UnimplementedSystemServer) Ping(*PingRequest, System_PingServer) error { + return status.Errorf(codes.Unimplemented, "method Ping not implemented") +} +func (UnimplementedSystemServer) Traceroute(*TracerouteRequest, System_TracerouteServer) error { + return status.Errorf(codes.Unimplemented, "method Traceroute not implemented") +} +func (UnimplementedSystemServer) Time(context.Context, *TimeRequest) (*TimeResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Time not implemented") +} +func (UnimplementedSystemServer) SetPackage(System_SetPackageServer) error { + return status.Errorf(codes.Unimplemented, "method SetPackage not implemented") +} +func (UnimplementedSystemServer) SwitchControlProcessor(context.Context, *SwitchControlProcessorRequest) (*SwitchControlProcessorResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SwitchControlProcessor not implemented") +} +func (UnimplementedSystemServer) Reboot(context.Context, *RebootRequest) (*RebootResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Reboot not implemented") +} +func (UnimplementedSystemServer) RebootStatus(context.Context, *RebootStatusRequest) (*RebootStatusResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method RebootStatus not implemented") +} +func (UnimplementedSystemServer) CancelReboot(context.Context, *CancelRebootRequest) (*CancelRebootResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CancelReboot not implemented") +} +func (UnimplementedSystemServer) KillProcess(context.Context, *KillProcessRequest) (*KillProcessResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method KillProcess not implemented") +} +func (UnimplementedSystemServer) mustEmbedUnimplementedSystemServer() {} + +// UnsafeSystemServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to SystemServer will +// result in compilation errors. +type UnsafeSystemServer interface { + mustEmbedUnimplementedSystemServer() +} + +func RegisterSystemServer(s grpc.ServiceRegistrar, srv SystemServer) { + s.RegisterService(&System_ServiceDesc, srv) +} + +func _System_Ping_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(PingRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(SystemServer).Ping(m, &systemPingServer{stream}) +} + +type System_PingServer interface { + Send(*PingResponse) error + grpc.ServerStream +} + +type systemPingServer struct { + grpc.ServerStream +} + +func (x *systemPingServer) Send(m *PingResponse) error { + return x.ServerStream.SendMsg(m) +} + +func _System_Traceroute_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(TracerouteRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(SystemServer).Traceroute(m, &systemTracerouteServer{stream}) +} + +type System_TracerouteServer interface { + Send(*TracerouteResponse) error + grpc.ServerStream +} + +type systemTracerouteServer struct { + grpc.ServerStream +} + +func (x *systemTracerouteServer) Send(m *TracerouteResponse) error { + return x.ServerStream.SendMsg(m) +} + +func _System_Time_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(TimeRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SystemServer).Time(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/gnoi.system.System/Time", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SystemServer).Time(ctx, req.(*TimeRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _System_SetPackage_Handler(srv interface{}, stream grpc.ServerStream) error { + return srv.(SystemServer).SetPackage(&systemSetPackageServer{stream}) +} + +type System_SetPackageServer interface { + SendAndClose(*SetPackageResponse) error + Recv() (*SetPackageRequest, error) + grpc.ServerStream +} + +type systemSetPackageServer struct { + grpc.ServerStream +} + +func (x *systemSetPackageServer) SendAndClose(m *SetPackageResponse) error { + return x.ServerStream.SendMsg(m) +} + +func (x *systemSetPackageServer) Recv() (*SetPackageRequest, error) { + m := new(SetPackageRequest) + if err := x.ServerStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func _System_SwitchControlProcessor_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SwitchControlProcessorRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SystemServer).SwitchControlProcessor(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/gnoi.system.System/SwitchControlProcessor", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SystemServer).SwitchControlProcessor(ctx, req.(*SwitchControlProcessorRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _System_Reboot_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(RebootRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SystemServer).Reboot(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/gnoi.system.System/Reboot", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SystemServer).Reboot(ctx, req.(*RebootRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _System_RebootStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(RebootStatusRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SystemServer).RebootStatus(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/gnoi.system.System/RebootStatus", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SystemServer).RebootStatus(ctx, req.(*RebootStatusRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _System_CancelReboot_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CancelRebootRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SystemServer).CancelReboot(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/gnoi.system.System/CancelReboot", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SystemServer).CancelReboot(ctx, req.(*CancelRebootRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _System_KillProcess_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(KillProcessRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SystemServer).KillProcess(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/gnoi.system.System/KillProcess", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SystemServer).KillProcess(ctx, req.(*KillProcessRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// System_ServiceDesc is the grpc.ServiceDesc for System service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var System_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "gnoi.system.System", + HandlerType: (*SystemServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Time", + Handler: _System_Time_Handler, + }, + { + MethodName: "SwitchControlProcessor", + Handler: _System_SwitchControlProcessor_Handler, + }, + { + MethodName: "Reboot", + Handler: _System_Reboot_Handler, + }, + { + MethodName: "RebootStatus", + Handler: _System_RebootStatus_Handler, + }, + { + MethodName: "CancelReboot", + Handler: _System_CancelReboot_Handler, + }, + { + MethodName: "KillProcess", + Handler: _System_KillProcess_Handler, + }, + }, + Streams: []grpc.StreamDesc{ + { + StreamName: "Ping", + Handler: _System_Ping_Handler, + ServerStreams: true, + }, + { + StreamName: "Traceroute", + Handler: _System_Traceroute_Handler, + ServerStreams: true, + }, + { + StreamName: "SetPackage", + Handler: _System_SetPackage_Handler, + ClientStreams: true, + }, + }, + Metadata: "system/system.proto", +} diff --git a/src/sonic-framework/gnoi/test/BUILD.bazel b/src/sonic-framework/gnoi/test/BUILD.bazel new file mode 100644 index 000000000000..2c0c063850bb --- /dev/null +++ b/src/sonic-framework/gnoi/test/BUILD.bazel @@ -0,0 +1,21 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "test", + srcs = ["simple.go"], + importpath = "github.com/openconfig/gnoi/test", + visibility = ["//visibility:public"], +) + +go_test( + name = "test_test", + srcs = ["simple_test.go"], + embed = [":test"], + deps = [ + "//bgp", + "//common", + "//system", + "//types", + "@com_github_golang_protobuf//proto:go_default_library", + ], +) diff --git a/src/sonic-framework/gnoi/test/simple.go b/src/sonic-framework/gnoi/test/simple.go new file mode 100644 index 000000000000..e71210c9cac8 --- /dev/null +++ b/src/sonic-framework/gnoi/test/simple.go @@ -0,0 +1,16 @@ +// Copyright 2017 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Package simple defines a simple set of gNOI tests. +package simple diff --git a/src/sonic-framework/gnoi/test/simple_test.go b/src/sonic-framework/gnoi/test/simple_test.go new file mode 100644 index 000000000000..ead7239841ec --- /dev/null +++ b/src/sonic-framework/gnoi/test/simple_test.go @@ -0,0 +1,76 @@ +// Copyright 2017 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package simple + +import ( + "testing" + + //lint:ignore SA1019 Test depends on deprecated proto marshal API. + "github.com/golang/protobuf/proto" + bgppb "github.com/openconfig/gnoi/bgp" + cpb "github.com/openconfig/gnoi/common" + spb "github.com/openconfig/gnoi/system" + tpb "github.com/openconfig/gnoi/types" +) + +func TestGNOI(t *testing.T) { + tests := []struct { + desc string + in proto.Message + want string + }{{ + desc: "tpb.Path", + in: &tpb.Path{ + Origin: "oc", + Elem: []*tpb.PathElem{{Name: "interfaces", Key: map[string]string{"name": "Ethernet1/1/0"}}}, + }, + want: "origin: \"oc\"\nelem: <\n name: \"interfaces\"\n key: <\n key: \"name\"\n value: \"Ethernet1/1/0\"\n >\n>\n", + }, { + desc: "tpb.HashType", + in: &tpb.HashType{ + Method: tpb.HashType_MD5, + Hash: []byte("foo"), + }, + want: "method: MD5\nhash: \"foo\"\n", + }, { + desc: "bgp.ClearBGPNeighborRequest", + in: &bgppb.ClearBGPNeighborRequest{ + Address: "foo", + RoutingInstance: "bar", + Mode: bgppb.ClearBGPNeighborRequest_HARD, + }, + want: "address: \"foo\"\nrouting_instance: \"bar\"\nmode: HARD\n", + }, { + desc: "system.SetPackage", + in: &spb.Package{ + Filename: "filename", + RemoteDownload: &cpb.RemoteDownload{ + Path: "foo", + Protocol: cpb.RemoteDownload_SCP, + Credentials: &tpb.Credentials{ + Username: "bar", + }, + }, + }, + want: "filename: \"filename\"\nremote_download: <\n path: \"foo\"\n protocol: SCP\n credentials: <\n username: \"bar\"\n >\n>\n", + }} + for _, tt := range tests { + t.Run(tt.desc, func(t *testing.T) { + if got := proto.MarshalTextString(tt.in); got != tt.want { + t.Fatalf("Text Proto output failed: got %q, want %q", got, tt.want) + } + }) + } +} diff --git a/src/sonic-framework/gnoi/types/BUILD.bazel b/src/sonic-framework/gnoi/types/BUILD.bazel new file mode 100644 index 000000000000..46370cceb7c4 --- /dev/null +++ b/src/sonic-framework/gnoi/types/BUILD.bazel @@ -0,0 +1,54 @@ +load("@rules_proto//proto:defs.bzl", "proto_library") +load("@io_bazel_rules_go//go:def.bzl", "go_library") +load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library") +load("@com_github_grpc_grpc//bazel:cc_grpc_library.bzl", "cc_grpc_library") +load("//:common.bzl", "use_new_compilers") + +#Copyright 2021 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +package( + default_visibility = ["//visibility:public"], + licenses = ["notice"], +) + +use_new_compilers() + +proto_library( + name = "types_proto", + srcs = ["types.proto"], + import_prefix = "github.com/openconfig/gnoi", + deps = ["@com_google_protobuf//:descriptor_proto"], +) + +cc_proto_library( + name = "types_cc_proto", + deps = [":types_proto"], +) + +go_proto_library( + name = "types_go_proto", + compilers = [ + "go_protoc_gen_go", + "go_protoc_gen_go_grpc", + ], + importpath = "github.com/openconfig/gnoi/types", + proto = ":types_proto", +) + +go_library( + name = "types", + embed = [":types_go_proto"], + importpath = "github.com/openconfig/gnoi/types", +) diff --git a/src/sonic-framework/gnoi/types/types.pb.go b/src/sonic-framework/gnoi/types/types.pb.go new file mode 100644 index 000000000000..ea9499b89098 --- /dev/null +++ b/src/sonic-framework/gnoi/types/types.pb.go @@ -0,0 +1,565 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.30.0 +// protoc v3.21.10 +// source: github.com/openconfig/gnoi/types/types.proto + +package types + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + descriptorpb "google.golang.org/protobuf/types/descriptorpb" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type L3Protocol int32 + +const ( + L3Protocol_UNSPECIFIED L3Protocol = 0 + L3Protocol_IPV4 L3Protocol = 1 + L3Protocol_IPV6 L3Protocol = 2 +) + +// Enum value maps for L3Protocol. +var ( + L3Protocol_name = map[int32]string{ + 0: "UNSPECIFIED", + 1: "IPV4", + 2: "IPV6", + } + L3Protocol_value = map[string]int32{ + "UNSPECIFIED": 0, + "IPV4": 1, + "IPV6": 2, + } +) + +func (x L3Protocol) Enum() *L3Protocol { + p := new(L3Protocol) + *p = x + return p +} + +func (x L3Protocol) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (L3Protocol) Descriptor() protoreflect.EnumDescriptor { + return file_github_com_openconfig_gnoi_types_types_proto_enumTypes[0].Descriptor() +} + +func (L3Protocol) Type() protoreflect.EnumType { + return &file_github_com_openconfig_gnoi_types_types_proto_enumTypes[0] +} + +func (x L3Protocol) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use L3Protocol.Descriptor instead. +func (L3Protocol) EnumDescriptor() ([]byte, []int) { + return file_github_com_openconfig_gnoi_types_types_proto_rawDescGZIP(), []int{0} +} + +type HashType_HashMethod int32 + +const ( + HashType_UNSPECIFIED HashType_HashMethod = 0 + HashType_SHA256 HashType_HashMethod = 1 + HashType_SHA512 HashType_HashMethod = 2 + HashType_MD5 HashType_HashMethod = 3 +) + +// Enum value maps for HashType_HashMethod. +var ( + HashType_HashMethod_name = map[int32]string{ + 0: "UNSPECIFIED", + 1: "SHA256", + 2: "SHA512", + 3: "MD5", + } + HashType_HashMethod_value = map[string]int32{ + "UNSPECIFIED": 0, + "SHA256": 1, + "SHA512": 2, + "MD5": 3, + } +) + +func (x HashType_HashMethod) Enum() *HashType_HashMethod { + p := new(HashType_HashMethod) + *p = x + return p +} + +func (x HashType_HashMethod) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (HashType_HashMethod) Descriptor() protoreflect.EnumDescriptor { + return file_github_com_openconfig_gnoi_types_types_proto_enumTypes[1].Descriptor() +} + +func (HashType_HashMethod) Type() protoreflect.EnumType { + return &file_github_com_openconfig_gnoi_types_types_proto_enumTypes[1] +} + +func (x HashType_HashMethod) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use HashType_HashMethod.Descriptor instead. +func (HashType_HashMethod) EnumDescriptor() ([]byte, []int) { + return file_github_com_openconfig_gnoi_types_types_proto_rawDescGZIP(), []int{0, 0} +} + +type HashType struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Method HashType_HashMethod `protobuf:"varint,1,opt,name=method,proto3,enum=gnoi.types.HashType_HashMethod" json:"method,omitempty"` + Hash []byte `protobuf:"bytes,2,opt,name=hash,proto3" json:"hash,omitempty"` +} + +func (x *HashType) Reset() { + *x = HashType{} + if protoimpl.UnsafeEnabled { + mi := &file_github_com_openconfig_gnoi_types_types_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *HashType) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*HashType) ProtoMessage() {} + +func (x *HashType) ProtoReflect() protoreflect.Message { + mi := &file_github_com_openconfig_gnoi_types_types_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use HashType.ProtoReflect.Descriptor instead. +func (*HashType) Descriptor() ([]byte, []int) { + return file_github_com_openconfig_gnoi_types_types_proto_rawDescGZIP(), []int{0} +} + +func (x *HashType) GetMethod() HashType_HashMethod { + if x != nil { + return x.Method + } + return HashType_UNSPECIFIED +} + +func (x *HashType) GetHash() []byte { + if x != nil { + return x.Hash + } + return nil +} + +type Path struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Origin string `protobuf:"bytes,2,opt,name=origin,proto3" json:"origin,omitempty"` + Elem []*PathElem `protobuf:"bytes,3,rep,name=elem,proto3" json:"elem,omitempty"` +} + +func (x *Path) Reset() { + *x = Path{} + if protoimpl.UnsafeEnabled { + mi := &file_github_com_openconfig_gnoi_types_types_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Path) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Path) ProtoMessage() {} + +func (x *Path) ProtoReflect() protoreflect.Message { + mi := &file_github_com_openconfig_gnoi_types_types_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Path.ProtoReflect.Descriptor instead. +func (*Path) Descriptor() ([]byte, []int) { + return file_github_com_openconfig_gnoi_types_types_proto_rawDescGZIP(), []int{1} +} + +func (x *Path) GetOrigin() string { + if x != nil { + return x.Origin + } + return "" +} + +func (x *Path) GetElem() []*PathElem { + if x != nil { + return x.Elem + } + return nil +} + +type PathElem struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Key map[string]string `protobuf:"bytes,2,rep,name=key,proto3" json:"key,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +func (x *PathElem) Reset() { + *x = PathElem{} + if protoimpl.UnsafeEnabled { + mi := &file_github_com_openconfig_gnoi_types_types_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PathElem) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PathElem) ProtoMessage() {} + +func (x *PathElem) ProtoReflect() protoreflect.Message { + mi := &file_github_com_openconfig_gnoi_types_types_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PathElem.ProtoReflect.Descriptor instead. +func (*PathElem) Descriptor() ([]byte, []int) { + return file_github_com_openconfig_gnoi_types_types_proto_rawDescGZIP(), []int{2} +} + +func (x *PathElem) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *PathElem) GetKey() map[string]string { + if x != nil { + return x.Key + } + return nil +} + +type Credentials struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"` + // Types that are assignable to Password: + // + // *Credentials_Cleartext + // *Credentials_Hashed + Password isCredentials_Password `protobuf_oneof:"password"` +} + +func (x *Credentials) Reset() { + *x = Credentials{} + if protoimpl.UnsafeEnabled { + mi := &file_github_com_openconfig_gnoi_types_types_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Credentials) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Credentials) ProtoMessage() {} + +func (x *Credentials) ProtoReflect() protoreflect.Message { + mi := &file_github_com_openconfig_gnoi_types_types_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Credentials.ProtoReflect.Descriptor instead. +func (*Credentials) Descriptor() ([]byte, []int) { + return file_github_com_openconfig_gnoi_types_types_proto_rawDescGZIP(), []int{3} +} + +func (x *Credentials) GetUsername() string { + if x != nil { + return x.Username + } + return "" +} + +func (m *Credentials) GetPassword() isCredentials_Password { + if m != nil { + return m.Password + } + return nil +} + +func (x *Credentials) GetCleartext() string { + if x, ok := x.GetPassword().(*Credentials_Cleartext); ok { + return x.Cleartext + } + return "" +} + +func (x *Credentials) GetHashed() *HashType { + if x, ok := x.GetPassword().(*Credentials_Hashed); ok { + return x.Hashed + } + return nil +} + +type isCredentials_Password interface { + isCredentials_Password() +} + +type Credentials_Cleartext struct { + Cleartext string `protobuf:"bytes,2,opt,name=cleartext,proto3,oneof"` +} + +type Credentials_Hashed struct { + Hashed *HashType `protobuf:"bytes,3,opt,name=hashed,proto3,oneof"` +} + +func (*Credentials_Cleartext) isCredentials_Password() {} + +func (*Credentials_Hashed) isCredentials_Password() {} + +var file_github_com_openconfig_gnoi_types_types_proto_extTypes = []protoimpl.ExtensionInfo{ + { + ExtendedType: (*descriptorpb.FileOptions)(nil), + ExtensionType: (*string)(nil), + Field: 1002, + Name: "gnoi.types.gnoi_version", + Tag: "bytes,1002,opt,name=gnoi_version", + Filename: "github.com/openconfig/gnoi/types/types.proto", + }, +} + +// Extension fields to descriptorpb.FileOptions. +var ( + // optional string gnoi_version = 1002; + E_GnoiVersion = &file_github_com_openconfig_gnoi_types_types_proto_extTypes[0] +) + +var File_github_com_openconfig_gnoi_types_types_proto protoreflect.FileDescriptor + +var file_github_com_openconfig_gnoi_types_types_proto_rawDesc = []byte{ + 0x0a, 0x2c, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x70, 0x65, + 0x6e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x67, 0x6e, 0x6f, 0x69, 0x2f, 0x74, 0x79, 0x70, + 0x65, 0x73, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0a, + 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x1a, 0x20, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x65, 0x73, 0x63, + 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x97, 0x01, 0x0a, + 0x08, 0x48, 0x61, 0x73, 0x68, 0x54, 0x79, 0x70, 0x65, 0x12, 0x37, 0x0a, 0x06, 0x6d, 0x65, 0x74, + 0x68, 0x6f, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1f, 0x2e, 0x67, 0x6e, 0x6f, 0x69, + 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x48, 0x61, 0x73, 0x68, 0x54, 0x79, 0x70, 0x65, 0x2e, + 0x48, 0x61, 0x73, 0x68, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x52, 0x06, 0x6d, 0x65, 0x74, 0x68, + 0x6f, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x61, 0x73, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, + 0x52, 0x04, 0x68, 0x61, 0x73, 0x68, 0x22, 0x3e, 0x0a, 0x0a, 0x48, 0x61, 0x73, 0x68, 0x4d, 0x65, + 0x74, 0x68, 0x6f, 0x64, 0x12, 0x0f, 0x0a, 0x0b, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, + 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, 0x10, + 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x53, 0x48, 0x41, 0x35, 0x31, 0x32, 0x10, 0x02, 0x12, 0x07, 0x0a, + 0x03, 0x4d, 0x44, 0x35, 0x10, 0x03, 0x22, 0x48, 0x0a, 0x04, 0x50, 0x61, 0x74, 0x68, 0x12, 0x16, + 0x0a, 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, + 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x12, 0x28, 0x0a, 0x04, 0x65, 0x6c, 0x65, 0x6d, 0x18, 0x03, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x74, 0x79, 0x70, 0x65, + 0x73, 0x2e, 0x50, 0x61, 0x74, 0x68, 0x45, 0x6c, 0x65, 0x6d, 0x52, 0x04, 0x65, 0x6c, 0x65, 0x6d, + 0x22, 0x87, 0x01, 0x0a, 0x08, 0x50, 0x61, 0x74, 0x68, 0x45, 0x6c, 0x65, 0x6d, 0x12, 0x12, 0x0a, + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x12, 0x2f, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, + 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x50, 0x61, 0x74, 0x68, + 0x45, 0x6c, 0x65, 0x6d, 0x2e, 0x4b, 0x65, 0x79, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x03, 0x6b, + 0x65, 0x79, 0x1a, 0x36, 0x0a, 0x08, 0x4b, 0x65, 0x79, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, + 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, + 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x85, 0x01, 0x0a, 0x0b, 0x43, + 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, + 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, + 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1e, 0x0a, 0x09, 0x63, 0x6c, 0x65, 0x61, 0x72, 0x74, + 0x65, 0x78, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x09, 0x63, 0x6c, 0x65, + 0x61, 0x72, 0x74, 0x65, 0x78, 0x74, 0x12, 0x2e, 0x0a, 0x06, 0x68, 0x61, 0x73, 0x68, 0x65, 0x64, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x74, 0x79, + 0x70, 0x65, 0x73, 0x2e, 0x48, 0x61, 0x73, 0x68, 0x54, 0x79, 0x70, 0x65, 0x48, 0x00, 0x52, 0x06, + 0x68, 0x61, 0x73, 0x68, 0x65, 0x64, 0x42, 0x0a, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, + 0x72, 0x64, 0x2a, 0x31, 0x0a, 0x0a, 0x4c, 0x33, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, + 0x12, 0x0f, 0x0a, 0x0b, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, + 0x00, 0x12, 0x08, 0x0a, 0x04, 0x49, 0x50, 0x56, 0x34, 0x10, 0x01, 0x12, 0x08, 0x0a, 0x04, 0x49, + 0x50, 0x56, 0x36, 0x10, 0x02, 0x3a, 0x40, 0x0a, 0x0c, 0x67, 0x6e, 0x6f, 0x69, 0x5f, 0x76, 0x65, + 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x4f, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x18, 0xea, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x67, 0x6e, 0x6f, 0x69, + 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x42, 0x22, 0x5a, 0x20, 0x67, 0x69, 0x74, 0x68, 0x75, + 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, + 0x2f, 0x67, 0x6e, 0x6f, 0x69, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x33, +} + +var ( + file_github_com_openconfig_gnoi_types_types_proto_rawDescOnce sync.Once + file_github_com_openconfig_gnoi_types_types_proto_rawDescData = file_github_com_openconfig_gnoi_types_types_proto_rawDesc +) + +func file_github_com_openconfig_gnoi_types_types_proto_rawDescGZIP() []byte { + file_github_com_openconfig_gnoi_types_types_proto_rawDescOnce.Do(func() { + file_github_com_openconfig_gnoi_types_types_proto_rawDescData = protoimpl.X.CompressGZIP(file_github_com_openconfig_gnoi_types_types_proto_rawDescData) + }) + return file_github_com_openconfig_gnoi_types_types_proto_rawDescData +} + +var file_github_com_openconfig_gnoi_types_types_proto_enumTypes = make([]protoimpl.EnumInfo, 2) +var file_github_com_openconfig_gnoi_types_types_proto_msgTypes = make([]protoimpl.MessageInfo, 5) +var file_github_com_openconfig_gnoi_types_types_proto_goTypes = []interface{}{ + (L3Protocol)(0), // 0: gnoi.types.L3Protocol + (HashType_HashMethod)(0), // 1: gnoi.types.HashType.HashMethod + (*HashType)(nil), // 2: gnoi.types.HashType + (*Path)(nil), // 3: gnoi.types.Path + (*PathElem)(nil), // 4: gnoi.types.PathElem + (*Credentials)(nil), // 5: gnoi.types.Credentials + nil, // 6: gnoi.types.PathElem.KeyEntry + (*descriptorpb.FileOptions)(nil), // 7: google.protobuf.FileOptions +} +var file_github_com_openconfig_gnoi_types_types_proto_depIdxs = []int32{ + 1, // 0: gnoi.types.HashType.method:type_name -> gnoi.types.HashType.HashMethod + 4, // 1: gnoi.types.Path.elem:type_name -> gnoi.types.PathElem + 6, // 2: gnoi.types.PathElem.key:type_name -> gnoi.types.PathElem.KeyEntry + 2, // 3: gnoi.types.Credentials.hashed:type_name -> gnoi.types.HashType + 7, // 4: gnoi.types.gnoi_version:extendee -> google.protobuf.FileOptions + 5, // [5:5] is the sub-list for method output_type + 5, // [5:5] is the sub-list for method input_type + 5, // [5:5] is the sub-list for extension type_name + 4, // [4:5] is the sub-list for extension extendee + 0, // [0:4] is the sub-list for field type_name +} + +func init() { file_github_com_openconfig_gnoi_types_types_proto_init() } +func file_github_com_openconfig_gnoi_types_types_proto_init() { + if File_github_com_openconfig_gnoi_types_types_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_github_com_openconfig_gnoi_types_types_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*HashType); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_github_com_openconfig_gnoi_types_types_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Path); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_github_com_openconfig_gnoi_types_types_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PathElem); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_github_com_openconfig_gnoi_types_types_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Credentials); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_github_com_openconfig_gnoi_types_types_proto_msgTypes[3].OneofWrappers = []interface{}{ + (*Credentials_Cleartext)(nil), + (*Credentials_Hashed)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_github_com_openconfig_gnoi_types_types_proto_rawDesc, + NumEnums: 2, + NumMessages: 5, + NumExtensions: 1, + NumServices: 0, + }, + GoTypes: file_github_com_openconfig_gnoi_types_types_proto_goTypes, + DependencyIndexes: file_github_com_openconfig_gnoi_types_types_proto_depIdxs, + EnumInfos: file_github_com_openconfig_gnoi_types_types_proto_enumTypes, + MessageInfos: file_github_com_openconfig_gnoi_types_types_proto_msgTypes, + ExtensionInfos: file_github_com_openconfig_gnoi_types_types_proto_extTypes, + }.Build() + File_github_com_openconfig_gnoi_types_types_proto = out.File + file_github_com_openconfig_gnoi_types_types_proto_rawDesc = nil + file_github_com_openconfig_gnoi_types_types_proto_goTypes = nil + file_github_com_openconfig_gnoi_types_types_proto_depIdxs = nil +} diff --git a/src/sonic-framework/gnoi/types/types.proto b/src/sonic-framework/gnoi/types/types.proto new file mode 100644 index 000000000000..4926d3389944 --- /dev/null +++ b/src/sonic-framework/gnoi/types/types.proto @@ -0,0 +1,77 @@ +// +// Copyright 2017 Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +syntax = "proto3"; + +package gnoi.types; + +import "google/protobuf/descriptor.proto"; + +option go_package = "github.com/openconfig/gnoi/types"; + +// Define a protobuf FileOption that defines the gNOI service version. +extend google.protobuf.FileOptions { + // The gNOI service semantic version. + string gnoi_version = 1002; +} + +// Generic Layer 3 Protocol enumeration. +enum L3Protocol { + UNSPECIFIED = 0; + IPV4 = 1; + IPV6 = 2; +} + +// HashType defines the valid hash methods for data verification. UNSPECIFIED +// should be treated an error. +message HashType { + enum HashMethod { + UNSPECIFIED = 0; + SHA256 = 1; + SHA512 = 2; + MD5 = 3; + } + HashMethod method = 1; + // hash is the raw byte string returned by the hash function. + // It is not an hex encoded string or other representation. + bytes hash = 2; +} + +// Path encodes a data tree path as a series of repeated strings, with +// each element of the path representing a data tree node name and the +// associated attributes. +// Reference: gNMI Specification Section 2.2.2. +message Path { + string origin = 2; // Label to disambiguate path. + repeated PathElem elem = 3; // Elements of the path. +} + +// PathElem encodes an element of a gNMI path, along with any attributes (keys) +// that may be associated with it. +// Reference: gNMI Specification Section 2.2.2. +message PathElem { + string name = 1; // The name of the element in the path. + map key = 2; // Map of key (attribute) name to value. +} + +// Credentials defines credentials needed to perform authentication on a device. +message Credentials { + string username = 1; + oneof password { + string cleartext = 2; + HashType hashed = 3; + } +} diff --git a/src/sonic-framework/gnoi/wavelength_router/BUILD.bazel b/src/sonic-framework/gnoi/wavelength_router/BUILD.bazel new file mode 100644 index 000000000000..da6b62a6dd2e --- /dev/null +++ b/src/sonic-framework/gnoi/wavelength_router/BUILD.bazel @@ -0,0 +1,61 @@ +load("@rules_proto//proto:defs.bzl", "proto_library") +load("@io_bazel_rules_go//go:def.bzl", "go_library") +load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library") +load("@com_github_grpc_grpc//bazel:cc_grpc_library.bzl", "cc_grpc_library") +load("//:common.bzl", "use_new_compilers") + +#Copyright 2021 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +package( + default_visibility = ["//visibility:public"], + licenses = ["notice"], +) + +use_new_compilers() + +proto_library( + name = "wavelength_router_proto", + srcs = ["wavelength_router.proto"], + deps = ["//types:types_proto"], +) + +cc_proto_library( + name = "wavelength_router_cc_proto", + deps = [":wavelength_router_proto"], +) + +cc_grpc_library( + name = "wavelength_router_cc_grpc_proto", + srcs = [":wavelength_router_proto"], + grpc_only = True, + deps = [":wavelength_router_cc_proto"], +) + +go_proto_library( + name = "wavelength_router_go_proto", + compilers = [ + "go_protoc_gen_go", + "go_protoc_gen_go_grpc", + ], + importpath = "github.com/openconfig/gnoi/wavelength_router", + proto = ":wavelength_router_proto", + deps = ["//types"], +) + +go_library( + name = "wavelength_router", + embed = [":wavelength_router_go_proto"], + importpath = "github.com/openconfig/gnoi/wavelength_router", +) diff --git a/src/sonic-framework/gnoi/wavelength_router/wavelength_router.pb.go b/src/sonic-framework/gnoi/wavelength_router/wavelength_router.pb.go new file mode 100644 index 000000000000..6121d84f7f6f --- /dev/null +++ b/src/sonic-framework/gnoi/wavelength_router/wavelength_router.pb.go @@ -0,0 +1,1223 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.30.0 +// protoc v3.21.10 +// source: wavelength_router/wavelength_router.proto + +package wavelength_router + +import ( + types "github.com/openconfig/gnoi/types" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type AdjustPSDRequest_SignalDirection int32 + +const ( + AdjustPSDRequest_DIRECTION_UNKNOWN AdjustPSDRequest_SignalDirection = 0 + AdjustPSDRequest_DIRECTION_INPUT AdjustPSDRequest_SignalDirection = 1 + AdjustPSDRequest_DIRECTION_OUTPUT AdjustPSDRequest_SignalDirection = 2 +) + +// Enum value maps for AdjustPSDRequest_SignalDirection. +var ( + AdjustPSDRequest_SignalDirection_name = map[int32]string{ + 0: "DIRECTION_UNKNOWN", + 1: "DIRECTION_INPUT", + 2: "DIRECTION_OUTPUT", + } + AdjustPSDRequest_SignalDirection_value = map[string]int32{ + "DIRECTION_UNKNOWN": 0, + "DIRECTION_INPUT": 1, + "DIRECTION_OUTPUT": 2, + } +) + +func (x AdjustPSDRequest_SignalDirection) Enum() *AdjustPSDRequest_SignalDirection { + p := new(AdjustPSDRequest_SignalDirection) + *p = x + return p +} + +func (x AdjustPSDRequest_SignalDirection) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (AdjustPSDRequest_SignalDirection) Descriptor() protoreflect.EnumDescriptor { + return file_wavelength_router_wavelength_router_proto_enumTypes[0].Descriptor() +} + +func (AdjustPSDRequest_SignalDirection) Type() protoreflect.EnumType { + return &file_wavelength_router_wavelength_router_proto_enumTypes[0] +} + +func (x AdjustPSDRequest_SignalDirection) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use AdjustPSDRequest_SignalDirection.Descriptor instead. +func (AdjustPSDRequest_SignalDirection) EnumDescriptor() ([]byte, []int) { + return file_wavelength_router_wavelength_router_proto_rawDescGZIP(), []int{0, 0} +} + +type AdjustPSDProgress_State int32 + +const ( + AdjustPSDProgress_UNKNOWN AdjustPSDProgress_State = 0 + AdjustPSDProgress_RUNNING AdjustPSDProgress_State = 1 + AdjustPSDProgress_COMPLETE AdjustPSDProgress_State = 2 +) + +// Enum value maps for AdjustPSDProgress_State. +var ( + AdjustPSDProgress_State_name = map[int32]string{ + 0: "UNKNOWN", + 1: "RUNNING", + 2: "COMPLETE", + } + AdjustPSDProgress_State_value = map[string]int32{ + "UNKNOWN": 0, + "RUNNING": 1, + "COMPLETE": 2, + } +) + +func (x AdjustPSDProgress_State) Enum() *AdjustPSDProgress_State { + p := new(AdjustPSDProgress_State) + *p = x + return p +} + +func (x AdjustPSDProgress_State) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (AdjustPSDProgress_State) Descriptor() protoreflect.EnumDescriptor { + return file_wavelength_router_wavelength_router_proto_enumTypes[1].Descriptor() +} + +func (AdjustPSDProgress_State) Type() protoreflect.EnumType { + return &file_wavelength_router_wavelength_router_proto_enumTypes[1] +} + +func (x AdjustPSDProgress_State) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use AdjustPSDProgress_State.Descriptor instead. +func (AdjustPSDProgress_State) EnumDescriptor() ([]byte, []int) { + return file_wavelength_router_wavelength_router_proto_rawDescGZIP(), []int{1, 0} +} + +type AdjustPSDError_Type int32 + +const ( + AdjustPSDError_UNSPECIFIED AdjustPSDError_Type = 0 + AdjustPSDError_PORT_BUSY AdjustPSDError_Type = 1 + AdjustPSDError_HARDWARE_FAILURE AdjustPSDError_Type = 2 +) + +// Enum value maps for AdjustPSDError_Type. +var ( + AdjustPSDError_Type_name = map[int32]string{ + 0: "UNSPECIFIED", + 1: "PORT_BUSY", + 2: "HARDWARE_FAILURE", + } + AdjustPSDError_Type_value = map[string]int32{ + "UNSPECIFIED": 0, + "PORT_BUSY": 1, + "HARDWARE_FAILURE": 2, + } +) + +func (x AdjustPSDError_Type) Enum() *AdjustPSDError_Type { + p := new(AdjustPSDError_Type) + *p = x + return p +} + +func (x AdjustPSDError_Type) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (AdjustPSDError_Type) Descriptor() protoreflect.EnumDescriptor { + return file_wavelength_router_wavelength_router_proto_enumTypes[2].Descriptor() +} + +func (AdjustPSDError_Type) Type() protoreflect.EnumType { + return &file_wavelength_router_wavelength_router_proto_enumTypes[2] +} + +func (x AdjustPSDError_Type) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use AdjustPSDError_Type.Descriptor instead. +func (AdjustPSDError_Type) EnumDescriptor() ([]byte, []int) { + return file_wavelength_router_wavelength_router_proto_rawDescGZIP(), []int{2, 0} +} + +type AdjustSpectrumRequest_SignalDirection int32 + +const ( + AdjustSpectrumRequest_DIRECTION_UNKNOWN AdjustSpectrumRequest_SignalDirection = 0 + AdjustSpectrumRequest_DIRECTION_INPUT AdjustSpectrumRequest_SignalDirection = 1 + AdjustSpectrumRequest_DIRECTION_OUTPUT AdjustSpectrumRequest_SignalDirection = 2 +) + +// Enum value maps for AdjustSpectrumRequest_SignalDirection. +var ( + AdjustSpectrumRequest_SignalDirection_name = map[int32]string{ + 0: "DIRECTION_UNKNOWN", + 1: "DIRECTION_INPUT", + 2: "DIRECTION_OUTPUT", + } + AdjustSpectrumRequest_SignalDirection_value = map[string]int32{ + "DIRECTION_UNKNOWN": 0, + "DIRECTION_INPUT": 1, + "DIRECTION_OUTPUT": 2, + } +) + +func (x AdjustSpectrumRequest_SignalDirection) Enum() *AdjustSpectrumRequest_SignalDirection { + p := new(AdjustSpectrumRequest_SignalDirection) + *p = x + return p +} + +func (x AdjustSpectrumRequest_SignalDirection) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (AdjustSpectrumRequest_SignalDirection) Descriptor() protoreflect.EnumDescriptor { + return file_wavelength_router_wavelength_router_proto_enumTypes[3].Descriptor() +} + +func (AdjustSpectrumRequest_SignalDirection) Type() protoreflect.EnumType { + return &file_wavelength_router_wavelength_router_proto_enumTypes[3] +} + +func (x AdjustSpectrumRequest_SignalDirection) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use AdjustSpectrumRequest_SignalDirection.Descriptor instead. +func (AdjustSpectrumRequest_SignalDirection) EnumDescriptor() ([]byte, []int) { + return file_wavelength_router_wavelength_router_proto_rawDescGZIP(), []int{5, 0} +} + +type AdjustSpectrumProgress_State int32 + +const ( + AdjustSpectrumProgress_UNKNOWN AdjustSpectrumProgress_State = 0 + AdjustSpectrumProgress_RUNNING AdjustSpectrumProgress_State = 1 + AdjustSpectrumProgress_COMPLETE AdjustSpectrumProgress_State = 2 +) + +// Enum value maps for AdjustSpectrumProgress_State. +var ( + AdjustSpectrumProgress_State_name = map[int32]string{ + 0: "UNKNOWN", + 1: "RUNNING", + 2: "COMPLETE", + } + AdjustSpectrumProgress_State_value = map[string]int32{ + "UNKNOWN": 0, + "RUNNING": 1, + "COMPLETE": 2, + } +) + +func (x AdjustSpectrumProgress_State) Enum() *AdjustSpectrumProgress_State { + p := new(AdjustSpectrumProgress_State) + *p = x + return p +} + +func (x AdjustSpectrumProgress_State) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (AdjustSpectrumProgress_State) Descriptor() protoreflect.EnumDescriptor { + return file_wavelength_router_wavelength_router_proto_enumTypes[4].Descriptor() +} + +func (AdjustSpectrumProgress_State) Type() protoreflect.EnumType { + return &file_wavelength_router_wavelength_router_proto_enumTypes[4] +} + +func (x AdjustSpectrumProgress_State) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use AdjustSpectrumProgress_State.Descriptor instead. +func (AdjustSpectrumProgress_State) EnumDescriptor() ([]byte, []int) { + return file_wavelength_router_wavelength_router_proto_rawDescGZIP(), []int{6, 0} +} + +type AdjustSpectrumError_Type int32 + +const ( + AdjustSpectrumError_UNSPECIFIED AdjustSpectrumError_Type = 0 + AdjustSpectrumError_PORT_BUSY AdjustSpectrumError_Type = 1 + AdjustSpectrumError_HARDWARE_FAILURE AdjustSpectrumError_Type = 2 +) + +// Enum value maps for AdjustSpectrumError_Type. +var ( + AdjustSpectrumError_Type_name = map[int32]string{ + 0: "UNSPECIFIED", + 1: "PORT_BUSY", + 2: "HARDWARE_FAILURE", + } + AdjustSpectrumError_Type_value = map[string]int32{ + "UNSPECIFIED": 0, + "PORT_BUSY": 1, + "HARDWARE_FAILURE": 2, + } +) + +func (x AdjustSpectrumError_Type) Enum() *AdjustSpectrumError_Type { + p := new(AdjustSpectrumError_Type) + *p = x + return p +} + +func (x AdjustSpectrumError_Type) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (AdjustSpectrumError_Type) Descriptor() protoreflect.EnumDescriptor { + return file_wavelength_router_wavelength_router_proto_enumTypes[5].Descriptor() +} + +func (AdjustSpectrumError_Type) Type() protoreflect.EnumType { + return &file_wavelength_router_wavelength_router_proto_enumTypes[5] +} + +func (x AdjustSpectrumError_Type) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use AdjustSpectrumError_Type.Descriptor instead. +func (AdjustSpectrumError_Type) EnumDescriptor() ([]byte, []int) { + return file_wavelength_router_wavelength_router_proto_rawDescGZIP(), []int{7, 0} +} + +// Deprecated: Marked as deprecated in wavelength_router/wavelength_router.proto. +type AdjustPSDRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Component *types.Path `protobuf:"bytes,1,opt,name=component,proto3" json:"component,omitempty"` + Direction AdjustPSDRequest_SignalDirection `protobuf:"varint,2,opt,name=direction,proto3,enum=gnoi.optical.AdjustPSDRequest_SignalDirection" json:"direction,omitempty"` +} + +func (x *AdjustPSDRequest) Reset() { + *x = AdjustPSDRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_wavelength_router_wavelength_router_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AdjustPSDRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AdjustPSDRequest) ProtoMessage() {} + +func (x *AdjustPSDRequest) ProtoReflect() protoreflect.Message { + mi := &file_wavelength_router_wavelength_router_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AdjustPSDRequest.ProtoReflect.Descriptor instead. +func (*AdjustPSDRequest) Descriptor() ([]byte, []int) { + return file_wavelength_router_wavelength_router_proto_rawDescGZIP(), []int{0} +} + +func (x *AdjustPSDRequest) GetComponent() *types.Path { + if x != nil { + return x.Component + } + return nil +} + +func (x *AdjustPSDRequest) GetDirection() AdjustPSDRequest_SignalDirection { + if x != nil { + return x.Direction + } + return AdjustPSDRequest_DIRECTION_UNKNOWN +} + +// Deprecated: Marked as deprecated in wavelength_router/wavelength_router.proto. +type AdjustPSDProgress struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + State AdjustPSDProgress_State `protobuf:"varint,1,opt,name=state,proto3,enum=gnoi.optical.AdjustPSDProgress_State" json:"state,omitempty"` +} + +func (x *AdjustPSDProgress) Reset() { + *x = AdjustPSDProgress{} + if protoimpl.UnsafeEnabled { + mi := &file_wavelength_router_wavelength_router_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AdjustPSDProgress) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AdjustPSDProgress) ProtoMessage() {} + +func (x *AdjustPSDProgress) ProtoReflect() protoreflect.Message { + mi := &file_wavelength_router_wavelength_router_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AdjustPSDProgress.ProtoReflect.Descriptor instead. +func (*AdjustPSDProgress) Descriptor() ([]byte, []int) { + return file_wavelength_router_wavelength_router_proto_rawDescGZIP(), []int{1} +} + +func (x *AdjustPSDProgress) GetState() AdjustPSDProgress_State { + if x != nil { + return x.State + } + return AdjustPSDProgress_UNKNOWN +} + +// Deprecated: Marked as deprecated in wavelength_router/wavelength_router.proto. +type AdjustPSDError struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Type AdjustPSDError_Type `protobuf:"varint,1,opt,name=type,proto3,enum=gnoi.optical.AdjustPSDError_Type" json:"type,omitempty"` + Detail string `protobuf:"bytes,2,opt,name=detail,proto3" json:"detail,omitempty"` +} + +func (x *AdjustPSDError) Reset() { + *x = AdjustPSDError{} + if protoimpl.UnsafeEnabled { + mi := &file_wavelength_router_wavelength_router_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AdjustPSDError) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AdjustPSDError) ProtoMessage() {} + +func (x *AdjustPSDError) ProtoReflect() protoreflect.Message { + mi := &file_wavelength_router_wavelength_router_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AdjustPSDError.ProtoReflect.Descriptor instead. +func (*AdjustPSDError) Descriptor() ([]byte, []int) { + return file_wavelength_router_wavelength_router_proto_rawDescGZIP(), []int{2} +} + +func (x *AdjustPSDError) GetType() AdjustPSDError_Type { + if x != nil { + return x.Type + } + return AdjustPSDError_UNSPECIFIED +} + +func (x *AdjustPSDError) GetDetail() string { + if x != nil { + return x.Detail + } + return "" +} + +// Deprecated: Marked as deprecated in wavelength_router/wavelength_router.proto. +type AdjustPSDResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Response: + // + // *AdjustPSDResponse_Progress + // *AdjustPSDResponse_Error + Response isAdjustPSDResponse_Response `protobuf_oneof:"response"` +} + +func (x *AdjustPSDResponse) Reset() { + *x = AdjustPSDResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_wavelength_router_wavelength_router_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AdjustPSDResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AdjustPSDResponse) ProtoMessage() {} + +func (x *AdjustPSDResponse) ProtoReflect() protoreflect.Message { + mi := &file_wavelength_router_wavelength_router_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AdjustPSDResponse.ProtoReflect.Descriptor instead. +func (*AdjustPSDResponse) Descriptor() ([]byte, []int) { + return file_wavelength_router_wavelength_router_proto_rawDescGZIP(), []int{3} +} + +func (m *AdjustPSDResponse) GetResponse() isAdjustPSDResponse_Response { + if m != nil { + return m.Response + } + return nil +} + +func (x *AdjustPSDResponse) GetProgress() *AdjustPSDProgress { + if x, ok := x.GetResponse().(*AdjustPSDResponse_Progress); ok { + return x.Progress + } + return nil +} + +func (x *AdjustPSDResponse) GetError() *AdjustPSDError { + if x, ok := x.GetResponse().(*AdjustPSDResponse_Error); ok { + return x.Error + } + return nil +} + +type isAdjustPSDResponse_Response interface { + isAdjustPSDResponse_Response() +} + +type AdjustPSDResponse_Progress struct { + Progress *AdjustPSDProgress `protobuf:"bytes,1,opt,name=progress,proto3,oneof"` +} + +type AdjustPSDResponse_Error struct { + Error *AdjustPSDError `protobuf:"bytes,2,opt,name=error,proto3,oneof"` +} + +func (*AdjustPSDResponse_Progress) isAdjustPSDResponse_Response() {} + +func (*AdjustPSDResponse_Error) isAdjustPSDResponse_Response() {} + +// Deprecated: Marked as deprecated in wavelength_router/wavelength_router.proto. +type CancelAdjustPSDResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *CancelAdjustPSDResponse) Reset() { + *x = CancelAdjustPSDResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_wavelength_router_wavelength_router_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CancelAdjustPSDResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CancelAdjustPSDResponse) ProtoMessage() {} + +func (x *CancelAdjustPSDResponse) ProtoReflect() protoreflect.Message { + mi := &file_wavelength_router_wavelength_router_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CancelAdjustPSDResponse.ProtoReflect.Descriptor instead. +func (*CancelAdjustPSDResponse) Descriptor() ([]byte, []int) { + return file_wavelength_router_wavelength_router_proto_rawDescGZIP(), []int{4} +} + +type AdjustSpectrumRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Component *types.Path `protobuf:"bytes,1,opt,name=component,proto3" json:"component,omitempty"` + Direction AdjustSpectrumRequest_SignalDirection `protobuf:"varint,2,opt,name=direction,proto3,enum=gnoi.optical.AdjustSpectrumRequest_SignalDirection" json:"direction,omitempty"` +} + +func (x *AdjustSpectrumRequest) Reset() { + *x = AdjustSpectrumRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_wavelength_router_wavelength_router_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AdjustSpectrumRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AdjustSpectrumRequest) ProtoMessage() {} + +func (x *AdjustSpectrumRequest) ProtoReflect() protoreflect.Message { + mi := &file_wavelength_router_wavelength_router_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AdjustSpectrumRequest.ProtoReflect.Descriptor instead. +func (*AdjustSpectrumRequest) Descriptor() ([]byte, []int) { + return file_wavelength_router_wavelength_router_proto_rawDescGZIP(), []int{5} +} + +func (x *AdjustSpectrumRequest) GetComponent() *types.Path { + if x != nil { + return x.Component + } + return nil +} + +func (x *AdjustSpectrumRequest) GetDirection() AdjustSpectrumRequest_SignalDirection { + if x != nil { + return x.Direction + } + return AdjustSpectrumRequest_DIRECTION_UNKNOWN +} + +type AdjustSpectrumProgress struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + State AdjustSpectrumProgress_State `protobuf:"varint,1,opt,name=state,proto3,enum=gnoi.optical.AdjustSpectrumProgress_State" json:"state,omitempty"` +} + +func (x *AdjustSpectrumProgress) Reset() { + *x = AdjustSpectrumProgress{} + if protoimpl.UnsafeEnabled { + mi := &file_wavelength_router_wavelength_router_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AdjustSpectrumProgress) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AdjustSpectrumProgress) ProtoMessage() {} + +func (x *AdjustSpectrumProgress) ProtoReflect() protoreflect.Message { + mi := &file_wavelength_router_wavelength_router_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AdjustSpectrumProgress.ProtoReflect.Descriptor instead. +func (*AdjustSpectrumProgress) Descriptor() ([]byte, []int) { + return file_wavelength_router_wavelength_router_proto_rawDescGZIP(), []int{6} +} + +func (x *AdjustSpectrumProgress) GetState() AdjustSpectrumProgress_State { + if x != nil { + return x.State + } + return AdjustSpectrumProgress_UNKNOWN +} + +type AdjustSpectrumError struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Type AdjustSpectrumError_Type `protobuf:"varint,1,opt,name=type,proto3,enum=gnoi.optical.AdjustSpectrumError_Type" json:"type,omitempty"` + Detail string `protobuf:"bytes,2,opt,name=detail,proto3" json:"detail,omitempty"` +} + +func (x *AdjustSpectrumError) Reset() { + *x = AdjustSpectrumError{} + if protoimpl.UnsafeEnabled { + mi := &file_wavelength_router_wavelength_router_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AdjustSpectrumError) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AdjustSpectrumError) ProtoMessage() {} + +func (x *AdjustSpectrumError) ProtoReflect() protoreflect.Message { + mi := &file_wavelength_router_wavelength_router_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AdjustSpectrumError.ProtoReflect.Descriptor instead. +func (*AdjustSpectrumError) Descriptor() ([]byte, []int) { + return file_wavelength_router_wavelength_router_proto_rawDescGZIP(), []int{7} +} + +func (x *AdjustSpectrumError) GetType() AdjustSpectrumError_Type { + if x != nil { + return x.Type + } + return AdjustSpectrumError_UNSPECIFIED +} + +func (x *AdjustSpectrumError) GetDetail() string { + if x != nil { + return x.Detail + } + return "" +} + +type AdjustSpectrumResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Response: + // + // *AdjustSpectrumResponse_Progress + // *AdjustSpectrumResponse_Error + Response isAdjustSpectrumResponse_Response `protobuf_oneof:"response"` +} + +func (x *AdjustSpectrumResponse) Reset() { + *x = AdjustSpectrumResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_wavelength_router_wavelength_router_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AdjustSpectrumResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AdjustSpectrumResponse) ProtoMessage() {} + +func (x *AdjustSpectrumResponse) ProtoReflect() protoreflect.Message { + mi := &file_wavelength_router_wavelength_router_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AdjustSpectrumResponse.ProtoReflect.Descriptor instead. +func (*AdjustSpectrumResponse) Descriptor() ([]byte, []int) { + return file_wavelength_router_wavelength_router_proto_rawDescGZIP(), []int{8} +} + +func (m *AdjustSpectrumResponse) GetResponse() isAdjustSpectrumResponse_Response { + if m != nil { + return m.Response + } + return nil +} + +func (x *AdjustSpectrumResponse) GetProgress() *AdjustSpectrumProgress { + if x, ok := x.GetResponse().(*AdjustSpectrumResponse_Progress); ok { + return x.Progress + } + return nil +} + +func (x *AdjustSpectrumResponse) GetError() *AdjustSpectrumError { + if x, ok := x.GetResponse().(*AdjustSpectrumResponse_Error); ok { + return x.Error + } + return nil +} + +type isAdjustSpectrumResponse_Response interface { + isAdjustSpectrumResponse_Response() +} + +type AdjustSpectrumResponse_Progress struct { + Progress *AdjustSpectrumProgress `protobuf:"bytes,1,opt,name=progress,proto3,oneof"` +} + +type AdjustSpectrumResponse_Error struct { + Error *AdjustSpectrumError `protobuf:"bytes,2,opt,name=error,proto3,oneof"` +} + +func (*AdjustSpectrumResponse_Progress) isAdjustSpectrumResponse_Response() {} + +func (*AdjustSpectrumResponse_Error) isAdjustSpectrumResponse_Response() {} + +type CancelAdjustSpectrumResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *CancelAdjustSpectrumResponse) Reset() { + *x = CancelAdjustSpectrumResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_wavelength_router_wavelength_router_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CancelAdjustSpectrumResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CancelAdjustSpectrumResponse) ProtoMessage() {} + +func (x *CancelAdjustSpectrumResponse) ProtoReflect() protoreflect.Message { + mi := &file_wavelength_router_wavelength_router_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CancelAdjustSpectrumResponse.ProtoReflect.Descriptor instead. +func (*CancelAdjustSpectrumResponse) Descriptor() ([]byte, []int) { + return file_wavelength_router_wavelength_router_proto_rawDescGZIP(), []int{9} +} + +var File_wavelength_router_wavelength_router_proto protoreflect.FileDescriptor + +var file_wavelength_router_wavelength_router_proto_rawDesc = []byte{ + 0x0a, 0x29, 0x77, 0x61, 0x76, 0x65, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x5f, 0x72, 0x6f, 0x75, + 0x74, 0x65, 0x72, 0x2f, 0x77, 0x61, 0x76, 0x65, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x5f, 0x72, + 0x6f, 0x75, 0x74, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0c, 0x67, 0x6e, 0x6f, + 0x69, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x63, 0x61, 0x6c, 0x1a, 0x2c, 0x67, 0x69, 0x74, 0x68, 0x75, + 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, + 0x2f, 0x67, 0x6e, 0x6f, 0x69, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x74, 0x79, 0x70, 0x65, + 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xe9, 0x01, 0x0a, 0x10, 0x41, 0x64, 0x6a, 0x75, + 0x73, 0x74, 0x50, 0x53, 0x44, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2e, 0x0a, 0x09, + 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x10, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x50, 0x61, 0x74, + 0x68, 0x52, 0x09, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x12, 0x4c, 0x0a, 0x09, + 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, + 0x2e, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x63, 0x61, 0x6c, 0x2e, 0x41, + 0x64, 0x6a, 0x75, 0x73, 0x74, 0x50, 0x53, 0x44, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, + 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x44, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, + 0x09, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x53, 0x0a, 0x0f, 0x53, 0x69, + 0x67, 0x6e, 0x61, 0x6c, 0x44, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x15, 0x0a, + 0x11, 0x44, 0x49, 0x52, 0x45, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, + 0x57, 0x4e, 0x10, 0x00, 0x12, 0x13, 0x0a, 0x0f, 0x44, 0x49, 0x52, 0x45, 0x43, 0x54, 0x49, 0x4f, + 0x4e, 0x5f, 0x49, 0x4e, 0x50, 0x55, 0x54, 0x10, 0x01, 0x12, 0x14, 0x0a, 0x10, 0x44, 0x49, 0x52, + 0x45, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x4f, 0x55, 0x54, 0x50, 0x55, 0x54, 0x10, 0x02, 0x3a, + 0x02, 0x18, 0x01, 0x22, 0x85, 0x01, 0x0a, 0x11, 0x41, 0x64, 0x6a, 0x75, 0x73, 0x74, 0x50, 0x53, + 0x44, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x12, 0x3b, 0x0a, 0x05, 0x73, 0x74, 0x61, + 0x74, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x25, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, + 0x6f, 0x70, 0x74, 0x69, 0x63, 0x61, 0x6c, 0x2e, 0x41, 0x64, 0x6a, 0x75, 0x73, 0x74, 0x50, 0x53, + 0x44, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, + 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x22, 0x2f, 0x0a, 0x05, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, + 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, + 0x52, 0x55, 0x4e, 0x4e, 0x49, 0x4e, 0x47, 0x10, 0x01, 0x12, 0x0c, 0x0a, 0x08, 0x43, 0x4f, 0x4d, + 0x50, 0x4c, 0x45, 0x54, 0x45, 0x10, 0x02, 0x3a, 0x02, 0x18, 0x01, 0x22, 0xa1, 0x01, 0x0a, 0x0e, + 0x41, 0x64, 0x6a, 0x75, 0x73, 0x74, 0x50, 0x53, 0x44, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x35, + 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x21, 0x2e, 0x67, + 0x6e, 0x6f, 0x69, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x63, 0x61, 0x6c, 0x2e, 0x41, 0x64, 0x6a, 0x75, + 0x73, 0x74, 0x50, 0x53, 0x44, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, + 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x22, 0x3c, 0x0a, + 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0f, 0x0a, 0x0b, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, + 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0d, 0x0a, 0x09, 0x50, 0x4f, 0x52, 0x54, 0x5f, 0x42, + 0x55, 0x53, 0x59, 0x10, 0x01, 0x12, 0x14, 0x0a, 0x10, 0x48, 0x41, 0x52, 0x44, 0x57, 0x41, 0x52, + 0x45, 0x5f, 0x46, 0x41, 0x49, 0x4c, 0x55, 0x52, 0x45, 0x10, 0x02, 0x3a, 0x02, 0x18, 0x01, 0x22, + 0x98, 0x01, 0x0a, 0x11, 0x41, 0x64, 0x6a, 0x75, 0x73, 0x74, 0x50, 0x53, 0x44, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3d, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, + 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x6f, + 0x70, 0x74, 0x69, 0x63, 0x61, 0x6c, 0x2e, 0x41, 0x64, 0x6a, 0x75, 0x73, 0x74, 0x50, 0x53, 0x44, + 0x50, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x48, 0x00, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x67, + 0x72, 0x65, 0x73, 0x73, 0x12, 0x34, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x63, + 0x61, 0x6c, 0x2e, 0x41, 0x64, 0x6a, 0x75, 0x73, 0x74, 0x50, 0x53, 0x44, 0x45, 0x72, 0x72, 0x6f, + 0x72, 0x48, 0x00, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x3a, 0x02, 0x18, 0x01, 0x42, 0x0a, + 0x0a, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1d, 0x0a, 0x17, 0x43, 0x61, + 0x6e, 0x63, 0x65, 0x6c, 0x41, 0x64, 0x6a, 0x75, 0x73, 0x74, 0x50, 0x53, 0x44, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x3a, 0x02, 0x18, 0x01, 0x22, 0xef, 0x01, 0x0a, 0x15, 0x41, 0x64, + 0x6a, 0x75, 0x73, 0x74, 0x53, 0x70, 0x65, 0x63, 0x74, 0x72, 0x75, 0x6d, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x2e, 0x0a, 0x09, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x74, 0x79, + 0x70, 0x65, 0x73, 0x2e, 0x50, 0x61, 0x74, 0x68, 0x52, 0x09, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, + 0x65, 0x6e, 0x74, 0x12, 0x51, 0x0a, 0x09, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x33, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x6f, 0x70, + 0x74, 0x69, 0x63, 0x61, 0x6c, 0x2e, 0x41, 0x64, 0x6a, 0x75, 0x73, 0x74, 0x53, 0x70, 0x65, 0x63, + 0x74, 0x72, 0x75, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x53, 0x69, 0x67, 0x6e, + 0x61, 0x6c, 0x44, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x09, 0x64, 0x69, 0x72, + 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x53, 0x0a, 0x0f, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c, + 0x44, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x15, 0x0a, 0x11, 0x44, 0x49, 0x52, + 0x45, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, + 0x12, 0x13, 0x0a, 0x0f, 0x44, 0x49, 0x52, 0x45, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x49, 0x4e, + 0x50, 0x55, 0x54, 0x10, 0x01, 0x12, 0x14, 0x0a, 0x10, 0x44, 0x49, 0x52, 0x45, 0x43, 0x54, 0x49, + 0x4f, 0x4e, 0x5f, 0x4f, 0x55, 0x54, 0x50, 0x55, 0x54, 0x10, 0x02, 0x22, 0x8b, 0x01, 0x0a, 0x16, + 0x41, 0x64, 0x6a, 0x75, 0x73, 0x74, 0x53, 0x70, 0x65, 0x63, 0x74, 0x72, 0x75, 0x6d, 0x50, 0x72, + 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x12, 0x40, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2a, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x6f, 0x70, 0x74, + 0x69, 0x63, 0x61, 0x6c, 0x2e, 0x41, 0x64, 0x6a, 0x75, 0x73, 0x74, 0x53, 0x70, 0x65, 0x63, 0x74, + 0x72, 0x75, 0x6d, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x2e, 0x53, 0x74, 0x61, 0x74, + 0x65, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x22, 0x2f, 0x0a, 0x05, 0x53, 0x74, 0x61, 0x74, + 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x0b, + 0x0a, 0x07, 0x52, 0x55, 0x4e, 0x4e, 0x49, 0x4e, 0x47, 0x10, 0x01, 0x12, 0x0c, 0x0a, 0x08, 0x43, + 0x4f, 0x4d, 0x50, 0x4c, 0x45, 0x54, 0x45, 0x10, 0x02, 0x22, 0xa7, 0x01, 0x0a, 0x13, 0x41, 0x64, + 0x6a, 0x75, 0x73, 0x74, 0x53, 0x70, 0x65, 0x63, 0x74, 0x72, 0x75, 0x6d, 0x45, 0x72, 0x72, 0x6f, + 0x72, 0x12, 0x3a, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, + 0x26, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x63, 0x61, 0x6c, 0x2e, 0x41, + 0x64, 0x6a, 0x75, 0x73, 0x74, 0x53, 0x70, 0x65, 0x63, 0x74, 0x72, 0x75, 0x6d, 0x45, 0x72, 0x72, + 0x6f, 0x72, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x16, 0x0a, + 0x06, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, + 0x65, 0x74, 0x61, 0x69, 0x6c, 0x22, 0x3c, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0f, 0x0a, + 0x0b, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0d, + 0x0a, 0x09, 0x50, 0x4f, 0x52, 0x54, 0x5f, 0x42, 0x55, 0x53, 0x59, 0x10, 0x01, 0x12, 0x14, 0x0a, + 0x10, 0x48, 0x41, 0x52, 0x44, 0x57, 0x41, 0x52, 0x45, 0x5f, 0x46, 0x41, 0x49, 0x4c, 0x55, 0x52, + 0x45, 0x10, 0x02, 0x22, 0xa3, 0x01, 0x0a, 0x16, 0x41, 0x64, 0x6a, 0x75, 0x73, 0x74, 0x53, 0x70, + 0x65, 0x63, 0x74, 0x72, 0x75, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x42, + 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x24, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x63, 0x61, 0x6c, 0x2e, + 0x41, 0x64, 0x6a, 0x75, 0x73, 0x74, 0x53, 0x70, 0x65, 0x63, 0x74, 0x72, 0x75, 0x6d, 0x50, 0x72, + 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x48, 0x00, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x65, + 0x73, 0x73, 0x12, 0x39, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x21, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x63, 0x61, 0x6c, + 0x2e, 0x41, 0x64, 0x6a, 0x75, 0x73, 0x74, 0x53, 0x70, 0x65, 0x63, 0x74, 0x72, 0x75, 0x6d, 0x45, + 0x72, 0x72, 0x6f, 0x72, 0x48, 0x00, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x42, 0x0a, 0x0a, + 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1e, 0x0a, 0x1c, 0x43, 0x61, 0x6e, + 0x63, 0x65, 0x6c, 0x41, 0x64, 0x6a, 0x75, 0x73, 0x74, 0x53, 0x70, 0x65, 0x63, 0x74, 0x72, 0x75, + 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0x92, 0x03, 0x0a, 0x10, 0x57, 0x61, + 0x76, 0x65, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x12, 0x53, + 0x0a, 0x09, 0x41, 0x64, 0x6a, 0x75, 0x73, 0x74, 0x50, 0x53, 0x44, 0x12, 0x1e, 0x2e, 0x67, 0x6e, + 0x6f, 0x69, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x63, 0x61, 0x6c, 0x2e, 0x41, 0x64, 0x6a, 0x75, 0x73, + 0x74, 0x50, 0x53, 0x44, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x67, 0x6e, + 0x6f, 0x69, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x63, 0x61, 0x6c, 0x2e, 0x41, 0x64, 0x6a, 0x75, 0x73, + 0x74, 0x50, 0x53, 0x44, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, 0x88, 0x02, + 0x01, 0x30, 0x01, 0x12, 0x5d, 0x0a, 0x0f, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x41, 0x64, 0x6a, + 0x75, 0x73, 0x74, 0x50, 0x53, 0x44, 0x12, 0x1e, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x6f, 0x70, + 0x74, 0x69, 0x63, 0x61, 0x6c, 0x2e, 0x41, 0x64, 0x6a, 0x75, 0x73, 0x74, 0x50, 0x53, 0x44, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x6f, 0x70, + 0x74, 0x69, 0x63, 0x61, 0x6c, 0x2e, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x41, 0x64, 0x6a, 0x75, + 0x73, 0x74, 0x50, 0x53, 0x44, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, 0x88, + 0x02, 0x01, 0x12, 0x5f, 0x0a, 0x0e, 0x41, 0x64, 0x6a, 0x75, 0x73, 0x74, 0x53, 0x70, 0x65, 0x63, + 0x74, 0x72, 0x75, 0x6d, 0x12, 0x23, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x6f, 0x70, 0x74, 0x69, + 0x63, 0x61, 0x6c, 0x2e, 0x41, 0x64, 0x6a, 0x75, 0x73, 0x74, 0x53, 0x70, 0x65, 0x63, 0x74, 0x72, + 0x75, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x67, 0x6e, 0x6f, 0x69, + 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x63, 0x61, 0x6c, 0x2e, 0x41, 0x64, 0x6a, 0x75, 0x73, 0x74, 0x53, + 0x70, 0x65, 0x63, 0x74, 0x72, 0x75, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x00, 0x30, 0x01, 0x12, 0x69, 0x0a, 0x14, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x41, 0x64, 0x6a, + 0x75, 0x73, 0x74, 0x53, 0x70, 0x65, 0x63, 0x74, 0x72, 0x75, 0x6d, 0x12, 0x23, 0x2e, 0x67, 0x6e, + 0x6f, 0x69, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x63, 0x61, 0x6c, 0x2e, 0x41, 0x64, 0x6a, 0x75, 0x73, + 0x74, 0x53, 0x70, 0x65, 0x63, 0x74, 0x72, 0x75, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x2a, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x63, 0x61, 0x6c, 0x2e, + 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x41, 0x64, 0x6a, 0x75, 0x73, 0x74, 0x53, 0x70, 0x65, 0x63, + 0x74, 0x72, 0x75, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x36, + 0xd2, 0x3e, 0x05, 0x30, 0x2e, 0x32, 0x2e, 0x30, 0x5a, 0x2c, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, + 0x67, 0x6e, 0x6f, 0x69, 0x2f, 0x77, 0x61, 0x76, 0x65, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x5f, + 0x72, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_wavelength_router_wavelength_router_proto_rawDescOnce sync.Once + file_wavelength_router_wavelength_router_proto_rawDescData = file_wavelength_router_wavelength_router_proto_rawDesc +) + +func file_wavelength_router_wavelength_router_proto_rawDescGZIP() []byte { + file_wavelength_router_wavelength_router_proto_rawDescOnce.Do(func() { + file_wavelength_router_wavelength_router_proto_rawDescData = protoimpl.X.CompressGZIP(file_wavelength_router_wavelength_router_proto_rawDescData) + }) + return file_wavelength_router_wavelength_router_proto_rawDescData +} + +var file_wavelength_router_wavelength_router_proto_enumTypes = make([]protoimpl.EnumInfo, 6) +var file_wavelength_router_wavelength_router_proto_msgTypes = make([]protoimpl.MessageInfo, 10) +var file_wavelength_router_wavelength_router_proto_goTypes = []interface{}{ + (AdjustPSDRequest_SignalDirection)(0), // 0: gnoi.optical.AdjustPSDRequest.SignalDirection + (AdjustPSDProgress_State)(0), // 1: gnoi.optical.AdjustPSDProgress.State + (AdjustPSDError_Type)(0), // 2: gnoi.optical.AdjustPSDError.Type + (AdjustSpectrumRequest_SignalDirection)(0), // 3: gnoi.optical.AdjustSpectrumRequest.SignalDirection + (AdjustSpectrumProgress_State)(0), // 4: gnoi.optical.AdjustSpectrumProgress.State + (AdjustSpectrumError_Type)(0), // 5: gnoi.optical.AdjustSpectrumError.Type + (*AdjustPSDRequest)(nil), // 6: gnoi.optical.AdjustPSDRequest + (*AdjustPSDProgress)(nil), // 7: gnoi.optical.AdjustPSDProgress + (*AdjustPSDError)(nil), // 8: gnoi.optical.AdjustPSDError + (*AdjustPSDResponse)(nil), // 9: gnoi.optical.AdjustPSDResponse + (*CancelAdjustPSDResponse)(nil), // 10: gnoi.optical.CancelAdjustPSDResponse + (*AdjustSpectrumRequest)(nil), // 11: gnoi.optical.AdjustSpectrumRequest + (*AdjustSpectrumProgress)(nil), // 12: gnoi.optical.AdjustSpectrumProgress + (*AdjustSpectrumError)(nil), // 13: gnoi.optical.AdjustSpectrumError + (*AdjustSpectrumResponse)(nil), // 14: gnoi.optical.AdjustSpectrumResponse + (*CancelAdjustSpectrumResponse)(nil), // 15: gnoi.optical.CancelAdjustSpectrumResponse + (*types.Path)(nil), // 16: gnoi.types.Path +} +var file_wavelength_router_wavelength_router_proto_depIdxs = []int32{ + 16, // 0: gnoi.optical.AdjustPSDRequest.component:type_name -> gnoi.types.Path + 0, // 1: gnoi.optical.AdjustPSDRequest.direction:type_name -> gnoi.optical.AdjustPSDRequest.SignalDirection + 1, // 2: gnoi.optical.AdjustPSDProgress.state:type_name -> gnoi.optical.AdjustPSDProgress.State + 2, // 3: gnoi.optical.AdjustPSDError.type:type_name -> gnoi.optical.AdjustPSDError.Type + 7, // 4: gnoi.optical.AdjustPSDResponse.progress:type_name -> gnoi.optical.AdjustPSDProgress + 8, // 5: gnoi.optical.AdjustPSDResponse.error:type_name -> gnoi.optical.AdjustPSDError + 16, // 6: gnoi.optical.AdjustSpectrumRequest.component:type_name -> gnoi.types.Path + 3, // 7: gnoi.optical.AdjustSpectrumRequest.direction:type_name -> gnoi.optical.AdjustSpectrumRequest.SignalDirection + 4, // 8: gnoi.optical.AdjustSpectrumProgress.state:type_name -> gnoi.optical.AdjustSpectrumProgress.State + 5, // 9: gnoi.optical.AdjustSpectrumError.type:type_name -> gnoi.optical.AdjustSpectrumError.Type + 12, // 10: gnoi.optical.AdjustSpectrumResponse.progress:type_name -> gnoi.optical.AdjustSpectrumProgress + 13, // 11: gnoi.optical.AdjustSpectrumResponse.error:type_name -> gnoi.optical.AdjustSpectrumError + 6, // 12: gnoi.optical.WavelengthRouter.AdjustPSD:input_type -> gnoi.optical.AdjustPSDRequest + 6, // 13: gnoi.optical.WavelengthRouter.CancelAdjustPSD:input_type -> gnoi.optical.AdjustPSDRequest + 11, // 14: gnoi.optical.WavelengthRouter.AdjustSpectrum:input_type -> gnoi.optical.AdjustSpectrumRequest + 11, // 15: gnoi.optical.WavelengthRouter.CancelAdjustSpectrum:input_type -> gnoi.optical.AdjustSpectrumRequest + 9, // 16: gnoi.optical.WavelengthRouter.AdjustPSD:output_type -> gnoi.optical.AdjustPSDResponse + 10, // 17: gnoi.optical.WavelengthRouter.CancelAdjustPSD:output_type -> gnoi.optical.CancelAdjustPSDResponse + 14, // 18: gnoi.optical.WavelengthRouter.AdjustSpectrum:output_type -> gnoi.optical.AdjustSpectrumResponse + 15, // 19: gnoi.optical.WavelengthRouter.CancelAdjustSpectrum:output_type -> gnoi.optical.CancelAdjustSpectrumResponse + 16, // [16:20] is the sub-list for method output_type + 12, // [12:16] is the sub-list for method input_type + 12, // [12:12] is the sub-list for extension type_name + 12, // [12:12] is the sub-list for extension extendee + 0, // [0:12] is the sub-list for field type_name +} + +func init() { file_wavelength_router_wavelength_router_proto_init() } +func file_wavelength_router_wavelength_router_proto_init() { + if File_wavelength_router_wavelength_router_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_wavelength_router_wavelength_router_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AdjustPSDRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_wavelength_router_wavelength_router_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AdjustPSDProgress); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_wavelength_router_wavelength_router_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AdjustPSDError); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_wavelength_router_wavelength_router_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AdjustPSDResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_wavelength_router_wavelength_router_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CancelAdjustPSDResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_wavelength_router_wavelength_router_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AdjustSpectrumRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_wavelength_router_wavelength_router_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AdjustSpectrumProgress); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_wavelength_router_wavelength_router_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AdjustSpectrumError); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_wavelength_router_wavelength_router_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AdjustSpectrumResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_wavelength_router_wavelength_router_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CancelAdjustSpectrumResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_wavelength_router_wavelength_router_proto_msgTypes[3].OneofWrappers = []interface{}{ + (*AdjustPSDResponse_Progress)(nil), + (*AdjustPSDResponse_Error)(nil), + } + file_wavelength_router_wavelength_router_proto_msgTypes[8].OneofWrappers = []interface{}{ + (*AdjustSpectrumResponse_Progress)(nil), + (*AdjustSpectrumResponse_Error)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_wavelength_router_wavelength_router_proto_rawDesc, + NumEnums: 6, + NumMessages: 10, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_wavelength_router_wavelength_router_proto_goTypes, + DependencyIndexes: file_wavelength_router_wavelength_router_proto_depIdxs, + EnumInfos: file_wavelength_router_wavelength_router_proto_enumTypes, + MessageInfos: file_wavelength_router_wavelength_router_proto_msgTypes, + }.Build() + File_wavelength_router_wavelength_router_proto = out.File + file_wavelength_router_wavelength_router_proto_rawDesc = nil + file_wavelength_router_wavelength_router_proto_goTypes = nil + file_wavelength_router_wavelength_router_proto_depIdxs = nil +} diff --git a/src/sonic-framework/gnoi/wavelength_router/wavelength_router.proto b/src/sonic-framework/gnoi/wavelength_router/wavelength_router.proto new file mode 100644 index 000000000000..17989aebb474 --- /dev/null +++ b/src/sonic-framework/gnoi/wavelength_router/wavelength_router.proto @@ -0,0 +1,197 @@ +// +// Copyright 2019 Google LLC. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +syntax = "proto3"; + +package gnoi.optical; + +import "github.com/openconfig/gnoi/types/types.proto"; + +option go_package = "github.com/openconfig/gnoi/wavelength_router"; + +option (types.gnoi_version) = "0.2.0"; + +service WavelengthRouter { + // AdjustPSD performs a power spectral density (PSD) adjustment on an optical + // DWDM line system port. + // + // This RPC's initial message triggers adjustments. The target should validate + // the request, and immediately begin the adjustment as long as another + // adjustment is not already running. As this RPC may take multiple minutes, + // the state should be regularly streamed to the client. The operation should + // be completed on the device regardless of the state of the RPC channel to + // the initiating client. A client that becomes disconnected during an + // operation can reconnect, requesting the same operation, and receive status + // updates this way. There is no means by which an adjustment that has been + // triggered by a client can be cancelled unless the CancelAdjustPSD RPC is + // used. + // DEPRECATED, use AdjustSpectrum. + rpc AdjustPSD(AdjustPSDRequest) returns (stream AdjustPSDResponse) { + option deprecated = true; + } + + // CancelAdjustPSD cancels an in-progress AdjustPSD request. If an + // adjustment is not being performed for the provided request, then the RPC + // should return successfully. + // DEPRECATED, use CancelAdjustSpectrum. + rpc CancelAdjustPSD(AdjustPSDRequest) returns (CancelAdjustPSDResponse) { + option deprecated = true; + } + + // AdjustSpectrum performs a spectrum power adjustment on an optical + // DWDM line system port. + // + // This RPC's initial message triggers adjustments. The target should validate + // the request, and immediately begin the adjustment as long as another + // adjustment is not already running. As this RPC may take multiple minutes, + // the state should be regularly streamed to the client. The operation should + // be completed on the device regardless of the state of the RPC channel to + // the initiating client. A client that becomes disconnected during an + // operation can reconnect, requesting the same operation, and receive status + // updates this way. There is no means by which an adjustment that has been + // triggered by a client can be cancelled unless the CancelAdjustSpectrum + // RPC is used. + rpc AdjustSpectrum(AdjustSpectrumRequest) + returns (stream AdjustSpectrumResponse) {} + + // CancelAdjustSpectrum cancels an in-progress AdjustSpectrum request. If an + // adjustment is not being performed for the provided request, then the RPC + // should return successfully. + rpc CancelAdjustSpectrum(AdjustSpectrumRequest) + returns (CancelAdjustSpectrumResponse) {} +} + +message AdjustPSDRequest { + option deprecated = true; + // Absolute path to the /components/component list member in the OpenConfig + // model corresponding to the port to perform the adjustment for. + // (e.g., /components/component[name=amp-1-1]) + types.Path component = 1; + + enum SignalDirection { + DIRECTION_UNKNOWN = 0; + DIRECTION_INPUT = 1; + DIRECTION_OUTPUT = 2; + } + // Describes the signal direction that should be adjusted relative to the + // device. For example, "input" would be the signal entering into the device + // from the far end device. + SignalDirection direction = 2; +} + +message AdjustPSDProgress { + option deprecated = true; + enum State { + UNKNOWN = 0; + RUNNING = 1; // The PSD adjustment is running. + COMPLETE = 2; // The PSD adjustment completed successfully. + } + // The state of the OTDR trace requested. Note that this does not include + // error states as these should be returned as a gRPC error. + State state = 1; +} + +message AdjustPSDError { + option deprecated = true; + enum Type { + // An unspecified error. Must use the detail value to describe the issue. + UNSPECIFIED = 0; + // An adjustment was requested for a port that is busy (e.g., requesting + // input adjustment for a port that is currently running an output + // adjustment) + PORT_BUSY = 1; + // The hardware has failed and cannot complete an adjustment. + HARDWARE_FAILURE = 2; + } + Type type = 1; + string detail = 2; +} + +// AdjustPSDResponse describes the possible response messages that will be +// streamed after the RPC is initiated. While the OTDR is running, +// "progress" messages should be sent at a regular interval. When the +// adjustment is completed, an "error" message should be streamed if an +// error is encountered or the RPC should be terminated on success. +message AdjustPSDResponse { + option deprecated = true; + oneof response { + AdjustPSDProgress progress = 1; + AdjustPSDError error = 2; + } +} + +message CancelAdjustPSDResponse { + option deprecated = true; +} + +message AdjustSpectrumRequest { + // Absolute path to the /components/component list member in the OpenConfig + // model corresponding to the port to perform the adjustment for. + // (e.g., /components/component[name=wavelength-router-1-1]) + types.Path component = 1; + + enum SignalDirection { + DIRECTION_UNKNOWN = 0; + DIRECTION_INPUT = 1; + DIRECTION_OUTPUT = 2; + } + // Describes the signal direction that should be adjusted relative to the + // device. For example, "input" would be the signal entering into the device + // from the far end device. + SignalDirection direction = 2; +} + +message AdjustSpectrumProgress { + enum State { + UNKNOWN = 0; + RUNNING = 1; // The spectrum adjustment is running. + COMPLETE = 2; // The spectrum adjustment completed successfully. + } + // The state of the OTDR trace requested. Note that this does not include + // error states as these should be returned as a gRPC error. + State state = 1; +} + +message AdjustSpectrumError { + enum Type { + // An unspecified error. Must use the detail value to describe the issue. + UNSPECIFIED = 0; + // An adjustment was requested for a port that is busy (e.g., requesting + // input adjustment for a port that is currently running an output + // adjustment) + PORT_BUSY = 1; + // The hardware has failed and cannot complete an adjustment. + HARDWARE_FAILURE = 2; + } + Type type = 1; + string detail = 2; +} + +// AdjustSpectrumResponse describes the possible response messages that will be +// streamed after the RPC is initiated. While the OTDR is running, +// "progress" messages should be sent at a regular interval. When the +// adjustment is completed, an "error" message should be streamed if an +// error is encountered or the RPC should be terminated on success. +message AdjustSpectrumResponse { + oneof response { + AdjustSpectrumProgress progress = 1; + AdjustSpectrumError error = 2; + } +} + +message CancelAdjustSpectrumResponse { +} + diff --git a/src/sonic-framework/gnoi/wavelength_router/wavelength_router_grpc.pb.go b/src/sonic-framework/gnoi/wavelength_router/wavelength_router_grpc.pb.go new file mode 100755 index 000000000000..88dbc6bf5d42 --- /dev/null +++ b/src/sonic-framework/gnoi/wavelength_router/wavelength_router_grpc.pb.go @@ -0,0 +1,274 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.2.0 +// - protoc v3.21.10 +// source: wavelength_router/wavelength_router.proto + +package wavelength_router + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +// WavelengthRouterClient is the client API for WavelengthRouter service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type WavelengthRouterClient interface { + // Deprecated: Do not use. + AdjustPSD(ctx context.Context, in *AdjustPSDRequest, opts ...grpc.CallOption) (WavelengthRouter_AdjustPSDClient, error) + // Deprecated: Do not use. + CancelAdjustPSD(ctx context.Context, in *AdjustPSDRequest, opts ...grpc.CallOption) (*CancelAdjustPSDResponse, error) + AdjustSpectrum(ctx context.Context, in *AdjustSpectrumRequest, opts ...grpc.CallOption) (WavelengthRouter_AdjustSpectrumClient, error) + CancelAdjustSpectrum(ctx context.Context, in *AdjustSpectrumRequest, opts ...grpc.CallOption) (*CancelAdjustSpectrumResponse, error) +} + +type wavelengthRouterClient struct { + cc grpc.ClientConnInterface +} + +func NewWavelengthRouterClient(cc grpc.ClientConnInterface) WavelengthRouterClient { + return &wavelengthRouterClient{cc} +} + +// Deprecated: Do not use. +func (c *wavelengthRouterClient) AdjustPSD(ctx context.Context, in *AdjustPSDRequest, opts ...grpc.CallOption) (WavelengthRouter_AdjustPSDClient, error) { + stream, err := c.cc.NewStream(ctx, &WavelengthRouter_ServiceDesc.Streams[0], "/gnoi.optical.WavelengthRouter/AdjustPSD", opts...) + if err != nil { + return nil, err + } + x := &wavelengthRouterAdjustPSDClient{stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +type WavelengthRouter_AdjustPSDClient interface { + Recv() (*AdjustPSDResponse, error) + grpc.ClientStream +} + +type wavelengthRouterAdjustPSDClient struct { + grpc.ClientStream +} + +func (x *wavelengthRouterAdjustPSDClient) Recv() (*AdjustPSDResponse, error) { + m := new(AdjustPSDResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +// Deprecated: Do not use. +func (c *wavelengthRouterClient) CancelAdjustPSD(ctx context.Context, in *AdjustPSDRequest, opts ...grpc.CallOption) (*CancelAdjustPSDResponse, error) { + out := new(CancelAdjustPSDResponse) + err := c.cc.Invoke(ctx, "/gnoi.optical.WavelengthRouter/CancelAdjustPSD", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wavelengthRouterClient) AdjustSpectrum(ctx context.Context, in *AdjustSpectrumRequest, opts ...grpc.CallOption) (WavelengthRouter_AdjustSpectrumClient, error) { + stream, err := c.cc.NewStream(ctx, &WavelengthRouter_ServiceDesc.Streams[1], "/gnoi.optical.WavelengthRouter/AdjustSpectrum", opts...) + if err != nil { + return nil, err + } + x := &wavelengthRouterAdjustSpectrumClient{stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +type WavelengthRouter_AdjustSpectrumClient interface { + Recv() (*AdjustSpectrumResponse, error) + grpc.ClientStream +} + +type wavelengthRouterAdjustSpectrumClient struct { + grpc.ClientStream +} + +func (x *wavelengthRouterAdjustSpectrumClient) Recv() (*AdjustSpectrumResponse, error) { + m := new(AdjustSpectrumResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *wavelengthRouterClient) CancelAdjustSpectrum(ctx context.Context, in *AdjustSpectrumRequest, opts ...grpc.CallOption) (*CancelAdjustSpectrumResponse, error) { + out := new(CancelAdjustSpectrumResponse) + err := c.cc.Invoke(ctx, "/gnoi.optical.WavelengthRouter/CancelAdjustSpectrum", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// WavelengthRouterServer is the server API for WavelengthRouter service. +// All implementations must embed UnimplementedWavelengthRouterServer +// for forward compatibility +type WavelengthRouterServer interface { + // Deprecated: Do not use. + AdjustPSD(*AdjustPSDRequest, WavelengthRouter_AdjustPSDServer) error + // Deprecated: Do not use. + CancelAdjustPSD(context.Context, *AdjustPSDRequest) (*CancelAdjustPSDResponse, error) + AdjustSpectrum(*AdjustSpectrumRequest, WavelengthRouter_AdjustSpectrumServer) error + CancelAdjustSpectrum(context.Context, *AdjustSpectrumRequest) (*CancelAdjustSpectrumResponse, error) + mustEmbedUnimplementedWavelengthRouterServer() +} + +// UnimplementedWavelengthRouterServer must be embedded to have forward compatible implementations. +type UnimplementedWavelengthRouterServer struct { +} + +func (UnimplementedWavelengthRouterServer) AdjustPSD(*AdjustPSDRequest, WavelengthRouter_AdjustPSDServer) error { + return status.Errorf(codes.Unimplemented, "method AdjustPSD not implemented") +} +func (UnimplementedWavelengthRouterServer) CancelAdjustPSD(context.Context, *AdjustPSDRequest) (*CancelAdjustPSDResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CancelAdjustPSD not implemented") +} +func (UnimplementedWavelengthRouterServer) AdjustSpectrum(*AdjustSpectrumRequest, WavelengthRouter_AdjustSpectrumServer) error { + return status.Errorf(codes.Unimplemented, "method AdjustSpectrum not implemented") +} +func (UnimplementedWavelengthRouterServer) CancelAdjustSpectrum(context.Context, *AdjustSpectrumRequest) (*CancelAdjustSpectrumResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CancelAdjustSpectrum not implemented") +} +func (UnimplementedWavelengthRouterServer) mustEmbedUnimplementedWavelengthRouterServer() {} + +// UnsafeWavelengthRouterServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to WavelengthRouterServer will +// result in compilation errors. +type UnsafeWavelengthRouterServer interface { + mustEmbedUnimplementedWavelengthRouterServer() +} + +func RegisterWavelengthRouterServer(s grpc.ServiceRegistrar, srv WavelengthRouterServer) { + s.RegisterService(&WavelengthRouter_ServiceDesc, srv) +} + +func _WavelengthRouter_AdjustPSD_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(AdjustPSDRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(WavelengthRouterServer).AdjustPSD(m, &wavelengthRouterAdjustPSDServer{stream}) +} + +type WavelengthRouter_AdjustPSDServer interface { + Send(*AdjustPSDResponse) error + grpc.ServerStream +} + +type wavelengthRouterAdjustPSDServer struct { + grpc.ServerStream +} + +func (x *wavelengthRouterAdjustPSDServer) Send(m *AdjustPSDResponse) error { + return x.ServerStream.SendMsg(m) +} + +func _WavelengthRouter_CancelAdjustPSD_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AdjustPSDRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(WavelengthRouterServer).CancelAdjustPSD(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/gnoi.optical.WavelengthRouter/CancelAdjustPSD", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(WavelengthRouterServer).CancelAdjustPSD(ctx, req.(*AdjustPSDRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _WavelengthRouter_AdjustSpectrum_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(AdjustSpectrumRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(WavelengthRouterServer).AdjustSpectrum(m, &wavelengthRouterAdjustSpectrumServer{stream}) +} + +type WavelengthRouter_AdjustSpectrumServer interface { + Send(*AdjustSpectrumResponse) error + grpc.ServerStream +} + +type wavelengthRouterAdjustSpectrumServer struct { + grpc.ServerStream +} + +func (x *wavelengthRouterAdjustSpectrumServer) Send(m *AdjustSpectrumResponse) error { + return x.ServerStream.SendMsg(m) +} + +func _WavelengthRouter_CancelAdjustSpectrum_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AdjustSpectrumRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(WavelengthRouterServer).CancelAdjustSpectrum(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/gnoi.optical.WavelengthRouter/CancelAdjustSpectrum", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(WavelengthRouterServer).CancelAdjustSpectrum(ctx, req.(*AdjustSpectrumRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// WavelengthRouter_ServiceDesc is the grpc.ServiceDesc for WavelengthRouter service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var WavelengthRouter_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "gnoi.optical.WavelengthRouter", + HandlerType: (*WavelengthRouterServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "CancelAdjustPSD", + Handler: _WavelengthRouter_CancelAdjustPSD_Handler, + }, + { + MethodName: "CancelAdjustSpectrum", + Handler: _WavelengthRouter_CancelAdjustSpectrum_Handler, + }, + }, + Streams: []grpc.StreamDesc{ + { + StreamName: "AdjustPSD", + Handler: _WavelengthRouter_AdjustPSD_Handler, + ServerStreams: true, + }, + { + StreamName: "AdjustSpectrum", + Handler: _WavelengthRouter_AdjustSpectrum_Handler, + ServerStreams: true, + }, + }, + Metadata: "wavelength_router/wavelength_router.proto", +} diff --git a/src/sonic-framework/rebootbackend/Makefile.am b/src/sonic-framework/rebootbackend/Makefile.am new file mode 100644 index 000000000000..afd3de9d0b74 --- /dev/null +++ b/src/sonic-framework/rebootbackend/Makefile.am @@ -0,0 +1,19 @@ +INCLUDES = -I $(top_srcdir) -I/usr/include/dbus-c++-1/ -I $(top_srcdir)/system + +bin_PROGRAMS = rebootbackend + +if DEBUG +DBGFLAGS = -ggdb -DDEBUG +else +DBGFLAGS = -g +endif + +rebootbackend_SOURCES = rebootbackend.cpp rebootbe.cpp interfaces.cpp \ + reboot_thread.cpp init_thread.cpp redis_utils.cpp \ + reboot_common.cpp telemetry_helper.cpp \ + system/system.pb.cc types/types.pb.cc \ + common/common.pb.cc container_stop.pb.cc + +rebootbackend_CFLAGS = $(DBGFLAGS) $(AM_CFLAGS) $(CFLAGS_COMMON) $(CFLAGS_ASAN) +rebootbackend_CPPFLAGS = $(DBGFLAGS) $(AM_CFLAGS) $(CFLAGS_COMMON) $(CFLAGS_ASAN) +rebootbackend_LDADD = $(LDFLAGS_ASAN) -lswsscommon -ldbus-c++-1 -lpthread -lprotobuf diff --git a/src/sonic-framework/rebootbackend/container_stop.pb.cc b/src/sonic-framework/rebootbackend/container_stop.pb.cc new file mode 100644 index 000000000000..e32df4f1353c --- /dev/null +++ b/src/sonic-framework/rebootbackend/container_stop.pb.cc @@ -0,0 +1,1337 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: rebootbackend/container_stop.proto + +#include "rebootbackend/container_stop.pb.h" + +#include + +#include +#include +#include +#include +#include +#include +#include +// @@protoc_insertion_point(includes) +#include +extern PROTOBUF_INTERNAL_EXPORT_rebootbackend_2fcontainer_5fstop_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_ContainerStatus_rebootbackend_2fcontainer_5fstop_2eproto; +extern PROTOBUF_INTERNAL_EXPORT_rebootbackend_2fcontainer_5fstop_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_StopContainersResponse_ContainerStatusEntry_DoNotUse_rebootbackend_2fcontainer_5fstop_2eproto; +class StopContainersRequestDefaultTypeInternal { + public: + ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; +} _StopContainersRequest_default_instance_; +class ContainerStatusDefaultTypeInternal { + public: + ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; +} _ContainerStatus_default_instance_; +class StopContainersStatusRequestDefaultTypeInternal { + public: + ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; +} _StopContainersStatusRequest_default_instance_; +class StopContainersResponse_ContainerStatusEntry_DoNotUseDefaultTypeInternal { + public: + ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; +} _StopContainersResponse_ContainerStatusEntry_DoNotUse_default_instance_; +class StopContainersResponseDefaultTypeInternal { + public: + ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; +} _StopContainersResponse_default_instance_; +static void InitDefaultsscc_info_ContainerStatus_rebootbackend_2fcontainer_5fstop_2eproto() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::_ContainerStatus_default_instance_; + new (ptr) ::ContainerStatus(); + ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); + } + ::ContainerStatus::InitAsDefaultInstance(); +} + +::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_ContainerStatus_rebootbackend_2fcontainer_5fstop_2eproto = + {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, 0, InitDefaultsscc_info_ContainerStatus_rebootbackend_2fcontainer_5fstop_2eproto}, {}}; + +static void InitDefaultsscc_info_StopContainersRequest_rebootbackend_2fcontainer_5fstop_2eproto() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::_StopContainersRequest_default_instance_; + new (ptr) ::StopContainersRequest(); + ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); + } + ::StopContainersRequest::InitAsDefaultInstance(); +} + +::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_StopContainersRequest_rebootbackend_2fcontainer_5fstop_2eproto = + {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, 0, InitDefaultsscc_info_StopContainersRequest_rebootbackend_2fcontainer_5fstop_2eproto}, {}}; + +static void InitDefaultsscc_info_StopContainersResponse_rebootbackend_2fcontainer_5fstop_2eproto() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::_StopContainersResponse_default_instance_; + new (ptr) ::StopContainersResponse(); + ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); + } + ::StopContainersResponse::InitAsDefaultInstance(); +} + +::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_StopContainersResponse_rebootbackend_2fcontainer_5fstop_2eproto = + {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 1, 0, InitDefaultsscc_info_StopContainersResponse_rebootbackend_2fcontainer_5fstop_2eproto}, { + &scc_info_StopContainersResponse_ContainerStatusEntry_DoNotUse_rebootbackend_2fcontainer_5fstop_2eproto.base,}}; + +static void InitDefaultsscc_info_StopContainersResponse_ContainerStatusEntry_DoNotUse_rebootbackend_2fcontainer_5fstop_2eproto() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::_StopContainersResponse_ContainerStatusEntry_DoNotUse_default_instance_; + new (ptr) ::StopContainersResponse_ContainerStatusEntry_DoNotUse(); + } + ::StopContainersResponse_ContainerStatusEntry_DoNotUse::InitAsDefaultInstance(); +} + +::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_StopContainersResponse_ContainerStatusEntry_DoNotUse_rebootbackend_2fcontainer_5fstop_2eproto = + {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 1, 0, InitDefaultsscc_info_StopContainersResponse_ContainerStatusEntry_DoNotUse_rebootbackend_2fcontainer_5fstop_2eproto}, { + &scc_info_ContainerStatus_rebootbackend_2fcontainer_5fstop_2eproto.base,}}; + +static void InitDefaultsscc_info_StopContainersStatusRequest_rebootbackend_2fcontainer_5fstop_2eproto() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::_StopContainersStatusRequest_default_instance_; + new (ptr) ::StopContainersStatusRequest(); + ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); + } + ::StopContainersStatusRequest::InitAsDefaultInstance(); +} + +::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_StopContainersStatusRequest_rebootbackend_2fcontainer_5fstop_2eproto = + {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, 0, InitDefaultsscc_info_StopContainersStatusRequest_rebootbackend_2fcontainer_5fstop_2eproto}, {}}; + +static ::PROTOBUF_NAMESPACE_ID::Metadata file_level_metadata_rebootbackend_2fcontainer_5fstop_2eproto[5]; +static const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* file_level_enum_descriptors_rebootbackend_2fcontainer_5fstop_2eproto[1]; +static constexpr ::PROTOBUF_NAMESPACE_ID::ServiceDescriptor const** file_level_service_descriptors_rebootbackend_2fcontainer_5fstop_2eproto = nullptr; + +const ::PROTOBUF_NAMESPACE_ID::uint32 TableStruct_rebootbackend_2fcontainer_5fstop_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { + PROTOBUF_FIELD_OFFSET(::StopContainersRequest, _has_bits_), + PROTOBUF_FIELD_OFFSET(::StopContainersRequest, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + PROTOBUF_FIELD_OFFSET(::StopContainersRequest, request_id_), + PROTOBUF_FIELD_OFFSET(::StopContainersRequest, container_names_), + 0, + ~0u, + PROTOBUF_FIELD_OFFSET(::ContainerStatus, _has_bits_), + PROTOBUF_FIELD_OFFSET(::ContainerStatus, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + PROTOBUF_FIELD_OFFSET(::ContainerStatus, status_), + PROTOBUF_FIELD_OFFSET(::ContainerStatus, error_message_), + 1, + 0, + PROTOBUF_FIELD_OFFSET(::StopContainersStatusRequest, _has_bits_), + PROTOBUF_FIELD_OFFSET(::StopContainersStatusRequest, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + PROTOBUF_FIELD_OFFSET(::StopContainersStatusRequest, request_id_), + 0, + PROTOBUF_FIELD_OFFSET(::StopContainersResponse_ContainerStatusEntry_DoNotUse, _has_bits_), + PROTOBUF_FIELD_OFFSET(::StopContainersResponse_ContainerStatusEntry_DoNotUse, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + PROTOBUF_FIELD_OFFSET(::StopContainersResponse_ContainerStatusEntry_DoNotUse, key_), + PROTOBUF_FIELD_OFFSET(::StopContainersResponse_ContainerStatusEntry_DoNotUse, value_), + 0, + 1, + PROTOBUF_FIELD_OFFSET(::StopContainersResponse, _has_bits_), + PROTOBUF_FIELD_OFFSET(::StopContainersResponse, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + PROTOBUF_FIELD_OFFSET(::StopContainersResponse, status_), + PROTOBUF_FIELD_OFFSET(::StopContainersResponse, error_message_), + PROTOBUF_FIELD_OFFSET(::StopContainersResponse, container_status_), + 1, + 0, + ~0u, +}; +static const ::PROTOBUF_NAMESPACE_ID::internal::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { + { 0, 7, sizeof(::StopContainersRequest)}, + { 9, 16, sizeof(::ContainerStatus)}, + { 18, 24, sizeof(::StopContainersStatusRequest)}, + { 25, 32, sizeof(::StopContainersResponse_ContainerStatusEntry_DoNotUse)}, + { 34, 42, sizeof(::StopContainersResponse)}, +}; + +static ::PROTOBUF_NAMESPACE_ID::Message const * const file_default_instances[] = { + reinterpret_cast(&::_StopContainersRequest_default_instance_), + reinterpret_cast(&::_ContainerStatus_default_instance_), + reinterpret_cast(&::_StopContainersStatusRequest_default_instance_), + reinterpret_cast(&::_StopContainersResponse_ContainerStatusEntry_DoNotUse_default_instance_), + reinterpret_cast(&::_StopContainersResponse_default_instance_), +}; + +const char descriptor_table_protodef_rebootbackend_2fcontainer_5fstop_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = + "\n\"rebootbackend/container_stop.proto\"X\n\025" + "StopContainersRequest\022\027\n\nrequest_id\030\001 \001(" + "\tH\000\210\001\001\022\027\n\017container_names\030\002 \003(\tB\r\n\013_requ" + "est_id\"p\n\017ContainerStatus\022$\n\006status\030\001 \001(" + "\0162\017.ShutdownStatusH\000\210\001\001\022\032\n\rerror_message" + "\030\002 \001(\tH\001\210\001\001B\t\n\007_statusB\020\n\016_error_message" + "\"E\n\033StopContainersStatusRequest\022\027\n\nreque" + "st_id\030\001 \001(\tH\000\210\001\001B\r\n\013_request_id\"\211\002\n\026Stop" + "ContainersResponse\022$\n\006status\030\001 \001(\0162\017.Shu" + "tdownStatusH\000\210\001\001\022\032\n\rerror_message\030\002 \001(\tH" + "\001\210\001\001\022F\n\020container_status\030\003 \003(\0132,.StopCon" + "tainersResponse.ContainerStatusEntry\032H\n\024" + "ContainerStatusEntry\022\013\n\003key\030\001 \001(\t\022\037\n\005val" + "ue\030\002 \001(\0132\020.ContainerStatus:\0028\001B\t\n\007_statu" + "sB\020\n\016_error_message*u\n\016ShutdownStatus\022\017\n" + "\013NOT_STARTED\020\000\022\035\n\031WAITING_FOR_NICE_SHUTD" + "OWN\020\001\022\036\n\032WAITING_FOR_FORCE_SHUTDOWN\020\002\022\010\n" + "\004DONE\020\003\022\t\n\005ERROR\020\004b\006proto3" + ; +static const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable*const descriptor_table_rebootbackend_2fcontainer_5fstop_2eproto_deps[1] = { +}; +static ::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase*const descriptor_table_rebootbackend_2fcontainer_5fstop_2eproto_sccs[5] = { + &scc_info_ContainerStatus_rebootbackend_2fcontainer_5fstop_2eproto.base, + &scc_info_StopContainersRequest_rebootbackend_2fcontainer_5fstop_2eproto.base, + &scc_info_StopContainersResponse_rebootbackend_2fcontainer_5fstop_2eproto.base, + &scc_info_StopContainersResponse_ContainerStatusEntry_DoNotUse_rebootbackend_2fcontainer_5fstop_2eproto.base, + &scc_info_StopContainersStatusRequest_rebootbackend_2fcontainer_5fstop_2eproto.base, +}; +static ::PROTOBUF_NAMESPACE_ID::internal::once_flag descriptor_table_rebootbackend_2fcontainer_5fstop_2eproto_once; +const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_rebootbackend_2fcontainer_5fstop_2eproto = { + false, false, descriptor_table_protodef_rebootbackend_2fcontainer_5fstop_2eproto, "rebootbackend/container_stop.proto", 706, + &descriptor_table_rebootbackend_2fcontainer_5fstop_2eproto_once, descriptor_table_rebootbackend_2fcontainer_5fstop_2eproto_sccs, descriptor_table_rebootbackend_2fcontainer_5fstop_2eproto_deps, 5, 0, + schemas, file_default_instances, TableStruct_rebootbackend_2fcontainer_5fstop_2eproto::offsets, + file_level_metadata_rebootbackend_2fcontainer_5fstop_2eproto, 5, file_level_enum_descriptors_rebootbackend_2fcontainer_5fstop_2eproto, file_level_service_descriptors_rebootbackend_2fcontainer_5fstop_2eproto, +}; + +// Force running AddDescriptors() at dynamic initialization time. +static bool dynamic_init_dummy_rebootbackend_2fcontainer_5fstop_2eproto = (static_cast(::PROTOBUF_NAMESPACE_ID::internal::AddDescriptors(&descriptor_table_rebootbackend_2fcontainer_5fstop_2eproto)), true); +const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* ShutdownStatus_descriptor() { + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_rebootbackend_2fcontainer_5fstop_2eproto); + return file_level_enum_descriptors_rebootbackend_2fcontainer_5fstop_2eproto[0]; +} +bool ShutdownStatus_IsValid(int value) { + switch (value) { + case 0: + case 1: + case 2: + case 3: + case 4: + return true; + default: + return false; + } +} + + +// =================================================================== + +void StopContainersRequest::InitAsDefaultInstance() { +} +class StopContainersRequest::_Internal { + public: + using HasBits = decltype(std::declval()._has_bits_); + static void set_has_request_id(HasBits* has_bits) { + (*has_bits)[0] |= 1u; + } +}; + +StopContainersRequest::StopContainersRequest(::PROTOBUF_NAMESPACE_ID::Arena* arena) + : ::PROTOBUF_NAMESPACE_ID::Message(arena), + container_names_(arena) { + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:StopContainersRequest) +} +StopContainersRequest::StopContainersRequest(const StopContainersRequest& from) + : ::PROTOBUF_NAMESPACE_ID::Message(), + _has_bits_(from._has_bits_), + container_names_(from.container_names_) { + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + request_id_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + if (from._internal_has_request_id()) { + request_id_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from._internal_request_id(), + GetArena()); + } + // @@protoc_insertion_point(copy_constructor:StopContainersRequest) +} + +void StopContainersRequest::SharedCtor() { + ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_StopContainersRequest_rebootbackend_2fcontainer_5fstop_2eproto.base); + request_id_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); +} + +StopContainersRequest::~StopContainersRequest() { + // @@protoc_insertion_point(destructor:StopContainersRequest) + SharedDtor(); + _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); +} + +void StopContainersRequest::SharedDtor() { + GOOGLE_DCHECK(GetArena() == nullptr); + request_id_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); +} + +void StopContainersRequest::ArenaDtor(void* object) { + StopContainersRequest* _this = reinterpret_cast< StopContainersRequest* >(object); + (void)_this; +} +void StopContainersRequest::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { +} +void StopContainersRequest::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const StopContainersRequest& StopContainersRequest::default_instance() { + ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_StopContainersRequest_rebootbackend_2fcontainer_5fstop_2eproto.base); + return *internal_default_instance(); +} + + +void StopContainersRequest::Clear() { +// @@protoc_insertion_point(message_clear_start:StopContainersRequest) + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + container_names_.Clear(); + cached_has_bits = _has_bits_[0]; + if (cached_has_bits & 0x00000001u) { + request_id_.ClearNonDefaultToEmpty(); + } + _has_bits_.Clear(); + _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); +} + +const char* StopContainersRequest::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + _Internal::HasBits has_bits{}; + ::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArena(); (void)arena; + while (!ctx->Done(&ptr)) { + ::PROTOBUF_NAMESPACE_ID::uint32 tag; + ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + CHK_(ptr); + switch (tag >> 3) { + // string request_id = 1; + case 1: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { + auto str = _internal_mutable_request_id(); + ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); + CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "StopContainersRequest.request_id")); + CHK_(ptr); + } else goto handle_unusual; + continue; + // repeated string container_names = 2; + case 2: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { + ptr -= 1; + do { + ptr += 1; + auto str = _internal_add_container_names(); + ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); + CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "StopContainersRequest.container_names")); + CHK_(ptr); + if (!ctx->DataAvailable(ptr)) break; + } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<18>(ptr)); + } else goto handle_unusual; + continue; + default: { + handle_unusual: + if ((tag & 7) == 4 || tag == 0) { + ctx->SetLastTag(tag); + goto success; + } + ptr = UnknownFieldParse(tag, + _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), + ptr, ctx); + CHK_(ptr != nullptr); + continue; + } + } // switch + } // while +success: + _has_bits_.Or(has_bits); + return ptr; +failure: + ptr = nullptr; + goto success; +#undef CHK_ +} + +::PROTOBUF_NAMESPACE_ID::uint8* StopContainersRequest::_InternalSerialize( + ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { + // @@protoc_insertion_point(serialize_to_array_start:StopContainersRequest) + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string request_id = 1; + if (_internal_has_request_id()) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( + this->_internal_request_id().data(), static_cast(this->_internal_request_id().length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, + "StopContainersRequest.request_id"); + target = stream->WriteStringMaybeAliased( + 1, this->_internal_request_id(), target); + } + + // repeated string container_names = 2; + for (int i = 0, n = this->_internal_container_names_size(); i < n; i++) { + const auto& s = this->_internal_container_names(i); + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( + s.data(), static_cast(s.length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, + "StopContainersRequest.container_names"); + target = stream->WriteString(2, s, target); + } + + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:StopContainersRequest) + return target; +} + +size_t StopContainersRequest::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:StopContainersRequest) + size_t total_size = 0; + + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + // repeated string container_names = 2; + total_size += 1 * + ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(container_names_.size()); + for (int i = 0, n = container_names_.size(); i < n; i++) { + total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( + container_names_.Get(i)); + } + + // string request_id = 1; + cached_has_bits = _has_bits_[0]; + if (cached_has_bits & 0x00000001u) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( + this->_internal_request_id()); + } + + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize( + _internal_metadata_, total_size, &_cached_size_); + } + int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void StopContainersRequest::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:StopContainersRequest) + GOOGLE_DCHECK_NE(&from, this); + const StopContainersRequest* source = + ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( + &from); + if (source == nullptr) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:StopContainersRequest) + ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:StopContainersRequest) + MergeFrom(*source); + } +} + +void StopContainersRequest::MergeFrom(const StopContainersRequest& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:StopContainersRequest) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + container_names_.MergeFrom(from.container_names_); + if (from._internal_has_request_id()) { + _internal_set_request_id(from._internal_request_id()); + } +} + +void StopContainersRequest::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:StopContainersRequest) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void StopContainersRequest::CopyFrom(const StopContainersRequest& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:StopContainersRequest) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool StopContainersRequest::IsInitialized() const { + return true; +} + +void StopContainersRequest::InternalSwap(StopContainersRequest* other) { + using std::swap; + _internal_metadata_.Swap<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(&other->_internal_metadata_); + swap(_has_bits_[0], other->_has_bits_[0]); + container_names_.InternalSwap(&other->container_names_); + request_id_.Swap(&other->request_id_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); +} + +::PROTOBUF_NAMESPACE_ID::Metadata StopContainersRequest::GetMetadata() const { + return GetMetadataStatic(); +} + + +// =================================================================== + +void ContainerStatus::InitAsDefaultInstance() { +} +class ContainerStatus::_Internal { + public: + using HasBits = decltype(std::declval()._has_bits_); + static void set_has_status(HasBits* has_bits) { + (*has_bits)[0] |= 2u; + } + static void set_has_error_message(HasBits* has_bits) { + (*has_bits)[0] |= 1u; + } +}; + +ContainerStatus::ContainerStatus(::PROTOBUF_NAMESPACE_ID::Arena* arena) + : ::PROTOBUF_NAMESPACE_ID::Message(arena) { + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:ContainerStatus) +} +ContainerStatus::ContainerStatus(const ContainerStatus& from) + : ::PROTOBUF_NAMESPACE_ID::Message(), + _has_bits_(from._has_bits_) { + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + error_message_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + if (from._internal_has_error_message()) { + error_message_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from._internal_error_message(), + GetArena()); + } + status_ = from.status_; + // @@protoc_insertion_point(copy_constructor:ContainerStatus) +} + +void ContainerStatus::SharedCtor() { + ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_ContainerStatus_rebootbackend_2fcontainer_5fstop_2eproto.base); + error_message_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + status_ = 0; +} + +ContainerStatus::~ContainerStatus() { + // @@protoc_insertion_point(destructor:ContainerStatus) + SharedDtor(); + _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); +} + +void ContainerStatus::SharedDtor() { + GOOGLE_DCHECK(GetArena() == nullptr); + error_message_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); +} + +void ContainerStatus::ArenaDtor(void* object) { + ContainerStatus* _this = reinterpret_cast< ContainerStatus* >(object); + (void)_this; +} +void ContainerStatus::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { +} +void ContainerStatus::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ContainerStatus& ContainerStatus::default_instance() { + ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_ContainerStatus_rebootbackend_2fcontainer_5fstop_2eproto.base); + return *internal_default_instance(); +} + + +void ContainerStatus::Clear() { +// @@protoc_insertion_point(message_clear_start:ContainerStatus) + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + cached_has_bits = _has_bits_[0]; + if (cached_has_bits & 0x00000001u) { + error_message_.ClearNonDefaultToEmpty(); + } + status_ = 0; + _has_bits_.Clear(); + _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); +} + +const char* ContainerStatus::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + _Internal::HasBits has_bits{}; + ::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArena(); (void)arena; + while (!ctx->Done(&ptr)) { + ::PROTOBUF_NAMESPACE_ID::uint32 tag; + ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + CHK_(ptr); + switch (tag >> 3) { + // .ShutdownStatus status = 1; + case 1: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) { + ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + _internal_set_status(static_cast<::ShutdownStatus>(val)); + } else goto handle_unusual; + continue; + // string error_message = 2; + case 2: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { + auto str = _internal_mutable_error_message(); + ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); + CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "ContainerStatus.error_message")); + CHK_(ptr); + } else goto handle_unusual; + continue; + default: { + handle_unusual: + if ((tag & 7) == 4 || tag == 0) { + ctx->SetLastTag(tag); + goto success; + } + ptr = UnknownFieldParse(tag, + _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), + ptr, ctx); + CHK_(ptr != nullptr); + continue; + } + } // switch + } // while +success: + _has_bits_.Or(has_bits); + return ptr; +failure: + ptr = nullptr; + goto success; +#undef CHK_ +} + +::PROTOBUF_NAMESPACE_ID::uint8* ContainerStatus::_InternalSerialize( + ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { + // @@protoc_insertion_point(serialize_to_array_start:ContainerStatus) + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .ShutdownStatus status = 1; + if (_internal_has_status()) { + target = stream->EnsureSpace(target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray( + 1, this->_internal_status(), target); + } + + // string error_message = 2; + if (_internal_has_error_message()) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( + this->_internal_error_message().data(), static_cast(this->_internal_error_message().length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, + "ContainerStatus.error_message"); + target = stream->WriteStringMaybeAliased( + 2, this->_internal_error_message(), target); + } + + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:ContainerStatus) + return target; +} + +size_t ContainerStatus::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:ContainerStatus) + size_t total_size = 0; + + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + cached_has_bits = _has_bits_[0]; + if (cached_has_bits & 0x00000003u) { + // string error_message = 2; + if (cached_has_bits & 0x00000001u) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( + this->_internal_error_message()); + } + + // .ShutdownStatus status = 1; + if (cached_has_bits & 0x00000002u) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_status()); + } + + } + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize( + _internal_metadata_, total_size, &_cached_size_); + } + int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void ContainerStatus::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:ContainerStatus) + GOOGLE_DCHECK_NE(&from, this); + const ContainerStatus* source = + ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( + &from); + if (source == nullptr) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:ContainerStatus) + ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:ContainerStatus) + MergeFrom(*source); + } +} + +void ContainerStatus::MergeFrom(const ContainerStatus& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:ContainerStatus) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + cached_has_bits = from._has_bits_[0]; + if (cached_has_bits & 0x00000003u) { + if (cached_has_bits & 0x00000001u) { + _internal_set_error_message(from._internal_error_message()); + } + if (cached_has_bits & 0x00000002u) { + status_ = from.status_; + } + _has_bits_[0] |= cached_has_bits; + } +} + +void ContainerStatus::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:ContainerStatus) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void ContainerStatus::CopyFrom(const ContainerStatus& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:ContainerStatus) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ContainerStatus::IsInitialized() const { + return true; +} + +void ContainerStatus::InternalSwap(ContainerStatus* other) { + using std::swap; + _internal_metadata_.Swap<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(&other->_internal_metadata_); + swap(_has_bits_[0], other->_has_bits_[0]); + error_message_.Swap(&other->error_message_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); + swap(status_, other->status_); +} + +::PROTOBUF_NAMESPACE_ID::Metadata ContainerStatus::GetMetadata() const { + return GetMetadataStatic(); +} + + +// =================================================================== + +void StopContainersStatusRequest::InitAsDefaultInstance() { +} +class StopContainersStatusRequest::_Internal { + public: + using HasBits = decltype(std::declval()._has_bits_); + static void set_has_request_id(HasBits* has_bits) { + (*has_bits)[0] |= 1u; + } +}; + +StopContainersStatusRequest::StopContainersStatusRequest(::PROTOBUF_NAMESPACE_ID::Arena* arena) + : ::PROTOBUF_NAMESPACE_ID::Message(arena) { + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:StopContainersStatusRequest) +} +StopContainersStatusRequest::StopContainersStatusRequest(const StopContainersStatusRequest& from) + : ::PROTOBUF_NAMESPACE_ID::Message(), + _has_bits_(from._has_bits_) { + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + request_id_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + if (from._internal_has_request_id()) { + request_id_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from._internal_request_id(), + GetArena()); + } + // @@protoc_insertion_point(copy_constructor:StopContainersStatusRequest) +} + +void StopContainersStatusRequest::SharedCtor() { + ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_StopContainersStatusRequest_rebootbackend_2fcontainer_5fstop_2eproto.base); + request_id_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); +} + +StopContainersStatusRequest::~StopContainersStatusRequest() { + // @@protoc_insertion_point(destructor:StopContainersStatusRequest) + SharedDtor(); + _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); +} + +void StopContainersStatusRequest::SharedDtor() { + GOOGLE_DCHECK(GetArena() == nullptr); + request_id_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); +} + +void StopContainersStatusRequest::ArenaDtor(void* object) { + StopContainersStatusRequest* _this = reinterpret_cast< StopContainersStatusRequest* >(object); + (void)_this; +} +void StopContainersStatusRequest::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { +} +void StopContainersStatusRequest::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const StopContainersStatusRequest& StopContainersStatusRequest::default_instance() { + ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_StopContainersStatusRequest_rebootbackend_2fcontainer_5fstop_2eproto.base); + return *internal_default_instance(); +} + + +void StopContainersStatusRequest::Clear() { +// @@protoc_insertion_point(message_clear_start:StopContainersStatusRequest) + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + cached_has_bits = _has_bits_[0]; + if (cached_has_bits & 0x00000001u) { + request_id_.ClearNonDefaultToEmpty(); + } + _has_bits_.Clear(); + _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); +} + +const char* StopContainersStatusRequest::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + _Internal::HasBits has_bits{}; + ::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArena(); (void)arena; + while (!ctx->Done(&ptr)) { + ::PROTOBUF_NAMESPACE_ID::uint32 tag; + ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + CHK_(ptr); + switch (tag >> 3) { + // string request_id = 1; + case 1: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { + auto str = _internal_mutable_request_id(); + ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); + CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "StopContainersStatusRequest.request_id")); + CHK_(ptr); + } else goto handle_unusual; + continue; + default: { + handle_unusual: + if ((tag & 7) == 4 || tag == 0) { + ctx->SetLastTag(tag); + goto success; + } + ptr = UnknownFieldParse(tag, + _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), + ptr, ctx); + CHK_(ptr != nullptr); + continue; + } + } // switch + } // while +success: + _has_bits_.Or(has_bits); + return ptr; +failure: + ptr = nullptr; + goto success; +#undef CHK_ +} + +::PROTOBUF_NAMESPACE_ID::uint8* StopContainersStatusRequest::_InternalSerialize( + ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { + // @@protoc_insertion_point(serialize_to_array_start:StopContainersStatusRequest) + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string request_id = 1; + if (_internal_has_request_id()) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( + this->_internal_request_id().data(), static_cast(this->_internal_request_id().length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, + "StopContainersStatusRequest.request_id"); + target = stream->WriteStringMaybeAliased( + 1, this->_internal_request_id(), target); + } + + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:StopContainersStatusRequest) + return target; +} + +size_t StopContainersStatusRequest::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:StopContainersStatusRequest) + size_t total_size = 0; + + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + // string request_id = 1; + cached_has_bits = _has_bits_[0]; + if (cached_has_bits & 0x00000001u) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( + this->_internal_request_id()); + } + + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize( + _internal_metadata_, total_size, &_cached_size_); + } + int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void StopContainersStatusRequest::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:StopContainersStatusRequest) + GOOGLE_DCHECK_NE(&from, this); + const StopContainersStatusRequest* source = + ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( + &from); + if (source == nullptr) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:StopContainersStatusRequest) + ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:StopContainersStatusRequest) + MergeFrom(*source); + } +} + +void StopContainersStatusRequest::MergeFrom(const StopContainersStatusRequest& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:StopContainersStatusRequest) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from._internal_has_request_id()) { + _internal_set_request_id(from._internal_request_id()); + } +} + +void StopContainersStatusRequest::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:StopContainersStatusRequest) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void StopContainersStatusRequest::CopyFrom(const StopContainersStatusRequest& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:StopContainersStatusRequest) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool StopContainersStatusRequest::IsInitialized() const { + return true; +} + +void StopContainersStatusRequest::InternalSwap(StopContainersStatusRequest* other) { + using std::swap; + _internal_metadata_.Swap<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(&other->_internal_metadata_); + swap(_has_bits_[0], other->_has_bits_[0]); + request_id_.Swap(&other->request_id_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); +} + +::PROTOBUF_NAMESPACE_ID::Metadata StopContainersStatusRequest::GetMetadata() const { + return GetMetadataStatic(); +} + + +// =================================================================== + +StopContainersResponse_ContainerStatusEntry_DoNotUse::StopContainersResponse_ContainerStatusEntry_DoNotUse() {} +StopContainersResponse_ContainerStatusEntry_DoNotUse::StopContainersResponse_ContainerStatusEntry_DoNotUse(::PROTOBUF_NAMESPACE_ID::Arena* arena) + : SuperType(arena) {} +void StopContainersResponse_ContainerStatusEntry_DoNotUse::MergeFrom(const StopContainersResponse_ContainerStatusEntry_DoNotUse& other) { + MergeFromInternal(other); +} +::PROTOBUF_NAMESPACE_ID::Metadata StopContainersResponse_ContainerStatusEntry_DoNotUse::GetMetadata() const { + return GetMetadataStatic(); +} +void StopContainersResponse_ContainerStatusEntry_DoNotUse::MergeFrom( + const ::PROTOBUF_NAMESPACE_ID::Message& other) { + ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom(other); +} + + +// =================================================================== + +void StopContainersResponse::InitAsDefaultInstance() { +} +class StopContainersResponse::_Internal { + public: + using HasBits = decltype(std::declval()._has_bits_); + static void set_has_status(HasBits* has_bits) { + (*has_bits)[0] |= 2u; + } + static void set_has_error_message(HasBits* has_bits) { + (*has_bits)[0] |= 1u; + } +}; + +StopContainersResponse::StopContainersResponse(::PROTOBUF_NAMESPACE_ID::Arena* arena) + : ::PROTOBUF_NAMESPACE_ID::Message(arena), + container_status_(arena) { + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:StopContainersResponse) +} +StopContainersResponse::StopContainersResponse(const StopContainersResponse& from) + : ::PROTOBUF_NAMESPACE_ID::Message(), + _has_bits_(from._has_bits_) { + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + container_status_.MergeFrom(from.container_status_); + error_message_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + if (from._internal_has_error_message()) { + error_message_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from._internal_error_message(), + GetArena()); + } + status_ = from.status_; + // @@protoc_insertion_point(copy_constructor:StopContainersResponse) +} + +void StopContainersResponse::SharedCtor() { + ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_StopContainersResponse_rebootbackend_2fcontainer_5fstop_2eproto.base); + error_message_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + status_ = 0; +} + +StopContainersResponse::~StopContainersResponse() { + // @@protoc_insertion_point(destructor:StopContainersResponse) + SharedDtor(); + _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); +} + +void StopContainersResponse::SharedDtor() { + GOOGLE_DCHECK(GetArena() == nullptr); + error_message_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); +} + +void StopContainersResponse::ArenaDtor(void* object) { + StopContainersResponse* _this = reinterpret_cast< StopContainersResponse* >(object); + (void)_this; +} +void StopContainersResponse::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { +} +void StopContainersResponse::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const StopContainersResponse& StopContainersResponse::default_instance() { + ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_StopContainersResponse_rebootbackend_2fcontainer_5fstop_2eproto.base); + return *internal_default_instance(); +} + + +void StopContainersResponse::Clear() { +// @@protoc_insertion_point(message_clear_start:StopContainersResponse) + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + container_status_.Clear(); + cached_has_bits = _has_bits_[0]; + if (cached_has_bits & 0x00000001u) { + error_message_.ClearNonDefaultToEmpty(); + } + status_ = 0; + _has_bits_.Clear(); + _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); +} + +const char* StopContainersResponse::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + _Internal::HasBits has_bits{}; + ::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArena(); (void)arena; + while (!ctx->Done(&ptr)) { + ::PROTOBUF_NAMESPACE_ID::uint32 tag; + ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + CHK_(ptr); + switch (tag >> 3) { + // .ShutdownStatus status = 1; + case 1: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) { + ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + _internal_set_status(static_cast<::ShutdownStatus>(val)); + } else goto handle_unusual; + continue; + // string error_message = 2; + case 2: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { + auto str = _internal_mutable_error_message(); + ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); + CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "StopContainersResponse.error_message")); + CHK_(ptr); + } else goto handle_unusual; + continue; + // map container_status = 3; + case 3: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 26)) { + ptr -= 1; + do { + ptr += 1; + ptr = ctx->ParseMessage(&container_status_, ptr); + CHK_(ptr); + if (!ctx->DataAvailable(ptr)) break; + } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<26>(ptr)); + } else goto handle_unusual; + continue; + default: { + handle_unusual: + if ((tag & 7) == 4 || tag == 0) { + ctx->SetLastTag(tag); + goto success; + } + ptr = UnknownFieldParse(tag, + _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), + ptr, ctx); + CHK_(ptr != nullptr); + continue; + } + } // switch + } // while +success: + _has_bits_.Or(has_bits); + return ptr; +failure: + ptr = nullptr; + goto success; +#undef CHK_ +} + +::PROTOBUF_NAMESPACE_ID::uint8* StopContainersResponse::_InternalSerialize( + ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { + // @@protoc_insertion_point(serialize_to_array_start:StopContainersResponse) + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .ShutdownStatus status = 1; + if (_internal_has_status()) { + target = stream->EnsureSpace(target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray( + 1, this->_internal_status(), target); + } + + // string error_message = 2; + if (_internal_has_error_message()) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( + this->_internal_error_message().data(), static_cast(this->_internal_error_message().length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, + "StopContainersResponse.error_message"); + target = stream->WriteStringMaybeAliased( + 2, this->_internal_error_message(), target); + } + + // map container_status = 3; + if (!this->_internal_container_status().empty()) { + typedef ::PROTOBUF_NAMESPACE_ID::Map< std::string, ::ContainerStatus >::const_pointer + ConstPtr; + typedef ConstPtr SortItem; + typedef ::PROTOBUF_NAMESPACE_ID::internal::CompareByDerefFirst Less; + struct Utf8Check { + static void Check(ConstPtr p) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( + p->first.data(), static_cast(p->first.length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, + "StopContainersResponse.ContainerStatusEntry.key"); + } + }; + + if (stream->IsSerializationDeterministic() && + this->_internal_container_status().size() > 1) { + ::std::unique_ptr items( + new SortItem[this->_internal_container_status().size()]); + typedef ::PROTOBUF_NAMESPACE_ID::Map< std::string, ::ContainerStatus >::size_type size_type; + size_type n = 0; + for (::PROTOBUF_NAMESPACE_ID::Map< std::string, ::ContainerStatus >::const_iterator + it = this->_internal_container_status().begin(); + it != this->_internal_container_status().end(); ++it, ++n) { + items[static_cast(n)] = SortItem(&*it); + } + ::std::sort(&items[0], &items[static_cast(n)], Less()); + for (size_type i = 0; i < n; i++) { + target = StopContainersResponse_ContainerStatusEntry_DoNotUse::Funcs::InternalSerialize(3, items[static_cast(i)]->first, items[static_cast(i)]->second, target, stream); + Utf8Check::Check(&(*items[static_cast(i)])); + } + } else { + for (::PROTOBUF_NAMESPACE_ID::Map< std::string, ::ContainerStatus >::const_iterator + it = this->_internal_container_status().begin(); + it != this->_internal_container_status().end(); ++it) { + target = StopContainersResponse_ContainerStatusEntry_DoNotUse::Funcs::InternalSerialize(3, it->first, it->second, target, stream); + Utf8Check::Check(&(*it)); + } + } + } + + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:StopContainersResponse) + return target; +} + +size_t StopContainersResponse::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:StopContainersResponse) + size_t total_size = 0; + + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + // map container_status = 3; + total_size += 1 * + ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(this->_internal_container_status_size()); + for (::PROTOBUF_NAMESPACE_ID::Map< std::string, ::ContainerStatus >::const_iterator + it = this->_internal_container_status().begin(); + it != this->_internal_container_status().end(); ++it) { + total_size += StopContainersResponse_ContainerStatusEntry_DoNotUse::Funcs::ByteSizeLong(it->first, it->second); + } + + cached_has_bits = _has_bits_[0]; + if (cached_has_bits & 0x00000003u) { + // string error_message = 2; + if (cached_has_bits & 0x00000001u) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( + this->_internal_error_message()); + } + + // .ShutdownStatus status = 1; + if (cached_has_bits & 0x00000002u) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_status()); + } + + } + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize( + _internal_metadata_, total_size, &_cached_size_); + } + int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void StopContainersResponse::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:StopContainersResponse) + GOOGLE_DCHECK_NE(&from, this); + const StopContainersResponse* source = + ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( + &from); + if (source == nullptr) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:StopContainersResponse) + ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:StopContainersResponse) + MergeFrom(*source); + } +} + +void StopContainersResponse::MergeFrom(const StopContainersResponse& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:StopContainersResponse) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + container_status_.MergeFrom(from.container_status_); + cached_has_bits = from._has_bits_[0]; + if (cached_has_bits & 0x00000003u) { + if (cached_has_bits & 0x00000001u) { + _internal_set_error_message(from._internal_error_message()); + } + if (cached_has_bits & 0x00000002u) { + status_ = from.status_; + } + _has_bits_[0] |= cached_has_bits; + } +} + +void StopContainersResponse::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:StopContainersResponse) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void StopContainersResponse::CopyFrom(const StopContainersResponse& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:StopContainersResponse) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool StopContainersResponse::IsInitialized() const { + return true; +} + +void StopContainersResponse::InternalSwap(StopContainersResponse* other) { + using std::swap; + _internal_metadata_.Swap<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(&other->_internal_metadata_); + swap(_has_bits_[0], other->_has_bits_[0]); + container_status_.Swap(&other->container_status_); + error_message_.Swap(&other->error_message_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); + swap(status_, other->status_); +} + +::PROTOBUF_NAMESPACE_ID::Metadata StopContainersResponse::GetMetadata() const { + return GetMetadataStatic(); +} + + +// @@protoc_insertion_point(namespace_scope) +PROTOBUF_NAMESPACE_OPEN +template<> PROTOBUF_NOINLINE ::StopContainersRequest* Arena::CreateMaybeMessage< ::StopContainersRequest >(Arena* arena) { + return Arena::CreateMessageInternal< ::StopContainersRequest >(arena); +} +template<> PROTOBUF_NOINLINE ::ContainerStatus* Arena::CreateMaybeMessage< ::ContainerStatus >(Arena* arena) { + return Arena::CreateMessageInternal< ::ContainerStatus >(arena); +} +template<> PROTOBUF_NOINLINE ::StopContainersStatusRequest* Arena::CreateMaybeMessage< ::StopContainersStatusRequest >(Arena* arena) { + return Arena::CreateMessageInternal< ::StopContainersStatusRequest >(arena); +} +template<> PROTOBUF_NOINLINE ::StopContainersResponse_ContainerStatusEntry_DoNotUse* Arena::CreateMaybeMessage< ::StopContainersResponse_ContainerStatusEntry_DoNotUse >(Arena* arena) { + return Arena::CreateMessageInternal< ::StopContainersResponse_ContainerStatusEntry_DoNotUse >(arena); +} +template<> PROTOBUF_NOINLINE ::StopContainersResponse* Arena::CreateMaybeMessage< ::StopContainersResponse >(Arena* arena) { + return Arena::CreateMessageInternal< ::StopContainersResponse >(arena); +} +PROTOBUF_NAMESPACE_CLOSE + +// @@protoc_insertion_point(global_scope) +#include diff --git a/src/sonic-framework/rebootbackend/container_stop.pb.h b/src/sonic-framework/rebootbackend/container_stop.pb.h new file mode 100644 index 000000000000..961cc1f0c2f2 --- /dev/null +++ b/src/sonic-framework/rebootbackend/container_stop.pb.h @@ -0,0 +1,1441 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: rebootbackend/container_stop.proto + +#ifndef GOOGLE_PROTOBUF_INCLUDED_rebootbackend_2fcontainer_5fstop_2eproto +#define GOOGLE_PROTOBUF_INCLUDED_rebootbackend_2fcontainer_5fstop_2eproto + +#include +#include + +#include +#if PROTOBUF_VERSION < 3012000 +#error This file was generated by a newer version of protoc which is +#error incompatible with your Protocol Buffer headers. Please update +#error your headers. +#endif +#if 3012004 < PROTOBUF_MIN_PROTOC_VERSION +#error This file was generated by an older version of protoc which is +#error incompatible with your Protocol Buffer headers. Please +#error regenerate this file with a newer version of protoc. +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include // IWYU pragma: export +#include // IWYU pragma: export +#include // IWYU pragma: export +#include +#include +#include +#include +// @@protoc_insertion_point(includes) +#include +#define PROTOBUF_INTERNAL_EXPORT_rebootbackend_2fcontainer_5fstop_2eproto +PROTOBUF_NAMESPACE_OPEN +namespace internal { +class AnyMetadata; +} // namespace internal +PROTOBUF_NAMESPACE_CLOSE + +// Internal implementation detail -- do not use these members. +struct TableStruct_rebootbackend_2fcontainer_5fstop_2eproto { + static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTableField entries[] + PROTOBUF_SECTION_VARIABLE(protodesc_cold); + static const ::PROTOBUF_NAMESPACE_ID::internal::AuxillaryParseTableField aux[] + PROTOBUF_SECTION_VARIABLE(protodesc_cold); + static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTable schema[5] + PROTOBUF_SECTION_VARIABLE(protodesc_cold); + static const ::PROTOBUF_NAMESPACE_ID::internal::FieldMetadata field_metadata[]; + static const ::PROTOBUF_NAMESPACE_ID::internal::SerializationTable serialization_table[]; + static const ::PROTOBUF_NAMESPACE_ID::uint32 offsets[]; +}; +extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_rebootbackend_2fcontainer_5fstop_2eproto; +class ContainerStatus; +class ContainerStatusDefaultTypeInternal; +extern ContainerStatusDefaultTypeInternal _ContainerStatus_default_instance_; +class StopContainersRequest; +class StopContainersRequestDefaultTypeInternal; +extern StopContainersRequestDefaultTypeInternal _StopContainersRequest_default_instance_; +class StopContainersResponse; +class StopContainersResponseDefaultTypeInternal; +extern StopContainersResponseDefaultTypeInternal _StopContainersResponse_default_instance_; +class StopContainersResponse_ContainerStatusEntry_DoNotUse; +class StopContainersResponse_ContainerStatusEntry_DoNotUseDefaultTypeInternal; +extern StopContainersResponse_ContainerStatusEntry_DoNotUseDefaultTypeInternal _StopContainersResponse_ContainerStatusEntry_DoNotUse_default_instance_; +class StopContainersStatusRequest; +class StopContainersStatusRequestDefaultTypeInternal; +extern StopContainersStatusRequestDefaultTypeInternal _StopContainersStatusRequest_default_instance_; +PROTOBUF_NAMESPACE_OPEN +template<> ::ContainerStatus* Arena::CreateMaybeMessage<::ContainerStatus>(Arena*); +template<> ::StopContainersRequest* Arena::CreateMaybeMessage<::StopContainersRequest>(Arena*); +template<> ::StopContainersResponse* Arena::CreateMaybeMessage<::StopContainersResponse>(Arena*); +template<> ::StopContainersResponse_ContainerStatusEntry_DoNotUse* Arena::CreateMaybeMessage<::StopContainersResponse_ContainerStatusEntry_DoNotUse>(Arena*); +template<> ::StopContainersStatusRequest* Arena::CreateMaybeMessage<::StopContainersStatusRequest>(Arena*); +PROTOBUF_NAMESPACE_CLOSE + +enum ShutdownStatus : int { + NOT_STARTED = 0, + WAITING_FOR_NICE_SHUTDOWN = 1, + WAITING_FOR_FORCE_SHUTDOWN = 2, + DONE = 3, + ERROR = 4, + ShutdownStatus_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits<::PROTOBUF_NAMESPACE_ID::int32>::min(), + ShutdownStatus_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits<::PROTOBUF_NAMESPACE_ID::int32>::max() +}; +bool ShutdownStatus_IsValid(int value); +constexpr ShutdownStatus ShutdownStatus_MIN = NOT_STARTED; +constexpr ShutdownStatus ShutdownStatus_MAX = ERROR; +constexpr int ShutdownStatus_ARRAYSIZE = ShutdownStatus_MAX + 1; + +const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* ShutdownStatus_descriptor(); +template +inline const std::string& ShutdownStatus_Name(T enum_t_value) { + static_assert(::std::is_same::value || + ::std::is_integral::value, + "Incorrect type passed to function ShutdownStatus_Name."); + return ::PROTOBUF_NAMESPACE_ID::internal::NameOfEnum( + ShutdownStatus_descriptor(), enum_t_value); +} +inline bool ShutdownStatus_Parse( + const std::string& name, ShutdownStatus* value) { + return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum( + ShutdownStatus_descriptor(), name, value); +} +// =================================================================== + +class StopContainersRequest PROTOBUF_FINAL : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:StopContainersRequest) */ { + public: + inline StopContainersRequest() : StopContainersRequest(nullptr) {}; + virtual ~StopContainersRequest(); + + StopContainersRequest(const StopContainersRequest& from); + StopContainersRequest(StopContainersRequest&& from) noexcept + : StopContainersRequest() { + *this = ::std::move(from); + } + + inline StopContainersRequest& operator=(const StopContainersRequest& from) { + CopyFrom(from); + return *this; + } + inline StopContainersRequest& operator=(StopContainersRequest&& from) noexcept { + if (GetArena() == from.GetArena()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return GetMetadataStatic().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return GetMetadataStatic().reflection; + } + static const StopContainersRequest& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const StopContainersRequest* internal_default_instance() { + return reinterpret_cast( + &_StopContainersRequest_default_instance_); + } + static constexpr int kIndexInFileMessages = + 0; + + friend void swap(StopContainersRequest& a, StopContainersRequest& b) { + a.Swap(&b); + } + inline void Swap(StopContainersRequest* other) { + if (other == this) return; + if (GetArena() == other->GetArena()) { + InternalSwap(other); + } else { + ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(StopContainersRequest* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArena() == other->GetArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + inline StopContainersRequest* New() const final { + return CreateMaybeMessage(nullptr); + } + + StopContainersRequest* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; + void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; + void CopyFrom(const StopContainersRequest& from); + void MergeFrom(const StopContainersRequest& from); + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; + ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( + ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + inline void SharedCtor(); + inline void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(StopContainersRequest* other); + friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; + static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { + return "StopContainersRequest"; + } + protected: + explicit StopContainersRequest(::PROTOBUF_NAMESPACE_ID::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); + public: + + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + private: + static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_rebootbackend_2fcontainer_5fstop_2eproto); + return ::descriptor_table_rebootbackend_2fcontainer_5fstop_2eproto.file_level_metadata[kIndexInFileMessages]; + } + + public: + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + enum : int { + kContainerNamesFieldNumber = 2, + kRequestIdFieldNumber = 1, + }; + // repeated string container_names = 2; + int container_names_size() const; + private: + int _internal_container_names_size() const; + public: + void clear_container_names(); + const std::string& container_names(int index) const; + std::string* mutable_container_names(int index); + void set_container_names(int index, const std::string& value); + void set_container_names(int index, std::string&& value); + void set_container_names(int index, const char* value); + void set_container_names(int index, const char* value, size_t size); + std::string* add_container_names(); + void add_container_names(const std::string& value); + void add_container_names(std::string&& value); + void add_container_names(const char* value); + void add_container_names(const char* value, size_t size); + const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField& container_names() const; + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField* mutable_container_names(); + private: + const std::string& _internal_container_names(int index) const; + std::string* _internal_add_container_names(); + public: + + // string request_id = 1; + bool has_request_id() const; + private: + bool _internal_has_request_id() const; + public: + void clear_request_id(); + const std::string& request_id() const; + void set_request_id(const std::string& value); + void set_request_id(std::string&& value); + void set_request_id(const char* value); + void set_request_id(const char* value, size_t size); + std::string* mutable_request_id(); + std::string* release_request_id(); + void set_allocated_request_id(std::string* request_id); + GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + std::string* unsafe_arena_release_request_id(); + GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_request_id( + std::string* request_id); + private: + const std::string& _internal_request_id() const; + void _internal_set_request_id(const std::string& value); + std::string* _internal_mutable_request_id(); + public: + + // @@protoc_insertion_point(class_scope:StopContainersRequest) + private: + class _Internal; + + template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField container_names_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr request_id_; + friend struct ::TableStruct_rebootbackend_2fcontainer_5fstop_2eproto; +}; +// ------------------------------------------------------------------- + +class ContainerStatus PROTOBUF_FINAL : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:ContainerStatus) */ { + public: + inline ContainerStatus() : ContainerStatus(nullptr) {}; + virtual ~ContainerStatus(); + + ContainerStatus(const ContainerStatus& from); + ContainerStatus(ContainerStatus&& from) noexcept + : ContainerStatus() { + *this = ::std::move(from); + } + + inline ContainerStatus& operator=(const ContainerStatus& from) { + CopyFrom(from); + return *this; + } + inline ContainerStatus& operator=(ContainerStatus&& from) noexcept { + if (GetArena() == from.GetArena()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return GetMetadataStatic().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return GetMetadataStatic().reflection; + } + static const ContainerStatus& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const ContainerStatus* internal_default_instance() { + return reinterpret_cast( + &_ContainerStatus_default_instance_); + } + static constexpr int kIndexInFileMessages = + 1; + + friend void swap(ContainerStatus& a, ContainerStatus& b) { + a.Swap(&b); + } + inline void Swap(ContainerStatus* other) { + if (other == this) return; + if (GetArena() == other->GetArena()) { + InternalSwap(other); + } else { + ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(ContainerStatus* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArena() == other->GetArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + inline ContainerStatus* New() const final { + return CreateMaybeMessage(nullptr); + } + + ContainerStatus* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; + void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; + void CopyFrom(const ContainerStatus& from); + void MergeFrom(const ContainerStatus& from); + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; + ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( + ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + inline void SharedCtor(); + inline void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(ContainerStatus* other); + friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; + static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { + return "ContainerStatus"; + } + protected: + explicit ContainerStatus(::PROTOBUF_NAMESPACE_ID::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); + public: + + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + private: + static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_rebootbackend_2fcontainer_5fstop_2eproto); + return ::descriptor_table_rebootbackend_2fcontainer_5fstop_2eproto.file_level_metadata[kIndexInFileMessages]; + } + + public: + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + enum : int { + kErrorMessageFieldNumber = 2, + kStatusFieldNumber = 1, + }; + // string error_message = 2; + bool has_error_message() const; + private: + bool _internal_has_error_message() const; + public: + void clear_error_message(); + const std::string& error_message() const; + void set_error_message(const std::string& value); + void set_error_message(std::string&& value); + void set_error_message(const char* value); + void set_error_message(const char* value, size_t size); + std::string* mutable_error_message(); + std::string* release_error_message(); + void set_allocated_error_message(std::string* error_message); + GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + std::string* unsafe_arena_release_error_message(); + GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_error_message( + std::string* error_message); + private: + const std::string& _internal_error_message() const; + void _internal_set_error_message(const std::string& value); + std::string* _internal_mutable_error_message(); + public: + + // .ShutdownStatus status = 1; + bool has_status() const; + private: + bool _internal_has_status() const; + public: + void clear_status(); + ::ShutdownStatus status() const; + void set_status(::ShutdownStatus value); + private: + ::ShutdownStatus _internal_status() const; + void _internal_set_status(::ShutdownStatus value); + public: + + // @@protoc_insertion_point(class_scope:ContainerStatus) + private: + class _Internal; + + template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr error_message_; + int status_; + friend struct ::TableStruct_rebootbackend_2fcontainer_5fstop_2eproto; +}; +// ------------------------------------------------------------------- + +class StopContainersStatusRequest PROTOBUF_FINAL : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:StopContainersStatusRequest) */ { + public: + inline StopContainersStatusRequest() : StopContainersStatusRequest(nullptr) {}; + virtual ~StopContainersStatusRequest(); + + StopContainersStatusRequest(const StopContainersStatusRequest& from); + StopContainersStatusRequest(StopContainersStatusRequest&& from) noexcept + : StopContainersStatusRequest() { + *this = ::std::move(from); + } + + inline StopContainersStatusRequest& operator=(const StopContainersStatusRequest& from) { + CopyFrom(from); + return *this; + } + inline StopContainersStatusRequest& operator=(StopContainersStatusRequest&& from) noexcept { + if (GetArena() == from.GetArena()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return GetMetadataStatic().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return GetMetadataStatic().reflection; + } + static const StopContainersStatusRequest& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const StopContainersStatusRequest* internal_default_instance() { + return reinterpret_cast( + &_StopContainersStatusRequest_default_instance_); + } + static constexpr int kIndexInFileMessages = + 2; + + friend void swap(StopContainersStatusRequest& a, StopContainersStatusRequest& b) { + a.Swap(&b); + } + inline void Swap(StopContainersStatusRequest* other) { + if (other == this) return; + if (GetArena() == other->GetArena()) { + InternalSwap(other); + } else { + ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(StopContainersStatusRequest* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArena() == other->GetArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + inline StopContainersStatusRequest* New() const final { + return CreateMaybeMessage(nullptr); + } + + StopContainersStatusRequest* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; + void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; + void CopyFrom(const StopContainersStatusRequest& from); + void MergeFrom(const StopContainersStatusRequest& from); + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; + ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( + ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + inline void SharedCtor(); + inline void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(StopContainersStatusRequest* other); + friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; + static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { + return "StopContainersStatusRequest"; + } + protected: + explicit StopContainersStatusRequest(::PROTOBUF_NAMESPACE_ID::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); + public: + + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + private: + static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_rebootbackend_2fcontainer_5fstop_2eproto); + return ::descriptor_table_rebootbackend_2fcontainer_5fstop_2eproto.file_level_metadata[kIndexInFileMessages]; + } + + public: + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + enum : int { + kRequestIdFieldNumber = 1, + }; + // string request_id = 1; + bool has_request_id() const; + private: + bool _internal_has_request_id() const; + public: + void clear_request_id(); + const std::string& request_id() const; + void set_request_id(const std::string& value); + void set_request_id(std::string&& value); + void set_request_id(const char* value); + void set_request_id(const char* value, size_t size); + std::string* mutable_request_id(); + std::string* release_request_id(); + void set_allocated_request_id(std::string* request_id); + GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + std::string* unsafe_arena_release_request_id(); + GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_request_id( + std::string* request_id); + private: + const std::string& _internal_request_id() const; + void _internal_set_request_id(const std::string& value); + std::string* _internal_mutable_request_id(); + public: + + // @@protoc_insertion_point(class_scope:StopContainersStatusRequest) + private: + class _Internal; + + template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr request_id_; + friend struct ::TableStruct_rebootbackend_2fcontainer_5fstop_2eproto; +}; +// ------------------------------------------------------------------- + +class StopContainersResponse_ContainerStatusEntry_DoNotUse : public ::PROTOBUF_NAMESPACE_ID::internal::MapEntry { +public: + typedef ::PROTOBUF_NAMESPACE_ID::internal::MapEntry SuperType; + StopContainersResponse_ContainerStatusEntry_DoNotUse(); + StopContainersResponse_ContainerStatusEntry_DoNotUse(::PROTOBUF_NAMESPACE_ID::Arena* arena); + void MergeFrom(const StopContainersResponse_ContainerStatusEntry_DoNotUse& other); + static const StopContainersResponse_ContainerStatusEntry_DoNotUse* internal_default_instance() { return reinterpret_cast(&_StopContainersResponse_ContainerStatusEntry_DoNotUse_default_instance_); } + static bool ValidateKey(std::string* s) { + return ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(s->data(), static_cast(s->size()), ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::PARSE, "StopContainersResponse.ContainerStatusEntry.key"); + } + static bool ValidateValue(void*) { return true; } + void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& other) final; + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + private: + static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_rebootbackend_2fcontainer_5fstop_2eproto); + return ::descriptor_table_rebootbackend_2fcontainer_5fstop_2eproto.file_level_metadata[3]; + } + + public: +}; + +// ------------------------------------------------------------------- + +class StopContainersResponse PROTOBUF_FINAL : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:StopContainersResponse) */ { + public: + inline StopContainersResponse() : StopContainersResponse(nullptr) {}; + virtual ~StopContainersResponse(); + + StopContainersResponse(const StopContainersResponse& from); + StopContainersResponse(StopContainersResponse&& from) noexcept + : StopContainersResponse() { + *this = ::std::move(from); + } + + inline StopContainersResponse& operator=(const StopContainersResponse& from) { + CopyFrom(from); + return *this; + } + inline StopContainersResponse& operator=(StopContainersResponse&& from) noexcept { + if (GetArena() == from.GetArena()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return GetMetadataStatic().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return GetMetadataStatic().reflection; + } + static const StopContainersResponse& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const StopContainersResponse* internal_default_instance() { + return reinterpret_cast( + &_StopContainersResponse_default_instance_); + } + static constexpr int kIndexInFileMessages = + 4; + + friend void swap(StopContainersResponse& a, StopContainersResponse& b) { + a.Swap(&b); + } + inline void Swap(StopContainersResponse* other) { + if (other == this) return; + if (GetArena() == other->GetArena()) { + InternalSwap(other); + } else { + ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(StopContainersResponse* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArena() == other->GetArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + inline StopContainersResponse* New() const final { + return CreateMaybeMessage(nullptr); + } + + StopContainersResponse* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; + void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; + void CopyFrom(const StopContainersResponse& from); + void MergeFrom(const StopContainersResponse& from); + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; + ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( + ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + inline void SharedCtor(); + inline void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(StopContainersResponse* other); + friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; + static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { + return "StopContainersResponse"; + } + protected: + explicit StopContainersResponse(::PROTOBUF_NAMESPACE_ID::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); + public: + + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + private: + static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_rebootbackend_2fcontainer_5fstop_2eproto); + return ::descriptor_table_rebootbackend_2fcontainer_5fstop_2eproto.file_level_metadata[kIndexInFileMessages]; + } + + public: + + // nested types ---------------------------------------------------- + + + // accessors ------------------------------------------------------- + + enum : int { + kContainerStatusFieldNumber = 3, + kErrorMessageFieldNumber = 2, + kStatusFieldNumber = 1, + }; + // map container_status = 3; + int container_status_size() const; + private: + int _internal_container_status_size() const; + public: + void clear_container_status(); + private: + const ::PROTOBUF_NAMESPACE_ID::Map< std::string, ::ContainerStatus >& + _internal_container_status() const; + ::PROTOBUF_NAMESPACE_ID::Map< std::string, ::ContainerStatus >* + _internal_mutable_container_status(); + public: + const ::PROTOBUF_NAMESPACE_ID::Map< std::string, ::ContainerStatus >& + container_status() const; + ::PROTOBUF_NAMESPACE_ID::Map< std::string, ::ContainerStatus >* + mutable_container_status(); + + // string error_message = 2; + bool has_error_message() const; + private: + bool _internal_has_error_message() const; + public: + void clear_error_message(); + const std::string& error_message() const; + void set_error_message(const std::string& value); + void set_error_message(std::string&& value); + void set_error_message(const char* value); + void set_error_message(const char* value, size_t size); + std::string* mutable_error_message(); + std::string* release_error_message(); + void set_allocated_error_message(std::string* error_message); + GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + std::string* unsafe_arena_release_error_message(); + GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_error_message( + std::string* error_message); + private: + const std::string& _internal_error_message() const; + void _internal_set_error_message(const std::string& value); + std::string* _internal_mutable_error_message(); + public: + + // .ShutdownStatus status = 1; + bool has_status() const; + private: + bool _internal_has_status() const; + public: + void clear_status(); + ::ShutdownStatus status() const; + void set_status(::ShutdownStatus value); + private: + ::ShutdownStatus _internal_status() const; + void _internal_set_status(::ShutdownStatus value); + public: + + // @@protoc_insertion_point(class_scope:StopContainersResponse) + private: + class _Internal; + + template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + ::PROTOBUF_NAMESPACE_ID::internal::MapField< + StopContainersResponse_ContainerStatusEntry_DoNotUse, + std::string, ::ContainerStatus, + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_STRING, + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_MESSAGE, + 0 > container_status_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr error_message_; + int status_; + friend struct ::TableStruct_rebootbackend_2fcontainer_5fstop_2eproto; +}; +// =================================================================== + + +// =================================================================== + +#ifdef __GNUC__ + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wstrict-aliasing" +#endif // __GNUC__ +// StopContainersRequest + +// string request_id = 1; +inline bool StopContainersRequest::_internal_has_request_id() const { + bool value = (_has_bits_[0] & 0x00000001u) != 0; + return value; +} +inline bool StopContainersRequest::has_request_id() const { + return _internal_has_request_id(); +} +inline void StopContainersRequest::clear_request_id() { + request_id_.ClearToEmpty(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); + _has_bits_[0] &= ~0x00000001u; +} +inline const std::string& StopContainersRequest::request_id() const { + // @@protoc_insertion_point(field_get:StopContainersRequest.request_id) + return _internal_request_id(); +} +inline void StopContainersRequest::set_request_id(const std::string& value) { + _internal_set_request_id(value); + // @@protoc_insertion_point(field_set:StopContainersRequest.request_id) +} +inline std::string* StopContainersRequest::mutable_request_id() { + // @@protoc_insertion_point(field_mutable:StopContainersRequest.request_id) + return _internal_mutable_request_id(); +} +inline const std::string& StopContainersRequest::_internal_request_id() const { + return request_id_.Get(); +} +inline void StopContainersRequest::_internal_set_request_id(const std::string& value) { + _has_bits_[0] |= 0x00000001u; + request_id_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value, GetArena()); +} +inline void StopContainersRequest::set_request_id(std::string&& value) { + _has_bits_[0] |= 0x00000001u; + request_id_.Set( + &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArena()); + // @@protoc_insertion_point(field_set_rvalue:StopContainersRequest.request_id) +} +inline void StopContainersRequest::set_request_id(const char* value) { + GOOGLE_DCHECK(value != nullptr); + _has_bits_[0] |= 0x00000001u; + request_id_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArena()); + // @@protoc_insertion_point(field_set_char:StopContainersRequest.request_id) +} +inline void StopContainersRequest::set_request_id(const char* value, + size_t size) { + _has_bits_[0] |= 0x00000001u; + request_id_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArena()); + // @@protoc_insertion_point(field_set_pointer:StopContainersRequest.request_id) +} +inline std::string* StopContainersRequest::_internal_mutable_request_id() { + _has_bits_[0] |= 0x00000001u; + return request_id_.Mutable(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); +} +inline std::string* StopContainersRequest::release_request_id() { + // @@protoc_insertion_point(field_release:StopContainersRequest.request_id) + if (!_internal_has_request_id()) { + return nullptr; + } + _has_bits_[0] &= ~0x00000001u; + return request_id_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); +} +inline void StopContainersRequest::set_allocated_request_id(std::string* request_id) { + if (request_id != nullptr) { + _has_bits_[0] |= 0x00000001u; + } else { + _has_bits_[0] &= ~0x00000001u; + } + request_id_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), request_id, + GetArena()); + // @@protoc_insertion_point(field_set_allocated:StopContainersRequest.request_id) +} +inline std::string* StopContainersRequest::unsafe_arena_release_request_id() { + // @@protoc_insertion_point(field_unsafe_arena_release:StopContainersRequest.request_id) + GOOGLE_DCHECK(GetArena() != nullptr); + _has_bits_[0] &= ~0x00000001u; + return request_id_.UnsafeArenaRelease(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), + GetArena()); +} +inline void StopContainersRequest::unsafe_arena_set_allocated_request_id( + std::string* request_id) { + GOOGLE_DCHECK(GetArena() != nullptr); + if (request_id != nullptr) { + _has_bits_[0] |= 0x00000001u; + } else { + _has_bits_[0] &= ~0x00000001u; + } + request_id_.UnsafeArenaSetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), + request_id, GetArena()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:StopContainersRequest.request_id) +} + +// repeated string container_names = 2; +inline int StopContainersRequest::_internal_container_names_size() const { + return container_names_.size(); +} +inline int StopContainersRequest::container_names_size() const { + return _internal_container_names_size(); +} +inline void StopContainersRequest::clear_container_names() { + container_names_.Clear(); +} +inline std::string* StopContainersRequest::add_container_names() { + // @@protoc_insertion_point(field_add_mutable:StopContainersRequest.container_names) + return _internal_add_container_names(); +} +inline const std::string& StopContainersRequest::_internal_container_names(int index) const { + return container_names_.Get(index); +} +inline const std::string& StopContainersRequest::container_names(int index) const { + // @@protoc_insertion_point(field_get:StopContainersRequest.container_names) + return _internal_container_names(index); +} +inline std::string* StopContainersRequest::mutable_container_names(int index) { + // @@protoc_insertion_point(field_mutable:StopContainersRequest.container_names) + return container_names_.Mutable(index); +} +inline void StopContainersRequest::set_container_names(int index, const std::string& value) { + // @@protoc_insertion_point(field_set:StopContainersRequest.container_names) + container_names_.Mutable(index)->assign(value); +} +inline void StopContainersRequest::set_container_names(int index, std::string&& value) { + // @@protoc_insertion_point(field_set:StopContainersRequest.container_names) + container_names_.Mutable(index)->assign(std::move(value)); +} +inline void StopContainersRequest::set_container_names(int index, const char* value) { + GOOGLE_DCHECK(value != nullptr); + container_names_.Mutable(index)->assign(value); + // @@protoc_insertion_point(field_set_char:StopContainersRequest.container_names) +} +inline void StopContainersRequest::set_container_names(int index, const char* value, size_t size) { + container_names_.Mutable(index)->assign( + reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:StopContainersRequest.container_names) +} +inline std::string* StopContainersRequest::_internal_add_container_names() { + return container_names_.Add(); +} +inline void StopContainersRequest::add_container_names(const std::string& value) { + container_names_.Add()->assign(value); + // @@protoc_insertion_point(field_add:StopContainersRequest.container_names) +} +inline void StopContainersRequest::add_container_names(std::string&& value) { + container_names_.Add(std::move(value)); + // @@protoc_insertion_point(field_add:StopContainersRequest.container_names) +} +inline void StopContainersRequest::add_container_names(const char* value) { + GOOGLE_DCHECK(value != nullptr); + container_names_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:StopContainersRequest.container_names) +} +inline void StopContainersRequest::add_container_names(const char* value, size_t size) { + container_names_.Add()->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_add_pointer:StopContainersRequest.container_names) +} +inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField& +StopContainersRequest::container_names() const { + // @@protoc_insertion_point(field_list:StopContainersRequest.container_names) + return container_names_; +} +inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField* +StopContainersRequest::mutable_container_names() { + // @@protoc_insertion_point(field_mutable_list:StopContainersRequest.container_names) + return &container_names_; +} + +// ------------------------------------------------------------------- + +// ContainerStatus + +// .ShutdownStatus status = 1; +inline bool ContainerStatus::_internal_has_status() const { + bool value = (_has_bits_[0] & 0x00000002u) != 0; + return value; +} +inline bool ContainerStatus::has_status() const { + return _internal_has_status(); +} +inline void ContainerStatus::clear_status() { + status_ = 0; + _has_bits_[0] &= ~0x00000002u; +} +inline ::ShutdownStatus ContainerStatus::_internal_status() const { + return static_cast< ::ShutdownStatus >(status_); +} +inline ::ShutdownStatus ContainerStatus::status() const { + // @@protoc_insertion_point(field_get:ContainerStatus.status) + return _internal_status(); +} +inline void ContainerStatus::_internal_set_status(::ShutdownStatus value) { + _has_bits_[0] |= 0x00000002u; + status_ = value; +} +inline void ContainerStatus::set_status(::ShutdownStatus value) { + _internal_set_status(value); + // @@protoc_insertion_point(field_set:ContainerStatus.status) +} + +// string error_message = 2; +inline bool ContainerStatus::_internal_has_error_message() const { + bool value = (_has_bits_[0] & 0x00000001u) != 0; + return value; +} +inline bool ContainerStatus::has_error_message() const { + return _internal_has_error_message(); +} +inline void ContainerStatus::clear_error_message() { + error_message_.ClearToEmpty(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); + _has_bits_[0] &= ~0x00000001u; +} +inline const std::string& ContainerStatus::error_message() const { + // @@protoc_insertion_point(field_get:ContainerStatus.error_message) + return _internal_error_message(); +} +inline void ContainerStatus::set_error_message(const std::string& value) { + _internal_set_error_message(value); + // @@protoc_insertion_point(field_set:ContainerStatus.error_message) +} +inline std::string* ContainerStatus::mutable_error_message() { + // @@protoc_insertion_point(field_mutable:ContainerStatus.error_message) + return _internal_mutable_error_message(); +} +inline const std::string& ContainerStatus::_internal_error_message() const { + return error_message_.Get(); +} +inline void ContainerStatus::_internal_set_error_message(const std::string& value) { + _has_bits_[0] |= 0x00000001u; + error_message_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value, GetArena()); +} +inline void ContainerStatus::set_error_message(std::string&& value) { + _has_bits_[0] |= 0x00000001u; + error_message_.Set( + &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArena()); + // @@protoc_insertion_point(field_set_rvalue:ContainerStatus.error_message) +} +inline void ContainerStatus::set_error_message(const char* value) { + GOOGLE_DCHECK(value != nullptr); + _has_bits_[0] |= 0x00000001u; + error_message_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArena()); + // @@protoc_insertion_point(field_set_char:ContainerStatus.error_message) +} +inline void ContainerStatus::set_error_message(const char* value, + size_t size) { + _has_bits_[0] |= 0x00000001u; + error_message_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArena()); + // @@protoc_insertion_point(field_set_pointer:ContainerStatus.error_message) +} +inline std::string* ContainerStatus::_internal_mutable_error_message() { + _has_bits_[0] |= 0x00000001u; + return error_message_.Mutable(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); +} +inline std::string* ContainerStatus::release_error_message() { + // @@protoc_insertion_point(field_release:ContainerStatus.error_message) + if (!_internal_has_error_message()) { + return nullptr; + } + _has_bits_[0] &= ~0x00000001u; + return error_message_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); +} +inline void ContainerStatus::set_allocated_error_message(std::string* error_message) { + if (error_message != nullptr) { + _has_bits_[0] |= 0x00000001u; + } else { + _has_bits_[0] &= ~0x00000001u; + } + error_message_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), error_message, + GetArena()); + // @@protoc_insertion_point(field_set_allocated:ContainerStatus.error_message) +} +inline std::string* ContainerStatus::unsafe_arena_release_error_message() { + // @@protoc_insertion_point(field_unsafe_arena_release:ContainerStatus.error_message) + GOOGLE_DCHECK(GetArena() != nullptr); + _has_bits_[0] &= ~0x00000001u; + return error_message_.UnsafeArenaRelease(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), + GetArena()); +} +inline void ContainerStatus::unsafe_arena_set_allocated_error_message( + std::string* error_message) { + GOOGLE_DCHECK(GetArena() != nullptr); + if (error_message != nullptr) { + _has_bits_[0] |= 0x00000001u; + } else { + _has_bits_[0] &= ~0x00000001u; + } + error_message_.UnsafeArenaSetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), + error_message, GetArena()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:ContainerStatus.error_message) +} + +// ------------------------------------------------------------------- + +// StopContainersStatusRequest + +// string request_id = 1; +inline bool StopContainersStatusRequest::_internal_has_request_id() const { + bool value = (_has_bits_[0] & 0x00000001u) != 0; + return value; +} +inline bool StopContainersStatusRequest::has_request_id() const { + return _internal_has_request_id(); +} +inline void StopContainersStatusRequest::clear_request_id() { + request_id_.ClearToEmpty(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); + _has_bits_[0] &= ~0x00000001u; +} +inline const std::string& StopContainersStatusRequest::request_id() const { + // @@protoc_insertion_point(field_get:StopContainersStatusRequest.request_id) + return _internal_request_id(); +} +inline void StopContainersStatusRequest::set_request_id(const std::string& value) { + _internal_set_request_id(value); + // @@protoc_insertion_point(field_set:StopContainersStatusRequest.request_id) +} +inline std::string* StopContainersStatusRequest::mutable_request_id() { + // @@protoc_insertion_point(field_mutable:StopContainersStatusRequest.request_id) + return _internal_mutable_request_id(); +} +inline const std::string& StopContainersStatusRequest::_internal_request_id() const { + return request_id_.Get(); +} +inline void StopContainersStatusRequest::_internal_set_request_id(const std::string& value) { + _has_bits_[0] |= 0x00000001u; + request_id_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value, GetArena()); +} +inline void StopContainersStatusRequest::set_request_id(std::string&& value) { + _has_bits_[0] |= 0x00000001u; + request_id_.Set( + &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArena()); + // @@protoc_insertion_point(field_set_rvalue:StopContainersStatusRequest.request_id) +} +inline void StopContainersStatusRequest::set_request_id(const char* value) { + GOOGLE_DCHECK(value != nullptr); + _has_bits_[0] |= 0x00000001u; + request_id_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArena()); + // @@protoc_insertion_point(field_set_char:StopContainersStatusRequest.request_id) +} +inline void StopContainersStatusRequest::set_request_id(const char* value, + size_t size) { + _has_bits_[0] |= 0x00000001u; + request_id_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArena()); + // @@protoc_insertion_point(field_set_pointer:StopContainersStatusRequest.request_id) +} +inline std::string* StopContainersStatusRequest::_internal_mutable_request_id() { + _has_bits_[0] |= 0x00000001u; + return request_id_.Mutable(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); +} +inline std::string* StopContainersStatusRequest::release_request_id() { + // @@protoc_insertion_point(field_release:StopContainersStatusRequest.request_id) + if (!_internal_has_request_id()) { + return nullptr; + } + _has_bits_[0] &= ~0x00000001u; + return request_id_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); +} +inline void StopContainersStatusRequest::set_allocated_request_id(std::string* request_id) { + if (request_id != nullptr) { + _has_bits_[0] |= 0x00000001u; + } else { + _has_bits_[0] &= ~0x00000001u; + } + request_id_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), request_id, + GetArena()); + // @@protoc_insertion_point(field_set_allocated:StopContainersStatusRequest.request_id) +} +inline std::string* StopContainersStatusRequest::unsafe_arena_release_request_id() { + // @@protoc_insertion_point(field_unsafe_arena_release:StopContainersStatusRequest.request_id) + GOOGLE_DCHECK(GetArena() != nullptr); + _has_bits_[0] &= ~0x00000001u; + return request_id_.UnsafeArenaRelease(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), + GetArena()); +} +inline void StopContainersStatusRequest::unsafe_arena_set_allocated_request_id( + std::string* request_id) { + GOOGLE_DCHECK(GetArena() != nullptr); + if (request_id != nullptr) { + _has_bits_[0] |= 0x00000001u; + } else { + _has_bits_[0] &= ~0x00000001u; + } + request_id_.UnsafeArenaSetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), + request_id, GetArena()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:StopContainersStatusRequest.request_id) +} + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// StopContainersResponse + +// .ShutdownStatus status = 1; +inline bool StopContainersResponse::_internal_has_status() const { + bool value = (_has_bits_[0] & 0x00000002u) != 0; + return value; +} +inline bool StopContainersResponse::has_status() const { + return _internal_has_status(); +} +inline void StopContainersResponse::clear_status() { + status_ = 0; + _has_bits_[0] &= ~0x00000002u; +} +inline ::ShutdownStatus StopContainersResponse::_internal_status() const { + return static_cast< ::ShutdownStatus >(status_); +} +inline ::ShutdownStatus StopContainersResponse::status() const { + // @@protoc_insertion_point(field_get:StopContainersResponse.status) + return _internal_status(); +} +inline void StopContainersResponse::_internal_set_status(::ShutdownStatus value) { + _has_bits_[0] |= 0x00000002u; + status_ = value; +} +inline void StopContainersResponse::set_status(::ShutdownStatus value) { + _internal_set_status(value); + // @@protoc_insertion_point(field_set:StopContainersResponse.status) +} + +// string error_message = 2; +inline bool StopContainersResponse::_internal_has_error_message() const { + bool value = (_has_bits_[0] & 0x00000001u) != 0; + return value; +} +inline bool StopContainersResponse::has_error_message() const { + return _internal_has_error_message(); +} +inline void StopContainersResponse::clear_error_message() { + error_message_.ClearToEmpty(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); + _has_bits_[0] &= ~0x00000001u; +} +inline const std::string& StopContainersResponse::error_message() const { + // @@protoc_insertion_point(field_get:StopContainersResponse.error_message) + return _internal_error_message(); +} +inline void StopContainersResponse::set_error_message(const std::string& value) { + _internal_set_error_message(value); + // @@protoc_insertion_point(field_set:StopContainersResponse.error_message) +} +inline std::string* StopContainersResponse::mutable_error_message() { + // @@protoc_insertion_point(field_mutable:StopContainersResponse.error_message) + return _internal_mutable_error_message(); +} +inline const std::string& StopContainersResponse::_internal_error_message() const { + return error_message_.Get(); +} +inline void StopContainersResponse::_internal_set_error_message(const std::string& value) { + _has_bits_[0] |= 0x00000001u; + error_message_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value, GetArena()); +} +inline void StopContainersResponse::set_error_message(std::string&& value) { + _has_bits_[0] |= 0x00000001u; + error_message_.Set( + &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArena()); + // @@protoc_insertion_point(field_set_rvalue:StopContainersResponse.error_message) +} +inline void StopContainersResponse::set_error_message(const char* value) { + GOOGLE_DCHECK(value != nullptr); + _has_bits_[0] |= 0x00000001u; + error_message_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArena()); + // @@protoc_insertion_point(field_set_char:StopContainersResponse.error_message) +} +inline void StopContainersResponse::set_error_message(const char* value, + size_t size) { + _has_bits_[0] |= 0x00000001u; + error_message_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArena()); + // @@protoc_insertion_point(field_set_pointer:StopContainersResponse.error_message) +} +inline std::string* StopContainersResponse::_internal_mutable_error_message() { + _has_bits_[0] |= 0x00000001u; + return error_message_.Mutable(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); +} +inline std::string* StopContainersResponse::release_error_message() { + // @@protoc_insertion_point(field_release:StopContainersResponse.error_message) + if (!_internal_has_error_message()) { + return nullptr; + } + _has_bits_[0] &= ~0x00000001u; + return error_message_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); +} +inline void StopContainersResponse::set_allocated_error_message(std::string* error_message) { + if (error_message != nullptr) { + _has_bits_[0] |= 0x00000001u; + } else { + _has_bits_[0] &= ~0x00000001u; + } + error_message_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), error_message, + GetArena()); + // @@protoc_insertion_point(field_set_allocated:StopContainersResponse.error_message) +} +inline std::string* StopContainersResponse::unsafe_arena_release_error_message() { + // @@protoc_insertion_point(field_unsafe_arena_release:StopContainersResponse.error_message) + GOOGLE_DCHECK(GetArena() != nullptr); + _has_bits_[0] &= ~0x00000001u; + return error_message_.UnsafeArenaRelease(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), + GetArena()); +} +inline void StopContainersResponse::unsafe_arena_set_allocated_error_message( + std::string* error_message) { + GOOGLE_DCHECK(GetArena() != nullptr); + if (error_message != nullptr) { + _has_bits_[0] |= 0x00000001u; + } else { + _has_bits_[0] &= ~0x00000001u; + } + error_message_.UnsafeArenaSetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), + error_message, GetArena()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:StopContainersResponse.error_message) +} + +// map container_status = 3; +inline int StopContainersResponse::_internal_container_status_size() const { + return container_status_.size(); +} +inline int StopContainersResponse::container_status_size() const { + return _internal_container_status_size(); +} +inline void StopContainersResponse::clear_container_status() { + container_status_.Clear(); +} +inline const ::PROTOBUF_NAMESPACE_ID::Map< std::string, ::ContainerStatus >& +StopContainersResponse::_internal_container_status() const { + return container_status_.GetMap(); +} +inline const ::PROTOBUF_NAMESPACE_ID::Map< std::string, ::ContainerStatus >& +StopContainersResponse::container_status() const { + // @@protoc_insertion_point(field_map:StopContainersResponse.container_status) + return _internal_container_status(); +} +inline ::PROTOBUF_NAMESPACE_ID::Map< std::string, ::ContainerStatus >* +StopContainersResponse::_internal_mutable_container_status() { + return container_status_.MutableMap(); +} +inline ::PROTOBUF_NAMESPACE_ID::Map< std::string, ::ContainerStatus >* +StopContainersResponse::mutable_container_status() { + // @@protoc_insertion_point(field_mutable_map:StopContainersResponse.container_status) + return _internal_mutable_container_status(); +} + +#ifdef __GNUC__ + #pragma GCC diagnostic pop +#endif // __GNUC__ +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + + +// @@protoc_insertion_point(namespace_scope) + + +PROTOBUF_NAMESPACE_OPEN + +template <> struct is_proto_enum< ::ShutdownStatus> : ::std::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::ShutdownStatus>() { + return ::ShutdownStatus_descriptor(); +} + +PROTOBUF_NAMESPACE_CLOSE + +// @@protoc_insertion_point(global_scope) + +#include +#endif // GOOGLE_PROTOBUF_INCLUDED_GOOGLE_PROTOBUF_INCLUDED_rebootbackend_2fcontainer_5fstop_2eproto diff --git a/src/sonic-framework/rebootbackend/container_stop.proto b/src/sonic-framework/rebootbackend/container_stop.proto new file mode 100644 index 000000000000..a748c29638ea --- /dev/null +++ b/src/sonic-framework/rebootbackend/container_stop.proto @@ -0,0 +1,30 @@ +syntax = "proto3"; + +message StopContainersRequest { + optional string request_id = 1; + repeated string container_names = 2; +} + +enum ShutdownStatus { + NOT_STARTED = 0; // The thread has not been started + WAITING_FOR_NICE_SHUTDOWN = 1; // Nice ("kill") shutdown has been initiated + WAITING_FOR_FORCE_SHUTDOWN = + 2; // Force shutdown ("kill -9") has been initiated + DONE = 3; // Shutdown is complete + ERROR = 4; // An error was encountered +} + +message ContainerStatus { + optional ShutdownStatus status = 1; + optional string error_message = 2; +} + +message StopContainersStatusRequest { + optional string request_id = 1; +} + +message StopContainersResponse { + optional ShutdownStatus status = 1; + optional string error_message = 2; + map container_status = 3; +} diff --git a/src/sonic-framework/rebootbackend/gnoi_container_shutdown.xml b/src/sonic-framework/rebootbackend/gnoi_container_shutdown.xml new file mode 100644 index 000000000000..fb134889d0a8 --- /dev/null +++ b/src/sonic-framework/rebootbackend/gnoi_container_shutdown.xml @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/src/sonic-framework/rebootbackend/gnoi_container_shutdown_dbus.h b/src/sonic-framework/rebootbackend/gnoi_container_shutdown_dbus.h new file mode 100644 index 000000000000..727f42bb842d --- /dev/null +++ b/src/sonic-framework/rebootbackend/gnoi_container_shutdown_dbus.h @@ -0,0 +1,75 @@ + +/* + * This file was automatically generated by dbusxx-xml2cpp; DO NOT EDIT! + */ + +#ifndef __dbusxx__rebootbackend_gnoi_container_shutdown_dbus_h__PROXY_MARSHAL_H +#define __dbusxx__rebootbackend_gnoi_container_shutdown_dbus_h__PROXY_MARSHAL_H + +#include +#include + +namespace org { +namespace SONiC { +namespace HostService { + +class gnoi_container_shutdown_proxy +: public ::DBus::InterfaceProxy +{ +public: + + gnoi_container_shutdown_proxy() + : ::DBus::InterfaceProxy("org.SONiC.HostService.gnoi_container_shutdown") + { + } + +public: + + /* properties exported by this interface */ +public: + + /* methods exported by this interface, + * this functions will invoke the corresponding methods on the remote objects + */ + void stop_container(const std::vector< std::string >& options, int32_t& argout0, std::string& argout1) + { + ::DBus::CallMessage call; + ::DBus::MessageIter wi = call.writer(); + + wi << options; + call.member("stop_container"); + ::DBus::Message ret = invoke_method (call); + ::DBus::MessageIter ri = ret.reader(); + + ri >> argout0; + ri >> argout1; + } + + void stop_container_status(const std::vector< std::string >& options, int32_t& argout0, std::string& argout1) + { + ::DBus::CallMessage call; + ::DBus::MessageIter wi = call.writer(); + + wi << options; + call.member("stop_container_status"); + ::DBus::Message ret = invoke_method (call); + ::DBus::MessageIter ri = ret.reader(); + + ri >> argout0; + ri >> argout1; + } + + +public: + + /* signal handlers for this interface + */ + +private: + + /* unmarshalers (to unpack the DBus message before calling the actual signal handler) + */ +}; + +} } } +#endif //__dbusxx__rebootbackend_gnoi_container_shutdown_dbus_h__PROXY_MARSHAL_H diff --git a/src/sonic-framework/rebootbackend/gnoi_reboot.xml b/src/sonic-framework/rebootbackend/gnoi_reboot.xml new file mode 100644 index 000000000000..1f785a3745cd --- /dev/null +++ b/src/sonic-framework/rebootbackend/gnoi_reboot.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/src/sonic-framework/rebootbackend/gnoi_reboot_dbus.h b/src/sonic-framework/rebootbackend/gnoi_reboot_dbus.h new file mode 100644 index 000000000000..bde79f7c3873 --- /dev/null +++ b/src/sonic-framework/rebootbackend/gnoi_reboot_dbus.h @@ -0,0 +1,72 @@ + +/* + * This file was automatically generated by dbusxx-xml2cpp; DO NOT EDIT! + */ + +#ifndef __dbusxx__rebootbackend_gnoi_reboot_dbus_h__PROXY_MARSHAL_H +#define __dbusxx__rebootbackend_gnoi_reboot_dbus_h__PROXY_MARSHAL_H + +#include +#include + +namespace org { +namespace SONiC { +namespace HostService { + +class gnoi_reboot_proxy +: public ::DBus::InterfaceProxy +{ +public: + + gnoi_reboot_proxy() + : ::DBus::InterfaceProxy("org.SONiC.HostService.gnoi_reboot") + { + } + +public: + + /* properties exported by this interface */ +public: + + /* methods exported by this interface, + * this functions will invoke the corresponding methods on the remote objects + */ + void issue_reboot(const std::vector< std::string >& options, int32_t& argout0, std::string& argout1) + { + ::DBus::CallMessage call; + ::DBus::MessageIter wi = call.writer(); + + wi << options; + call.member("issue_reboot"); + ::DBus::Message ret = invoke_method (call); + ::DBus::MessageIter ri = ret.reader(); + + ri >> argout0; + ri >> argout1; + } + + void get_reboot_status(int32_t& argout0, std::string& argout1) + { + ::DBus::CallMessage call; + call.member("get_reboot_status"); + ::DBus::Message ret = invoke_method (call); + ::DBus::MessageIter ri = ret.reader(); + + ri >> argout0; + ri >> argout1; + } + + +public: + + /* signal handlers for this interface + */ + +private: + + /* unmarshalers (to unpack the DBus message before calling the actual signal handler) + */ +}; + +} } } +#endif //__dbusxx__rebootbackend_gnoi_reboot_dbus_h__PROXY_MARSHAL_H diff --git a/src/sonic-framework/rebootbackend/init_thread.cpp b/src/sonic-framework/rebootbackend/init_thread.cpp new file mode 100644 index 000000000000..27775cf84d2d --- /dev/null +++ b/src/sonic-framework/rebootbackend/init_thread.cpp @@ -0,0 +1,534 @@ +#include "init_thread.h" + +#include +#include + +#include +#include +#include +#include +#include +#include + +//#include "component_state_helper.h" +#include "dbconnector.h" +#include "logger.h" +#include "notificationproducer.h" +#include "reboot_interfaces.h" +#include "rebootbe.h" +#include "redis_utils.h" +#include "redisselect.h" +#include "select.h" +#include "selectableevent.h" +#include "selectabletimer.h" +//#include "stateverification.h" +#include "status_code_util.h" +#include "subscriberstatetable.h" +#include "warm_restart.h" + +namespace rebootbackend { + +using WarmStartState = ::swss::WarmStart::WarmStartState; +//using WarmBootStage = ::swss::WarmStart::WarmBootStage; + +InitThread::InitThread( +// CriticalStateInterface &critical_interface, + TelemetryInterface &telemetry_interface, + swss::SelectableEvent &m_finished, + swss::SelectableEvent &m_stack_unfrozen) + : m_db("STATE_DB", 0), + m_finished(m_finished), + m_stack_unfrozen(m_stack_unfrozen), +// m_critical_interface(critical_interface), + m_telemetry(telemetry_interface) {} + +swss::StatusCode InitThread::Start() { + swss::StatusCode result = internal_start(); + if (result != swss::StatusCode::SWSS_RC_SUCCESS) { + do_final_failed_actions(); + m_status.set_inactive(); + } + return result; +} + +swss::StatusCode InitThread::internal_start() { + SWSS_LOG_ENTER(); + + /* if (m_critical_interface.is_system_critical()) { + const std::string error_string = + "InitThread: in critical state, not starting stack."; + SWSS_LOG_ERROR("%s", error_string.c_str()); + m_status.set_start_status(); + m_status.set_error( + InitThreadStatus::ErrorCondition::DETECTED_CRITICAL_STATE, + error_string); + return swss::StatusCode::SWSS_RC_FAILED_PRECONDITION; + } */ + + m_status.set_start_status(); + + try { + m_thread = std::thread(&InitThread::init_thread, this); + } catch (const std::system_error &e) { + std::string error_string = "Exception launching init thread: "; + error_string += e.what(); + SWSS_LOG_ERROR("%s", error_string.c_str()); + + m_status.set_error(InitThreadStatus::ErrorCondition::INTERNAL_ERROR, + error_string); + + return swss::StatusCode::SWSS_RC_INTERNAL; + } + return swss::StatusCode::SWSS_RC_SUCCESS; +} + +void InitThread::init_thread(void) { + SWSS_LOG_ENTER(); + + // Check if stop was requested before m_stop was constructed. If m_stop has + // been signaled already, this will be caught in later Select's. + if (sigterm_requested) { + const std::string error_string = "sigterm_requested was raised, exiting"; + SWSS_LOG_ERROR("%s", error_string.c_str()); + m_status.set_error(InitThreadStatus::ErrorCondition::INTERNAL_ERROR, + error_string); + do_final_failed_actions(); + m_finished.notify(); + return; + } + + swss::SelectableTimer registration_reconciliation_timer( + timespec{.tv_sec = m_reconciliation_timeout, .tv_nsec = 0}); + registration_reconciliation_timer.start(); + + m_status.set_detailed_thread_status( + InitThreadStatus::ThreadStatus::WAITING_FOR_REGISTRATION); + swss::StatusCode result = + handle_registration_step(registration_reconciliation_timer); + if (result != swss::StatusCode::SWSS_RC_SUCCESS) { + m_status.set_error(InitThreadStatus::ErrorCondition::REGISTRATION_FAILED, + "Registration failed with error"); + do_final_failed_actions(); + m_finished.notify(); + return; + } + + m_status.set_detailed_thread_status( + InitThreadStatus::ThreadStatus::WAITING_FOR_RECONCILIATION); + // Reconciliation start time is recorded by the platform layer when the + // database is started. + + /* result = handle_reconciliation_step(registration_reconciliation_timer); + if (result == swss::StatusCode::SWSS_RC_SUCCESS) { + m_telemetry.record_stage_end(WarmBootStage::STAGE_RECONCILIATION, + true); + } else { + m_status.set_error(InitThreadStatus::ErrorCondition::RECONCILIATION_FAILED, + "Reconciliation failed with error"); + m_telemetry.record_stage_end(WarmBootStage::STAGE_RECONCILIATION, + false); + do_final_failed_actions(); + m_finished.notify(); + return; + } */ + + registration_reconciliation_timer.stop(); + +/* bool state_verification_enabled = + swss::WarmStart::isStateVerificationBootupEnabled(); + if (state_verification_enabled) { + m_status.set_detailed_thread_status( + InitThreadStatus::ThreadStatus::WAITING_FOR_STATE_VERIFICATION); + result = handle_state_verification_step(); + if (result != swss::StatusCode::SWSS_RC_SUCCESS) { + m_status.set_error( + InitThreadStatus::ErrorCondition::STATE_VERIFICATION_FAILED, + "State verification failed with error"); + do_final_failed_actions(); + m_finished.notify(); + return; + } + + m_telemetry.record_stage_start(WarmBootStage::STAGE_UNFREEZE); + send_nsf_manager_notification( + m_db, swss::WarmStart::WarmBootNotification::kUnfreeze); + m_stack_unfrozen.notify(); + + m_status.set_detailed_thread_status( + InitThreadStatus::ThreadStatus::WAITING_FOR_UNFREEZE); + + result = handle_unfreeze_step(); + if (result == swss::StatusCode::SWSS_RC_SUCCESS) { + m_telemetry.record_stage_end(WarmBootStage::STAGE_UNFREEZE, + true); + } else { + m_status.set_error(InitThreadStatus::ErrorCondition::UNFREEZE_FAILED, + "Unfreeze failed with error"); + m_telemetry.record_stage_end(WarmBootStage::STAGE_UNFREEZE, + false); + do_final_failed_actions(); + m_finished.notify(); + return; + } + } else { + SWSS_LOG_NOTICE("Skipping state verification and unfreeze polling"); + } */ + + m_telemetry.record_overall_end(/*success=*/true); + // We've completed warm restart: clear the flag + set_warm_restart_enable(m_db, false); + m_status.set_success(); + // Notify calling thread that init thread has exited. + // Calling thread MUST call Join() to join and set thread status to inactive. + m_finished.notify(); + SWSS_LOG_NOTICE( + "InitThread done post-boot steps. System unblocked for future warmboots"); +} + +void InitThread::Stop(void) { + SWSS_LOG_ENTER(); + m_stop.notify(); +} + +bool InitThread::Join(void) { + SWSS_LOG_ENTER(); + + if (!m_thread.joinable()) { + SWSS_LOG_ERROR("InitThread::Join called, but not joinable"); + return false; + } + + bool ret = true; + try { + m_thread.join(); + m_status.set_inactive(); + } catch (const std::system_error &e) { + SWSS_LOG_ERROR("Exception calling join: %s", e.what()); + ret = false; + } + return ret; +} + +InitThreadStatus::DetailedStatus InitThread::GetDetailedStatus() { + return m_status.get_detailed_thread_status(); +} + +gnoi::system::RebootStatusResponse InitThread::GetResponse() { + return m_status.get_response(); +} + +InitThread::SelectStatus InitThread::ToSelectStatus( + Registration::Response result) { + switch (result.status) { + case Registration::Status::COMPLETED: { + return SelectStatus::SUCCESS; + } + case Registration::Status::FAILURE: { + return SelectStatus::FAILURE; + } + case Registration::Status::IN_PROCESS: { + return SelectStatus::KEEP_WAITING; + } + } + return SelectStatus::FAILURE; +} + +InitThread::SelectStatus InitThread::ToSelectStatus( + InitRegistration::Status status) { + switch (status) { + case InitRegistration::Status::COMPLETED: { + return SelectStatus::SUCCESS; + } + case InitRegistration::Status::IN_PROGRESS: { + return SelectStatus::KEEP_WAITING; + } + } + return SelectStatus::FAILURE; +} + +swss::StatusCode InitThread::ToStatusCode(SelectStatus select_status) { + switch (select_status) { + case SelectStatus::SUCCESS: { + return swss::StatusCode::SWSS_RC_SUCCESS; + } + case SelectStatus::FAILURE: { + return swss::StatusCode::SWSS_RC_INTERNAL; + } + case SelectStatus::KEEP_WAITING: { + return swss::StatusCode::SWSS_RC_INTERNAL; + } + } + return swss::StatusCode::SWSS_RC_INTERNAL; +} + +void InitThread::do_final_failed_actions() { + SWSS_LOG_ENTER(); + InitThreadStatus::DetailedStatus detailed_status = + m_status.get_detailed_thread_status(); + if (detailed_status.detailed_thread_status == + InitThreadStatus::ThreadStatus::ERROR && + detailed_status.detailed_thread_error_condition == + InitThreadStatus::ErrorCondition::UNFREEZE_FAILED) { + SWSS_LOG_NOTICE( + "Error occurred after sending unfreeze, raising minor alarm"); + } +/* m_critical_interface.report_minor_alarm( + "Encountered error during unfreeze"); + } else if (!m_critical_interface.is_system_critical()) { + SWSS_LOG_NOTICE( + "Error occured and system is not already critical, raising critical " + "state"); + m_critical_interface.report_critical_state( + "Encountered error with InitThread in state: " + + std::to_string(detailed_status.detailed_thread_error_condition)); + } */ + set_warm_restart_enable(m_db, false); + m_telemetry.record_overall_end(/*success=*/false); +} + +swss::StatusCode InitThread::handle_registration_step( + swss::SelectableTimer &timer_select) { + SWSS_LOG_ENTER(); + SWSS_LOG_NOTICE("Starting InitThread Registration step"); + + // TODO(b/322034421): Improve critical state detection. +/* if (m_critical_interface.is_system_critical()) { + SWSS_LOG_ERROR("InitThread: in critical state, not unfreezing stack."); + return swss::StatusCode::SWSS_RC_FAILED_PRECONDITION; + } */ + +/* swss::SubscriberStateTable table_sub( + &m_db, STATE_WARM_RESTART_REGISTRATION_TABLE_NAME); */ + + InitRegistration init_registration; + init_registration.fetch_init_app_info(); + SWSS_LOG_NOTICE("Waiting for apps to reregister: %s", + init_registration.join_pending_apps().c_str()); + /* auto initial_check_lambda = [&]() { + return InitThread::ToSelectStatus( + init_registration.check_reregistration_status()); + }; + auto handle_table_event_lambda = + [&](const swss::KeyOpFieldsValuesTuple &kco) { + return InitThread::ToSelectStatus( + init_registration.handle_registration_event(kco)); + }; */ + + /* swss::StatusCode result = select_loop( + // timer_select, table_sub, initial_check_lambda, handle_table_event_lambda); + timer_select, initial_check_lambda, handle_table_event_lambda); + if (result == swss::StatusCode::SWSS_RC_SUCCESS) { + SWSS_LOG_NOTICE("InitThread Registration step reported success"); + } else { + SWSS_LOG_ERROR( + "Error while waiting for re-registration: missing apps: %s Error " + "text: %s", + init_registration.join_pending_apps().c_str(), + swss::statusCodeToStr(result).c_str()); + } + return result; */ + return swss::StatusCode::SWSS_RC_SUCCESS; +} + +/* swss::StatusCode InitThread::handle_reconciliation_step( + swss::SelectableTimer &timer_select) { + SWSS_LOG_ENTER(); + SWSS_LOG_NOTICE("Starting InitThread Reconciliation step"); + + // TODO(b/322034421): Improve critical state detection. + if (m_critical_interface.is_system_critical()) { + SWSS_LOG_ERROR("InitThread: in critical state, not unfreezing stack."); + return swss::StatusCode::SWSS_RC_FAILED_PRECONDITION; + } + + // Precise error logged within. + swss::StatusCode result = + wait_for_state(WarmBootStage::STAGE_RECONCILIATION, timer_select); + SWSS_LOG_NOTICE("InitThread Reconciliation step finished with status: %s", + swss::statusCodeToStr(result).c_str()); + return result; +} */ + +/* swss::StatusCode InitThread::handle_unfreeze_step() { + SWSS_LOG_ENTER(); + SWSS_LOG_NOTICE("Starting InitThread Unfreeze step"); + + // TODO(b/322034421): Improve critical state detection. + if (m_critical_interface.is_system_critical()) { + SWSS_LOG_ERROR( + "InitThread: in critical state, not monitoring for stack unfreeze"); + return swss::StatusCode::SWSS_RC_FAILED_PRECONDITION; + } + + swss::SelectableTimer timer_select( + timespec{.tv_sec = m_unfreeze_timeout, .tv_nsec = 0}); + timer_select.start(); + + // Precise error logged within. + swss::StatusCode result = + wait_for_state(WarmBootStage::STAGE_UNFREEZE, timer_select); + SWSS_LOG_NOTICE("InitThread Unfreeze step finished with status: %s", + swss::statusCodeToStr(result).c_str()); + return result; +} */ + +/* swss::StatusCode InitThread::wait_for_state( + WarmBootStage nsf_stage, + swss::SelectableTimer &timer_select) { + swss::SubscriberStateTable table_sub(&m_db, STATE_WARM_RESTART_TABLE_NAME); + + const std::string stage_name = + Registration::get_warm_boot_stage_name(nsf_stage); + Registration registration; + registration.fetch_registration_info(); + SWSS_LOG_NOTICE("Waiting for apps: %s to reach state: %s", + registration.join_pending_apps(nsf_stage).c_str(), + stage_name.c_str()); + auto initial_check_lambda = [&]() { + return InitThread::ToSelectStatus(registration.check_stage(nsf_stage)); + }; + auto handle_table_event_lambda = + [&](const swss::KeyOpFieldsValuesTuple &kco) { + return InitThread::ToSelectStatus( + registration.handle_state_event(nsf_stage, kco)); + }; + + swss::StatusCode result = select_loop( + timer_select, table_sub, initial_check_lambda, handle_table_event_lambda); + if (result == swss::StatusCode::SWSS_RC_SUCCESS) { + SWSS_LOG_NOTICE("All apps reached state: %s", stage_name.c_str()); + } else { + SWSS_LOG_ERROR( + "Error while waiting for state: %s missing apps: %s Error " + "text: %s", + stage_name.c_str(), registration.join_pending_apps(nsf_stage).c_str(), + swss::statusCodeToStr(result).c_str()); + } + return result; +} */ + +/* swss::StatusCode InitThread::handle_state_verification_step() { + SWSS_LOG_ENTER(); + SWSS_LOG_NOTICE("Starting InitThread State Verfication step"); + + // TODO(b/322034421): Improve critical state detection. + if (m_critical_interface.is_system_critical()) { + SWSS_LOG_ERROR("InitThread: in critical state, not unfreezing stack."); + return swss::StatusCode::SWSS_RC_FAILED_PRECONDITION; + } + + swss::SubscriberStateTable table_sub(&m_db, STATE_VERIFICATION_RESP_TABLE); + swss::SelectableTimer timer_select( + timespec{.tv_sec = m_state_verification_timeout, .tv_nsec = 0}); + timer_select.start(); + + std::string timestamp = + send_state_verification_notification(m_db, true); + SWSS_LOG_NOTICE("State verification triggered, waiting for result"); + + auto initial_check_lambda = [&]() -> SelectStatus { + return SelectStatus::KEEP_WAITING; + }; + auto handle_verification_event_lambda = + [&](const swss::KeyOpFieldsValuesTuple &kco) -> SelectStatus { + if (kfvKey(kco) != ALL_COMPONENT) { + return SelectStatus::KEEP_WAITING; + } + + std::string status; + std::string ts; + for (const auto &fv : kfvFieldsValues(kco)) { + if (fvField(fv) == TIMESTAMP_FIELD) { + ts = fvValue(fv); + } else if (fvField(fv) == STATUS_FIELD) { + status = fvValue(fv); + } + } + + if (ts != timestamp) { + return SelectStatus::KEEP_WAITING; + } + + if (status == SV_PASS) { + SWSS_LOG_NOTICE("State verification reported success"); + return SelectStatus::SUCCESS; + } else if (status == SV_NOT_RUN) { + const std::string message = + "State verification did not run. Treating as success for NSF"; + SWSS_LOG_WARN("%s", message.c_str()); + m_critical_interface.report_minor_alarm(message); + return SelectStatus::SUCCESS; + } else if (status == SV_FAIL) { + SWSS_LOG_ERROR("State verification reported failure"); + return SelectStatus::FAILURE; + } + return SelectStatus::KEEP_WAITING; + }; + + swss::StatusCode result = + select_loop(timer_select, table_sub, initial_check_lambda, + handle_verification_event_lambda); + if (result == swss::StatusCode::SWSS_RC_DEADLINE_EXCEEDED) { + SWSS_LOG_WARN("State verification timed out, raising minor alarm: %s", + swss::statusCodeToStr(result).c_str()); + m_critical_interface.report_minor_alarm( + "State verification timed out. Treating as success for NSF"); + return swss::StatusCode::SWSS_RC_SUCCESS; + } else if (result != swss::StatusCode::SWSS_RC_SUCCESS) { + SWSS_LOG_ERROR("Error while waiting for state verification: %s", + swss::statusCodeToStr(result).c_str()); + } + return result; +} */ + +/* swss::StatusCode InitThread::select_loop( + swss::Selectable &timer_select, swss::SubscriberStateTable &table_sub, + const std::function &initial_check, + const std::function &table_event_callback) { + SWSS_LOG_ENTER(); + + swss::Select s; + s.addSelectable(&m_stop); + s.addSelectable(&table_sub); + s.addSelectable(&timer_select); + + SelectStatus select_status = initial_check(); + if (select_status != SelectStatus::KEEP_WAITING) { + return ToStatusCode(select_status); + } + + while (true) { + swss::Selectable *sel; + int select_result; + select_result = s.select(&sel); + + if (select_result == swss::Select::ERROR) { + SWSS_LOG_ERROR("Error in select loop: %s", strerror(errno)); + continue; + } else if (select_result != swss::Select::OBJECT) { + SWSS_LOG_NOTICE("Got unexpected non-object from select: %d", + select_result); + continue; + } + + if (sel == &m_stop) { + SWSS_LOG_ERROR("m_stop rx'd (SIGTERM) in select loop"); + return swss::StatusCode::SWSS_RC_INTERNAL; + } else if (sel == &timer_select) { + SWSS_LOG_ERROR("Timed out in select loop"); + return swss::StatusCode::SWSS_RC_DEADLINE_EXCEEDED; + } else if (sel == &table_sub) { + swss::KeyOpFieldsValuesTuple kco; + table_sub.pop(kco); + select_status = table_event_callback(kco); + if (select_status != SelectStatus::KEEP_WAITING) { + return ToStatusCode(select_status); + } + } else { + SWSS_LOG_ERROR("Got unexpected object event in select loop"); + } + } +} */ + +} // namespace rebootbackend diff --git a/src/sonic-framework/rebootbackend/init_thread.h b/src/sonic-framework/rebootbackend/init_thread.h new file mode 100644 index 000000000000..ca57307a297d --- /dev/null +++ b/src/sonic-framework/rebootbackend/init_thread.h @@ -0,0 +1,263 @@ +#pragma once + +#include +#include +#include +#include + +#include "dbconnector.h" +#include "notificationproducer.h" +#include "reboot_common.h" +#include "reboot_interfaces.h" +#include "redis_utils.h" +#include "select.h" +#include "selectableevent.h" +#include "selectabletimer.h" +#include "subscriberstatetable.h" +#include "system/system.pb.h" +#include "warm_restart.h" + +namespace rebootbackend { + +// Holds a thread safe representation of the InitThread internal state. +// Thread-safe: the expectation is one thread will write and multiple threads +// will read. +class InitThreadStatus { + public: + enum ThreadStatus { + NOT_STARTED = 0, + PENDING = 1, + WAITING_FOR_REGISTRATION = 2, + WAITING_FOR_RECONCILIATION = 3, + WAITING_FOR_STATE_VERIFICATION = 4, + WAITING_FOR_UNFREEZE = 5, + FINALIZE = 6, + DONE = 7, + ERROR = 8, + }; + + enum ErrorCondition { + NO_ERROR = 0, + UNKNOWN = 1, + INTERNAL_ERROR = 2, + REGISTRATION_FAILED = 3, + RECONCILIATION_FAILED = 4, + STATE_VERIFICATION_FAILED = 5, + UNFREEZE_FAILED = 6, + DETECTED_CRITICAL_STATE = 7, + }; + + struct DetailedStatus { + gnoi::system::RebootStatusResponse thread_state; + InitThreadStatus::ThreadStatus detailed_thread_status = + InitThreadStatus::ThreadStatus::NOT_STARTED; + InitThreadStatus::ErrorCondition detailed_thread_error_condition = + InitThreadStatus::ErrorCondition::NO_ERROR; + }; + + InitThreadStatus() { + m_status.detailed_thread_status = ThreadStatus::NOT_STARTED; + m_status.detailed_thread_error_condition = ErrorCondition::NO_ERROR; + + m_status.thread_state.set_active(false); + m_status.thread_state.set_method(gnoi::system::RebootMethod::COLD); + m_status.thread_state.mutable_status()->set_status( + gnoi::system::RebootStatus_Status::RebootStatus_Status_STATUS_SUCCESS); + m_status.thread_state.mutable_status()->set_message(""); + } + + void set_start_status() { + const std::lock_guard lock(m_mutex); + m_status.detailed_thread_status = ThreadStatus::PENDING; + m_status.detailed_thread_error_condition = ErrorCondition::NO_ERROR; + + m_status.thread_state.set_active(true); + m_status.thread_state.set_method(gnoi::system::RebootMethod::NSF); + m_status.thread_state.mutable_status()->set_status( + gnoi::system::RebootStatus_Status::RebootStatus_Status_STATUS_UNKNOWN); + m_status.thread_state.mutable_status()->set_message(""); + } + + bool get_active(void) { + const std::lock_guard lock(m_mutex); + return m_status.thread_state.active(); + } + + void set_detailed_thread_status(ThreadStatus new_status) { + const std::lock_guard lock(m_mutex); + if (m_status.thread_state.active()) { + m_status.detailed_thread_status = new_status; + } + } + + void set_success() { + const std::lock_guard lock(m_mutex); + if (m_status.thread_state.active()) { + m_status.detailed_thread_status = ThreadStatus::DONE; + m_status.thread_state.mutable_status()->set_status( + gnoi::system::RebootStatus_Status:: + RebootStatus_Status_STATUS_SUCCESS); + } + } + + void set_error(ErrorCondition error_condition, + const std::string &error_message) { + const std::lock_guard lock(m_mutex); + if (m_status.thread_state.active()) { + m_status.detailed_thread_status = ThreadStatus::ERROR; + m_status.detailed_thread_error_condition = error_condition; + m_status.thread_state.mutable_status()->set_status( + gnoi::system::RebootStatus_Status:: + RebootStatus_Status_STATUS_FAILURE); + m_status.thread_state.mutable_status()->set_message(error_message); + } + } + + void set_inactive() { + const std::lock_guard lock(m_mutex); + m_status.thread_state.set_active(false); + } + + DetailedStatus get_detailed_thread_status() { + const std::lock_guard lock(m_mutex); + return m_status; + } + + gnoi::system::RebootStatusResponse get_response() { + const std::lock_guard lock(m_mutex); + return m_status.thread_state; + } + + private: + std::mutex m_mutex; + DetailedStatus m_status; +}; + +class InitThread { + public: + InitThread( +// CriticalStateInterface &critical_interface, + TelemetryInterface &telemetry_interface, + swss::SelectableEvent &m_finished, + swss::SelectableEvent &m_stack_unfrozen); + virtual ~InitThread() = default; + + // Starts running the init thread tasks. Returns SWSS_RC_SUCCESS if the + // internal thread was started successfully, and an error otherwise. If an + // error is returned, this call may safely be retried, but will likely + // continue to return errors. + virtual swss::StatusCode Start(); + + // Request InitThread stop/exit. Notifies the internal thread that it must + // exit. Only used when platform is shutting down all containers/processes. + virtual void Stop(void); + + // Must be called by launching task after notification is sent to m_finished. + virtual bool Join(void); + + // Return Status of last reboot attempt. + virtual gnoi::system::RebootStatusResponse GetResponse(); + + // Returns a representation of the detailed thread status. + virtual InitThreadStatus::DetailedStatus GetDetailedStatus(); + + private: + enum class SelectStatus { SUCCESS, FAILURE, KEEP_WAITING }; + + static SelectStatus ToSelectStatus(Registration::Response result); + static SelectStatus ToSelectStatus(InitRegistration::Status status); + static swss::StatusCode ToStatusCode(SelectStatus select_status); + + // Internal implementation of Start(). Returns SWSS_RC_SUCCESS if the init + // thread was started successfully, and an error otherwise. If an error is + // returned, final cleanup actions must be taken. + swss::StatusCode internal_start(); + + // Function containing the core logic. Invoked as a separate thread. Runs + // through the steps required for reconciliation monitoring. + void init_thread(void); + + // Perform the final required actions before exiting: + // 1. Clear the NSF flag. + // 2. Record final stats (if able) + void do_final_failed_actions(); + + // Helper function for the registration step. Waits for all applications that + // had registered warmboot intent before the warmboot to re-register warmboot + // intent after the warmboot. The provided timer must already have been + // started prior to this function call. + // Returns SWSS_RC_SUCCESS if re-registration is successful, and an error + // otherwise. + swss::StatusCode handle_registration_step( + swss::SelectableTimer &timer_select); + + // Helper function for the reconciliation step. Wait for all apps to reach + // the reconcilied state. The provided timer must already have been started + // prior to this function call. + // Returns SWSS_RC_SUCCESS if waiting for reconciliation is successful, and an + // error otherwise. + swss::StatusCode handle_reconciliation_step( + swss::SelectableTimer &timer_select); + + // Helper function for the unfreeze step. Wait for all apps to reach + // the completed state. + // Returns SWSS_RC_SUCCESS if waiting for unfreeze is successful, and an + // error otherwise. + swss::StatusCode handle_unfreeze_step(); + + // Wait until all apps reach a target state, or until the provided timer + // expires. The timer must already have been started prior to this function + // call. + swss::StatusCode wait_for_state( + // swss::WarmStart::WarmBootStage nsf_stage, + swss::SelectableTimer &timer_select); + + // Helper function for the state verification step. Trigger state verification + // then wait for all apps to report successful state verification. + // Returns SWSS_RC_SUCCESS if waiting for state verification is successful, + // and an error otherwise. + swss::StatusCode handle_state_verification_step(); + + // Helper function for select loops. Sets up events for m_done, timer_select, + // and table_sub, checks if already done with initial_check, then enters + // an event handling loop, forwarding events to table_event_callback until + // the callback indicates operation is complete. + swss::StatusCode select_loop( + swss::Selectable &timer_select, + // swss::SubscriberStateTable &table_sub, + const std::function &initial_check, + const std::function + &table_event_callback); + + // Thread and internal status. + std::thread m_thread; + InitThreadStatus m_status; + + // Event handles used to notify the caller when InitThread is finished, when + // the stack is unfrozen, and pass Stop events through to the dependent + // thread to stop operation prematurely. + swss::SelectableEvent &m_finished; + swss::SelectableEvent &m_stack_unfrozen; + swss::SelectableEvent m_stop; + + // Interfaces to external systems: the Redis database and critical state + // system. + swss::DBConnector m_db; + //CriticalStateInterface &m_critical_interface; + TelemetryInterface &m_telemetry; + + // Various operation timeouts in seconds: allow unit test to shorten. + static constexpr uint32_t kReconciliationTimeout = 300; + uint32_t m_reconciliation_timeout = kReconciliationTimeout; + + // Various operation timeouts in seconds: allow unit test to shorten. + static constexpr uint32_t kStateVerificationTimeout = 180; + uint32_t m_state_verification_timeout = kStateVerificationTimeout; + + static constexpr uint32_t kUnfreezeTimeout = 60; + uint32_t m_unfreeze_timeout = kUnfreezeTimeout; + + friend class InitThreadTest; +}; + +} // namespace rebootbackend diff --git a/src/sonic-framework/rebootbackend/interfaces.cpp b/src/sonic-framework/rebootbackend/interfaces.cpp new file mode 100644 index 000000000000..6faec95d2f93 --- /dev/null +++ b/src/sonic-framework/rebootbackend/interfaces.cpp @@ -0,0 +1,133 @@ +#include "interfaces.h" + +#include // DBus + +//#include "component_state_helper.h" +#include "reboot_interfaces.h" + +constexpr char kRebootBusName[] = "org.SONiC.HostService.gnoi_reboot"; +constexpr char kRebootPath[] = "/org/SONiC/HostService/gnoi_reboot"; + +constexpr char kContainerShutdownBusName[] = "org.SONiC.HostService.gnoi_container_shutdown"; +constexpr char kContainerShutdownPath[] = "/org/SONiC/HostService/gnoi_container_shutdown"; + +// DBus::BusDispatcher dispatcher; +DBus::Connection& HostServiceDbus::getConnection(void) { + static DBus::Connection* connPtr = nullptr; + if (connPtr == nullptr) { + static DBus::BusDispatcher dispatcher; + DBus::default_dispatcher = &dispatcher; + + static DBus::Connection conn = DBus::Connection::SystemBus(); + connPtr = &conn; + } + return *connPtr; +} + +DbusInterface::DbusResponse HostServiceDbus::Reboot( + const std::string& json_reboot_request) { + int32_t status; + std::string ret_string; + std::vector options; + options.push_back(json_reboot_request); + + GnoiDbusReboot reboot_client(getConnection(), kRebootBusName, kRebootPath); + try { + reboot_client.issue_reboot(options, status, ret_string); + } catch (DBus::Error& ex) { + return DbusResponse{ + DbusStatus::DBUS_FAIL, + "HostServiceDbus::Reboot: failed to call reboot host service"}; + } + + // gnoi_reboot.py returns 0 for success, 1 for failure + if (status == 0) { + // Successful reboot response is an empty string. + return DbusResponse{DbusStatus::DBUS_SUCCESS, ""}; + } + return DbusResponse{DbusStatus::DBUS_FAIL, ret_string}; +} + +DbusInterface::DbusResponse HostServiceDbus::RebootStatus( + const std::string& json_status_request) { + int32_t status; + std::string ret_string; + + GnoiDbusReboot reboot_client(getConnection(), kRebootBusName, kRebootPath); + try { + reboot_client.get_reboot_status(status, ret_string); + } catch (DBus::Error& ex) { + return DbusResponse{ + DbusStatus::DBUS_FAIL, + "HostServiceDbus::RebootStatus: failed to call reboot status " + "host service"}; + } + + // gnoi_reboot.py returns 0 for success, 1 for failure + if (status == 0) { + return DbusResponse{DbusStatus::DBUS_SUCCESS, ret_string}; + } + return DbusResponse{DbusStatus::DBUS_FAIL, ret_string}; +} + +DbusInterface::DbusResponse HostServiceDbus::StopContainers( + const std::string& json_stop_request) { + int32_t status; + std::string ret_string; + std::vector options; + options.push_back(json_stop_request); + + GnoiDbusContainerShutdown container_client(getConnection(), kContainerShutdownBusName, + kContainerShutdownPath); + try { + container_client.stop_container(options, status, ret_string); + } catch (DBus::Error& ex) { + return DbusResponse{DbusStatus::DBUS_FAIL, + "HostServiceDbus::StopContainer: failed to call stop " + "container host service"}; + } + + // gnoi_container_shutdown.py returns 0 for success, 1 for failure + if (status == 0) { + return DbusResponse{DbusStatus::DBUS_SUCCESS, ""}; + } + return DbusResponse{DbusStatus::DBUS_FAIL, ret_string}; +} + +DbusInterface::DbusResponse HostServiceDbus::StopContainerStatus( + const std::string& json_status_request) { + int32_t status; + std::string ret_string; + std::vector options; + options.push_back(json_status_request); + + GnoiDbusContainerShutdown container_client(getConnection(), kContainerShutdownBusName, + kContainerShutdownPath); + try { + container_client.stop_container_status(options, status, ret_string); + } catch (DBus::Error& ex) { + return DbusResponse{DbusStatus::DBUS_FAIL, + "HostServiceDbus::StopContainerStatus: failed to call " + "stop container status host service"}; + } + + // gnoi_container_shutdown.py returns 0 for success, 1 for failure + if (status == 0) { + return DbusResponse{DbusStatus::DBUS_SUCCESS, ret_string}; + } + return DbusResponse{DbusStatus::DBUS_FAIL, ret_string}; +} + +/* bool CriticalState::is_system_critical() { + return swss::StateHelperManager::SystemSingleton().IsSystemCritical(); +} */ + +/* void CriticalState::report_minor_alarm(const std::string& reason) { + swss::StateHelperManager::ComponentSingleton(swss::SystemComponent::kHost) + .ReportComponentState(swss::ComponentState::kMinor, reason); +} */ + +/* void CriticalState::report_critical_state(const std::string& reason) { + swss::StateHelperManager::ComponentSingleton(swss::SystemComponent::kHost) + .ReportComponentState(swss::ComponentState::kError, reason); +} */ diff --git a/src/sonic-framework/rebootbackend/interfaces.h b/src/sonic-framework/rebootbackend/interfaces.h new file mode 100644 index 000000000000..e93037929224 --- /dev/null +++ b/src/sonic-framework/rebootbackend/interfaces.h @@ -0,0 +1,51 @@ +#pragma once +#include + +#include + +#include "gnoi_container_shutdown_dbus.h" // auto generated + // gnoi_container_shutdown_proxy +#include "gnoi_reboot_dbus.h" // auto generated gnoi_reboot_proxy +#include "reboot_interfaces.h" + +class GnoiDbusContainerShutdown + : public org::SONiC::HostService::gnoi_container_shutdown_proxy, + public DBus::IntrospectableProxy, + public DBus::ObjectProxy { + public: + GnoiDbusContainerShutdown(DBus::Connection& connection, + const char* dbus_bus_name_p, + const char* dbus_obj_name_p) + : DBus::ObjectProxy(connection, dbus_obj_name_p, dbus_bus_name_p) {} +}; + +class GnoiDbusReboot : public org::SONiC::HostService::gnoi_reboot_proxy, + public DBus::IntrospectableProxy, + public DBus::ObjectProxy { + public: + GnoiDbusReboot(DBus::Connection& connection, const char* dbus_bus_name_p, + const char* dbus_obj_name_p) + : DBus::ObjectProxy(connection, dbus_obj_name_p, dbus_bus_name_p) {} +}; + +class HostServiceDbus : public DbusInterface { + public: + DbusInterface::DbusResponse Reboot( + const std::string& json_reboot_request) override; + DbusInterface::DbusResponse RebootStatus( + const std::string& json_status_request) override; + DbusInterface::DbusResponse StopContainers( + const std::string& json_stop_request) override; + DbusInterface::DbusResponse StopContainerStatus( + const std::string& json_status_request) override; + + private: + static DBus::Connection& getConnection(void); +}; + +class CriticalState : public CriticalStateInterface { + public: + bool is_system_critical() override; + void report_minor_alarm(const std::string& reason) override; + void report_critical_state(const std::string& reason) override; +}; diff --git a/src/sonic-framework/rebootbackend/reboot_common.cpp b/src/sonic-framework/rebootbackend/reboot_common.cpp new file mode 100644 index 000000000000..e79021302bc7 --- /dev/null +++ b/src/sonic-framework/rebootbackend/reboot_common.cpp @@ -0,0 +1,14 @@ +#include "reboot_common.h" + +#include + +namespace rebootbackend { + +timespec milliseconds_to_timespec(uint64_t time_ms) { + timespec l_timespec; + l_timespec.tv_sec = time_ms / ONE_THOUSAND; + l_timespec.tv_nsec = (time_ms % ONE_THOUSAND) * ONE_THOUSAND * ONE_THOUSAND; + return l_timespec; +} + +} // namespace rebootbackend diff --git a/src/sonic-framework/rebootbackend/reboot_common.h b/src/sonic-framework/rebootbackend/reboot_common.h new file mode 100644 index 000000000000..9a6795376534 --- /dev/null +++ b/src/sonic-framework/rebootbackend/reboot_common.h @@ -0,0 +1,20 @@ +#pragma once + +#include + +#include "status_code_util.h" + +namespace rebootbackend { + +#define ONE_THOUSAND (1000) + +extern bool sigterm_requested; + +extern timespec milliseconds_to_timespec(uint64_t time_ms); + +struct NotificationResponse { + swss::StatusCode status; + std::string json_string; +}; + +} // namespace rebootbackend diff --git a/src/sonic-framework/rebootbackend/reboot_interfaces.h b/src/sonic-framework/rebootbackend/reboot_interfaces.h new file mode 100644 index 000000000000..591d2c5b23be --- /dev/null +++ b/src/sonic-framework/rebootbackend/reboot_interfaces.h @@ -0,0 +1,88 @@ +#pragma once + +#include + +#include "warm_restart.h" + +class DbusInterface { + public: + enum class DbusStatus { + DBUS_SUCCESS, + DBUS_FAIL, + }; + + struct DbusResponse { + DbusStatus status; + std::string json_string; + }; + + virtual ~DbusInterface() = default; + virtual DbusResponse Reboot(const std::string& json_reboot_request) = 0; + virtual DbusResponse RebootStatus(const std::string& json_status_request) = 0; + virtual DbusResponse StopContainers(const std::string& json_stop_request) = 0; + virtual DbusResponse StopContainerStatus( + const std::string& json_status_request) = 0; +}; + +class CriticalStateInterface { + public: + virtual ~CriticalStateInterface() = default; + virtual bool is_system_critical() = 0; + virtual void report_minor_alarm(const std::string& reason) = 0; + virtual void report_critical_state(const std::string& reason) = 0; +}; + +namespace rebootbackend { + +// Class to help interfacing with the telemetry tables in Redis. Not thread +// safe. +class TelemetryInterface { + public: + virtual ~TelemetryInterface() = default; + + // Records the warmboot start time. Also increments the warmboot counter. + // Writes entries: + // WARM_RESTART_PERFORMANCE_TABLE|system, fields: status, start-timestamp + // WARM_RESTART_PERFORMANCE_HISTORY||system + // fields: status, start-timestamp + // to the state DB. + // Must be called before snapshot_stage_start or the warmboot counter may be + // corrupted. + virtual void record_overall_start() = 0; + + // Records the warmboot end time, when all operations in the NSF boot have + // been completed. Writes to both the performance and history tables. + // Writes entries: + // WARM_RESTART_PERFORMANCE_TABLE|system, fields: status, finish-timestamp + // WARM_RESTART_PERFORMANCE_HISTORY||system + // fields: status, finish-timestamp + // to the state DB. + virtual void record_overall_end(bool success) = 0; + + // Records the start time of a particular warmboot stage. + // Writes entries: + // WARM_RESTART_PERFORMANCE_TABLE|, fields: status, start-timestamp + // WARM_RESTART_PERFORMANCE_TABLE|| + // fields: status, start-timestamp + // WARM_RESTART_PERFORMANCE_HISTORY||, + // fields: status, start-timestamp + // WARM_RESTART_PERFORMANCE_HISTORY||| + // fields: status, start-timestamp + // to the state DB. + // virtual void record_stage_start(swss::WarmStart::WarmBootStage nsf_stage) = 0; + // Records the end time of a particular warmboot stage. + // Writes entries: + // WARM_RESTART_PERFORMANCE_TABLE| + // fields: status, finish-timestamp + // WARM_RESTART_PERFORMANCE_TABLE|| + // fields: status, finish-timestamp + // WARM_RESTART_PERFORMANCE_HISTORY||, + // fields: status, finish-timestamp + // WARM_RESTART_PERFORMANCE_HISTORY||| + // fields: status, finish-timestamp + // to the state DB. + //virtual void record_stage_end(swss::WarmStart::WarmBootStage nsf_stage, + // bool success) = 0; +}; + +} // namespace rebootbackend diff --git a/src/sonic-framework/rebootbackend/reboot_thread.cpp b/src/sonic-framework/rebootbackend/reboot_thread.cpp new file mode 100644 index 000000000000..4f90d36fbfdd --- /dev/null +++ b/src/sonic-framework/rebootbackend/reboot_thread.cpp @@ -0,0 +1,965 @@ +#include "reboot_thread.h" + +#include + +#include + +//#include "component_state_helper.h" +#include "container_stop.pb.h" +#include "dbconnector.h" +#include "logger.h" +#include "notificationproducer.h" +#include "reboot_common.h" +#include "reboot_interfaces.h" +#include "redis_utils.h" +#include "select.h" +#include "selectableevent.h" +#include "selectabletimer.h" +//#include "stateverification.h" +#include "subscriberstatetable.h" +#include "system/system.pb.h" +#include "timestamp.h" +#include "warm_restart.h" + +namespace rebootbackend { + +using namespace ::gnoi::system; +using steady_clock = std::chrono::steady_clock; +using Progress = ::rebootbackend::RebootThread::Progress; +//using WarmBootStage = ::swss::WarmStart::WarmBootStage; +using WarmStartState = ::swss::WarmStart::WarmStartState; +namespace gpu = ::google::protobuf::util; + +RebootThread::RebootThread(DbusInterface &dbus_interface, +// CriticalStateInterface &critical_interface, + TelemetryInterface &telemetry_interface, + swss::SelectableEvent &m_finished) + : m_db("STATE_DB", 0), + m_finished(m_finished), + m_dbus_interface(dbus_interface), +// m_critical_interface(critical_interface), + m_telemetry(telemetry_interface) , + m_registration() {} + +void RebootThread::Stop(void) { + SWSS_LOG_ENTER(); + // Notify reboot thread that stop has been requested. + m_stop.notify(); +} + +bool RebootThread::Join(void) { + SWSS_LOG_ENTER(); + + if (!m_thread.joinable()) { + SWSS_LOG_ERROR("RebootThread::Join called, but not joinable"); + return false; + } + + try { + m_thread.join(); + m_status.set_inactive(); + return true; + } catch (const std::system_error &e) { + SWSS_LOG_ERROR("Exception calling join: %s", e.what()); + return false; + } +} + +RebootStatusResponse RebootThread::GetResponse(void) { + return m_status.get_response(); +} + +bool RebootThread::HasRun() { return m_status.get_reboot_count() > 0; } + +Progress RebootThread::platform_reboot_select(swss::Select &s, + swss::SelectableTimer &l_timer) { + SWSS_LOG_ENTER(); + + while (true) { + swss::Selectable *sel; + int select_ret; + select_ret = s.select(&sel); + + if (select_ret == swss::Select::ERROR) { + SWSS_LOG_NOTICE("Error: %s!", strerror(errno)); + } else if (select_ret == swss::Select::OBJECT) { + if (sel == &m_stop) { + // SIGTERM expected after platform reboot request + SWSS_LOG_NOTICE( + "m_stop rx'd (SIGTERM) while waiting for platform reboot"); + return Progress::EXIT_EARLY; + } else if (sel == &l_timer) { + return Progress::PROCEED; + } + } + } +} + +Progress RebootThread::wait_for_platform_reboot(swss::Select &s) { + SWSS_LOG_ENTER(); + + /* if (check_and_log_critical_state( + "system entered critical state after platfrom reboot request")) { + return Progress::EXIT_EARLY; + } */ + + // Sleep for a long time: 260 seconds. + // During this time platform should kill us as part of reboot. + swss::SelectableTimer l_timer( + timespec{.tv_sec = m_reboot_timeout, .tv_nsec = 0}); + s.addSelectable(&l_timer); + + l_timer.start(); + + Progress progress = platform_reboot_select(s, l_timer); + + l_timer.stop(); + s.removeSelectable(&l_timer); + return progress; +} + +void RebootThread::do_reboot(void) { + SWSS_LOG_ENTER(); + + swss::Select s; + s.addSelectable(&m_stop); + + // Check if stop was requested before Selectable was setup + if (sigterm_requested) { + SWSS_LOG_ERROR("sigterm_requested was raised, exiting"); + return; + } + + if (m_request.method() == RebootMethod::COLD) { + do_cold_reboot(s); + } else if (m_request.method() == RebootMethod::NSF) { + do_nsf_reboot(s); + } else { + // This shouldn't be possible. Reference check_start_preconditions() + SWSS_LOG_ERROR("Received unrecognized method type = %s", + RebootMethod_Name(m_request.method()).c_str()); + } +} + +RebootThread::Progress RebootThread::send_dbus_reboot_request() { + SWSS_LOG_ENTER(); + SWSS_LOG_NOTICE("Sending reboot request to platform"); + + std::string json_string; + gpu::Status status = gpu::MessageToJsonString(m_request, &json_string); + if (!status.ok()) { + std::string error_string = "unable to convert reboot protobuf to json: " + + status.message().as_string(); + log_error_and_set_non_retry_failure(error_string); + return Progress::EXIT_EARLY; + } + + // Send the reboot request to the reboot host service via dbus. + DbusInterface::DbusResponse dbus_response = + m_dbus_interface.Reboot(json_string); + + if (dbus_response.status == DbusInterface::DbusStatus::DBUS_FAIL) { + log_error_and_set_non_retry_failure(dbus_response.json_string); + return Progress::EXIT_EARLY; + } + return Progress::PROCEED; +} + +/* RebootThread::Progress RebootThread::nsf_reboot_helper(swss::Select &s) { + SWSS_LOG_ENTER(); + + SWSS_LOG_NOTICE("starting state verification: if enabled"); + if (Progress::EXIT_EARLY == perform_state_verification(s)) { + SWSS_LOG_ERROR("state verification returned EXIT_EARLY"); + return Progress::EXIT_EARLY; + } + + SWSS_LOG_NOTICE("starting freeze and container stop"); + m_telemetry.record_stage_start(WarmBootStage::STAGE_FREEZE); + if (Progress::EXIT_EARLY == perform_freeze_w_container_stop(s)) { + SWSS_LOG_ERROR("perform_freeze_w_container_stop: returned EXIT_EARLY"); + m_telemetry.record_stage_end(WarmBootStage::STAGE_FREEZE, + false); + return Progress::EXIT_EARLY; + } + m_telemetry.record_stage_end(WarmBootStage::STAGE_FREEZE, true); + + SWSS_LOG_NOTICE("starting checkpoint"); + m_telemetry.record_stage_start(WarmBootStage::STAGE_CHECKPOINT); + if (Progress::EXIT_EARLY == perform_checkpoint(s)) { + SWSS_LOG_ERROR("perform_checkpoint: returned EXIT_EARLY"); + m_telemetry.record_stage_end(WarmBootStage::STAGE_CHECKPOINT, + false); + return Progress::EXIT_EARLY; + } + m_telemetry.record_stage_end(WarmBootStage::STAGE_CHECKPOINT, + true); + + SWSS_LOG_NOTICE( + "done all pre-reboot steps, sending reboot request to platform"); + if (send_dbus_reboot_request() == Progress::EXIT_EARLY) { + return Progress::EXIT_EARLY; + } + + // Wait for platform to reboot. If we return, reboot failed. + // Logging, error status and monitoring for critical state are handled within. + return wait_for_platform_reboot(s); +} */ + +void RebootThread::do_nsf_reboot(swss::Select &s) { + SWSS_LOG_ENTER(); + SWSS_LOG_NOTICE("Starting NSF reboot"); + + // Delete the warm restart state and timestamp for all application + init_warm_reboot_states(m_db); + + //m_registration.fetch_registration_info(); + + // Save the list of registered apps. + // m_registration.clear_all_init_apps(); + // m_registration.save_all_init_apps(); + + m_telemetry.record_overall_start(); + + // Enable system warm restart: WARM_RESTART_ENABLE_TABLE|system + set_warm_restart_enable(m_db, true); + + /* RebootThread::Progress progress = nsf_reboot_helper(s); + if (progress == Progress::PROCEED) { + // We shouldn't be here. No errors (EXIT_EARLY) occurred during + // reboot process under our control. Platform reboot should've killed us. + log_error_and_set_non_retry_failure("platform failed to reboot"); + + // Set critical state + //m_critical_interface.report_critical_state("platform failed to reboot"); + } */ + + // NSF has failed. Either an error (EXIT_EARLY from nsf_reboot_helper) + // or platform failed to kill us after waiting m_reboot_timeout. + // Clear warm restart flag, close out telemetry. + m_telemetry.record_overall_end(/*success=*/false); + set_warm_restart_enable(m_db, false); +} + +void RebootThread::do_cold_reboot(swss::Select &s) { + SWSS_LOG_ENTER(); + SWSS_LOG_NOTICE("Sending cold reboot request to platform"); + if (send_dbus_reboot_request() == Progress::EXIT_EARLY) { + return; + } + + // Wait for platform to reboot. If we return, reboot failed. + // Logging, error status and monitoring for critical state are handled within. + if (wait_for_platform_reboot(s) == Progress::EXIT_EARLY) { + return; + } + + // We shouldn't be here. Platform reboot should've killed us. + log_error_and_set_non_retry_failure("platform failed to reboot"); + + // Set critical state + //m_critical_interface.report_critical_state("platform failed to reboot"); + return; +} + +void RebootThread::reboot_thread(void) { + SWSS_LOG_ENTER(); + + do_reboot(); + + // Notify calling thread that reboot thread has exited. + // Calling thread will call Join(): join and set thread status to inactive. + m_finished.notify(); +} + +bool RebootThread::check_start_preconditions(const RebootRequest &request, + NotificationResponse &response) { + // We have to join a previous executing thread before restarting. + // Active is cleared in Join. + if (m_status.get_active()) { + response.json_string = "RebootThread: can't Start while active"; + response.status = swss::StatusCode::SWSS_RC_IN_USE; + } else if (request.method() != RebootMethod::COLD && + request.method() != RebootMethod::NSF) { + response.json_string = "RebootThread: Start rx'd unsupported method"; + response.status = swss::StatusCode::SWSS_RC_INVALID_PARAM; + } else if (request.delay() != 0) { + response.json_string = "RebootThread: delayed start not supported"; + response.status = swss::StatusCode::SWSS_RC_INVALID_PARAM; + } else if (request.method() == RebootMethod::NSF) { + if (m_status.get_last_reboot_status() == + RebootStatus_Status::RebootStatus_Status_STATUS_FAILURE) { + // If the last reboot failed with a non-retriable failure, don't retry. + // But, we will allow a cold boot to recover. + response.json_string = + "RebootThread: last NSF failed with non-retriable failure"; + response.status = swss::StatusCode::SWSS_RC_FAILED_PRECONDITION; + } /* else if (m_critical_interface.is_system_critical()) { + response.json_string = "RebootThread: in critical state, NSF not allowed"; + response.status = swss::StatusCode::SWSS_RC_FAILED_PRECONDITION; + } */ + } + + if (response.status == swss::StatusCode::SWSS_RC_SUCCESS) { + return true; + } + + SWSS_LOG_ERROR("%s", response.json_string.c_str()); + + // Log the reboot request contents. + gpu::Status status; + std::string json_request; + status = gpu::MessageToJsonString(request, &json_request); + if (status.ok()) { + SWSS_LOG_ERROR("check_start_preconditions: RebootRequest = %s", + json_request.c_str()); + } else { + SWSS_LOG_ERROR( + "check_start_preconditions: error calling MessageToJsonString"); + } + return false; +} + +NotificationResponse RebootThread::Start(const RebootRequest &request) { + SWSS_LOG_ENTER(); + + NotificationResponse response = {.status = swss::StatusCode::SWSS_RC_SUCCESS, + .json_string = ""}; + + // Confirm we're not running, method is supported and we're not delayed. + if (!check_start_preconditions(request, response)) { + // Errors logged in check_start_preconditions. + return response; + } + + m_request = request; + + // From this point errors will be reported via RebootStatusRequest. + m_status.set_start_status(request.method(), request.message()); + + try { + m_thread = std::thread(&RebootThread::reboot_thread, this); + } catch (const std::system_error &e) { + std::string error_string = "Exception launching reboot thread: "; + error_string += e.what(); + log_error_and_set_failure_as_retriable(error_string); + + // Notify calling thread that thread has finished. + // Calling thread MUST call Join, which will join and clear active bit. + m_finished.notify(); + } + return response; +} + +/* bool RebootThread::check_and_log_critical_state( + const std::string error_string) { + SWSS_LOG_ENTER(); + if (m_critical_interface.is_system_critical()) { + // Critical state isn't retriable. + log_error_and_set_non_retry_failure(error_string); + return true; + } + return false; +} */ + +void RebootThread::log_error_and_set_non_retry_failure( + const std::string error_string) { + SWSS_LOG_ENTER(); + SWSS_LOG_ERROR("%s", error_string.c_str()); + m_status.set_completed_status( + RebootStatus_Status::RebootStatus_Status_STATUS_FAILURE, error_string); +} + +void RebootThread::log_error_and_set_failure_as_retriable( + const std::string error_string) { + SWSS_LOG_ENTER(); + SWSS_LOG_ERROR("%s", error_string.c_str()); + m_status.set_completed_status( + RebootStatus_Status::RebootStatus_Status_STATUS_RETRIABLE_FAILURE, + error_string); +} + +RebootThread::Status RebootThread::handle_state_verification_event( + swss::SubscriberStateTable &sub, std::string ×tamp) { + swss::KeyOpFieldsValuesTuple kco; + sub.pop(kco); + + std::string key = kfvKey(kco); + + /* if (key != ALL_COMPONENT) { + // we only care about updates to the "all" key + return Status::KEEP_WAITING; + } */ + + std::vector fvs = kfvFieldsValues(kco); + std::string status; + std::string ts; + + /* for (const auto &fv : fvs) { + if (fvField(fv) == TIMESTAMP_FIELD) { + ts = fvValue(fv); + } else if (fvField(fv) == STATUS_FIELD) { + status = fvValue(fv); + } + } */ + + if (ts != timestamp) { + // if this wasn't our state verification request + return Status::KEEP_WAITING; + } + + // We've received a valid state verification update + // key was ALL_COMPONENT and timestamp matched our + // last request. + + /* if (status == SV_NOT_RUN) { + // restart state verification + timestamp = send_state_verification_notification(m_db, false); + return Status::KEEP_WAITING; + } */ + + /* if (status == SV_PASS) { + return Status::SUCCESS; + } else if (status == SV_FAIL) { + // Hard failure is not retriable: not_run as final status + // is retriable. + log_error_and_set_non_retry_failure( + "state verification failed during reboot"); + return Status::FAILURE; + } */ + + return Status::KEEP_WAITING; +} + +Progress RebootThread::state_verification_select( + swss::Select &s, swss::SelectableTimer &l_timer, + swss::SubscriberStateTable &sub, std::string ×tamp) { + SWSS_LOG_ENTER(); + + while (true) { + swss::Selectable *sel; + int select_ret; + select_ret = s.select(&sel); + + if (select_ret == swss::Select::ERROR) { + SWSS_LOG_NOTICE("Error: %s!", strerror(errno)); + continue; + } + if (select_ret != swss::Select::OBJECT) { + SWSS_LOG_NOTICE("select returned unexpedted non-OBJECT"); + continue; + } + + if (sel == &m_stop) { + SWSS_LOG_ERROR("m_stop (sigterm) rx'd during reboot state verification"); + return Progress::EXIT_EARLY; + } else if (sel == &l_timer) { + // Timeout during state verification is a retriable error. + log_error_and_set_failure_as_retriable( + "timeout occurred during reboot state verification: retriable error"); + return Progress::EXIT_EARLY; + } else if (sel == &sub) { + Status status = handle_state_verification_event(sub, timestamp); + + if (status == Status::SUCCESS) { + SWSS_LOG_NOTICE("state verification reported success"); + return Progress::PROCEED; + } else if (status == Status::FAILURE) { + // error is logged and error string set in + // handle_state_verification_event. + return Progress::EXIT_EARLY; + } else { + continue; + } + } + } +} + +/* Progress RebootThread::perform_state_verification(swss::Select &s) { + if (check_and_log_critical_state( + "system entered critical state before reboot state verification")) { + return Progress::EXIT_EARLY; + } + + if (!swss::WarmStart::isStateVerificationShutdownEnabled()) { + if state verification isn't enabled in CONFIG_DB: skip state verification + SWSS_LOG_NOTICE("State verification not enabled"); + return Progress::PROCEED; + } + + swss::SelectableTimer l_timer( + timespec{.tv_sec = m_state_verification_timeout, .tv_nsec = 0}); + s.addSelectable(&l_timer); + + swss::SubscriberStateTable sub(&m_db, STATE_VERIFICATION_RESP_TABLE); + s.addSelectable(&sub); + + l_timer.start(); + + // Send a non-frozen state verifiation request. + std::string timestamp = send_state_verification_notification(m_db, false); + SWSS_LOG_NOTICE("State verification triggered, waiting for result"); + + Progress progress = state_verification_select(s, l_timer, sub, timestamp); + + l_timer.stop(); + s.removeSelectable(&l_timer); + s.removeSelectable(&sub); + return progress; +} */ + +// +// Stop On Freeze Support +// + +// Perform quiescence and container stop in parallel. +// First we request container stop. +// Freeze is sent to all containers. +// We wait for containers to quiesce (or checkpoint). +// We wait for containers to stop. +Progress RebootThread::perform_freeze_w_container_stop(swss::Select &s) { + SWSS_LOG_ENTER(); + std::string request_id; + + SWSS_LOG_NOTICE("Requesting container stop on freeze"); + if (Progress::EXIT_EARLY == request_stop_on_freeze(request_id)) { + SWSS_LOG_ERROR("request_stop_on_freeze: returned EXIT_EARLY"); + return Progress::EXIT_EARLY; + } + SWSS_LOG_NOTICE("Stop on freeze request sent."); + + swss::SelectableTimer l_timer( + milliseconds_to_timespec(m_quiescence_timeout_ms)); + s.addSelectable(&l_timer); + l_timer.start(); + + Progress progress = + wait_for_container_stop_and_quiescence(s, l_timer, request_id); + + s.removeSelectable(&l_timer); + return progress; +} + +Progress RebootThread::wait_for_container_stop_and_quiescence( + swss::Select &s, swss::SelectableTimer &l_timer, + const std::string &request_id) { + SWSS_LOG_NOTICE("waiting for containers to stop"); + if (Progress::EXIT_EARLY == wait_for_container_stop(s, request_id, l_timer)) { + SWSS_LOG_ERROR("wait_for_container_stop: returned EXIT_EARLY"); + return Progress::EXIT_EARLY; + } + + SWSS_LOG_NOTICE("starting freeze quiescence"); + /* if (Progress::EXIT_EARLY == perform_freeze_quiescence(s, l_timer)) { + SWSS_LOG_ERROR( + "perform_freeze_quiescence: returned EXIT_EARLY. Outstanding apps: %s", + m_registration + .join_pending_apps(swss::WarmStart::WarmBootStage::STAGE_FREEZE) + .c_str()); + return Progress::EXIT_EARLY; + } */ + + return Progress::PROCEED; +} + +Progress RebootThread::build_stop_container_request(std::string &json_request, + std::string &request_id) { + SWSS_LOG_ENTER(); + + request_id = swss::getTimestamp(); + StopContainersRequest request; + request.set_request_id(request_id); + + // Get the list of apps that need to be stopped + Registration::RegistrationSet stop_set = + m_registration.get_stop_on_freeze_set(); + + for (const std::string &app : stop_set) { + request.add_container_names(app); + } + + gpu::Status status = gpu::MessageToJsonString(request, &json_request); + + if (!status.ok()) { + std::string error_string = + "unable to convert StopContainersRequest protobuf to json: " + + status.message().as_string(); + log_error_and_set_non_retry_failure(error_string); + return Progress::EXIT_EARLY; + } + return Progress::PROCEED; +} + +Progress RebootThread::request_stop_on_freeze(std::string &request_id) { + SWSS_LOG_ENTER(); + + // Get the list of apps that need to be stopped + Registration::RegistrationSet stop_set = + m_registration.get_stop_on_freeze_set(); + + if (stop_set.empty()) { + return Progress::PROCEED; + } + + std::string json_request; + if (build_stop_container_request(json_request, request_id) == + Progress::EXIT_EARLY) { + return Progress::EXIT_EARLY; + } + + // Send the stop containers request to the stop container host service via + // dbus. + DbusInterface::DbusResponse dbus_response = + m_dbus_interface.StopContainers(json_request); + + if (dbus_response.status == DbusInterface::DbusStatus::DBUS_FAIL) { + log_error_and_set_non_retry_failure(dbus_response.json_string); + return Progress::EXIT_EARLY; + } + return Progress::PROCEED; +} + +RebootThread::Status RebootThread::check_container_stop( + const std::string &request_id) { + SWSS_LOG_ENTER(); + StopContainersStatusRequest request; + request.set_request_id(request_id); + + std::string json_request; + gpu::Status status = gpu::MessageToJsonString(request, &json_request); + + if (!status.ok()) { + SWSS_LOG_ERROR( + "unable to convert StopContainersStatusRequest protobuf to json: %s", + status.message().as_string().c_str()); + return Status::FAILURE; + } + + // Send the stop containers request to the stop container host service via + // dbus. + DbusInterface::DbusResponse dbus_response = + m_dbus_interface.StopContainerStatus(json_request); + + if (dbus_response.status == DbusInterface::DbusStatus::DBUS_FAIL) { + SWSS_LOG_ERROR("StopContainersStatus returned ERROR: %s", + dbus_response.json_string.c_str()); + return Status::FAILURE; + } + + StopContainersResponse response; + status = gpu::JsonStringToMessage(dbus_response.json_string, &response); + if (!status.ok()) { + SWSS_LOG_ERROR( + "unable to convert StopContainersStatus json |%s| to prototobuf: |%s|", + dbus_response.json_string.c_str(), + status.message().as_string().c_str()); + return Status::FAILURE; + } + + if (response.status() == ShutdownStatus::DONE) { + return Status::SUCCESS; + } else if (response.status() == ShutdownStatus::ERROR) { + SWSS_LOG_ERROR( + "Container stop service reported error shutting down containers: %s", + response.DebugString().c_str()); + } + return Status::KEEP_WAITING; +} + +RebootThread::Status RebootThread::precheck_wait_for_container_stop( + const std::string &request_id) { + // Get the list of apps that need to be stopped + Registration::RegistrationSet stop_set = + m_registration.get_stop_on_freeze_set(); + + if (stop_set.empty()) { + return Status::SUCCESS; + } + if (check_container_stop(request_id) == Status::SUCCESS) { + return Status::SUCCESS; + } + return Status::KEEP_WAITING; +} + +Progress RebootThread::wait_for_container_stop(swss::Select &s, + const std::string &request_id, + swss::SelectableTimer &l_timer) { + SWSS_LOG_ENTER(); + + // Have containers stopped? Are there no containers to stop? + if (Status::SUCCESS == precheck_wait_for_container_stop(request_id)) { + return Progress::PROCEED; + } + + /* if (check_and_log_critical_state("system entered critical state while " + "waiting for containers to stop")) { + return Progress::EXIT_EARLY; + } */ + + while (true) { + swss::Selectable *sel; + int select_ret; + select_ret = s.select(&sel, SELECT_TIMEOUT_500_MS); + + if (Status::SUCCESS == check_container_stop(request_id)) { + return Progress::PROCEED; + } + + if (select_ret == swss::Select::ERROR) { + SWSS_LOG_NOTICE("Error: %s!", strerror(errno)); + continue; + } + + if (select_ret == swss::Select::TIMEOUT) { + // Don't flood logs on timeout. + continue; + } + + if (select_ret != swss::Select::OBJECT) { + SWSS_LOG_NOTICE("select returned unexpected non-OBJECT"); + continue; + } + + if (sel == &m_stop) { + SWSS_LOG_NOTICE( + "m_stop (sigterm) rx'd while waiting for containers to stop"); + return Progress::EXIT_EARLY; + } else if (sel == &l_timer) { + log_error_and_set_non_retry_failure( + "timeout occurred waiting for containers to stop"); + return Progress::EXIT_EARLY; + } + } +} + +// +// Freeze Quiescence Support +// +/* Progress RebootThread::perform_freeze_quiescence( + swss::Select &s, swss::SelectableTimer &l_timer) { + SWSS_LOG_ENTER(); + if (check_and_log_critical_state( + "system entered critical state before freezing")) { + return Progress::EXIT_EARLY; + } + + swss::SubscriberStateTable sub(&m_db, STATE_WARM_RESTART_TABLE_NAME); + s.addSelectable(&sub); + + send_nsf_manager_notification(m_db, + swss::WarmStart::WarmBootNotification::kFreeze); + SWSS_LOG_NOTICE( + "freeze signal sent, waiting for apps to reach frozen state: %s", + m_registration + .join_pending_apps(swss::WarmStart::WarmBootStage::STAGE_FREEZE) + .c_str()); + + Progress progress = freeze_quiescence_select(s, l_timer, sub); + + s.removeSelectable(&sub); + return progress; +} */ + +/* Progress RebootThread::freeze_quiescence_select( + swss::Select &s, swss::SelectableTimer &l_timer, + swss::SubscriberStateTable &sub) { + SWSS_LOG_ENTER(); + + steady_clock::time_point start_time; + bool quiesced = false; + + // Check the current status of all registered apps. + Registration::Response response = m_registration.check_quiesced(); + + if (response.status == Registration::Status::FAILURE) { + log_error_and_set_non_retry_failure(response.error_string); + return Progress::EXIT_EARLY; + } + + if (response.status == Registration::Status::COMPLETED) { + // We're quiesced: set start time for 10 second quiescence hold timer + quiesced = true; + start_time = steady_clock::now(); + } + + while (true) { + swss::Selectable *sel; + int select_ret; + + // Set timeout to 250 milli-seconds. We'll wake up at least every + // quarter second and can check if quiescence hold time has passed. + select_ret = s.select(&sel, SELECT_TIMEOUT_250_MS); + + if (quiesced) { + if (steady_clock::now() - start_time > + std::chrono::milliseconds(m_quiescence_hold_time_ms)) { + // We've been quiesced for 10 seconds: we're ready to PROCEED. + return Progress::PROCEED; + } + } + + if (select_ret == swss::Select::TIMEOUT) { + // Don't flood logs on timeout. + continue; + } + + if (select_ret == swss::Select::ERROR) { + SWSS_LOG_NOTICE("Error: %s!", strerror(errno)); + continue; + } + if (select_ret != swss::Select::OBJECT) { + SWSS_LOG_NOTICE("select returned unexpected non-OBJECT"); + continue; + } + + if (sel == &m_stop) { + std::string error_string = + "m_stop (sigterm) rx'd during reboot " + + Registration::get_warm_boot_stage_name(WarmBootStage::STAGE_FREEZE); + "m_stop (sigterm) rx'd during reboot " + + Registration::get_warm_boot_stage_name(WarmBootStage::STAGE_FREEZE); + SWSS_LOG_ERROR("%s\n", error_string.c_str()); + return Progress::EXIT_EARLY; + } else if (sel == &l_timer) { + // TODO: use getWarmBootStageFromState() or warmBootStateToStageMap() + // to get warm restart stage rather state + std::string error_string = + "timeout occurred during reboot stage " + + Registration::get_warm_boot_stage_name(WarmBootStage::STAGE_FREEZE); + "timeout occurred during reboot stage " + + Registration::get_warm_boot_stage_name(WarmBootStage::STAGE_FREEZE); + log_error_and_set_non_retry_failure(error_string); + return Progress::EXIT_EARLY; + } else if (sel == &sub) { + swss::KeyOpFieldsValuesTuple kco; + sub.pop(kco); + + Registration::Response response = + m_registration.handle_state_event(WarmBootStage::STAGE_FREEZE, kco); + + if (response.status == Registration::Status::FAILURE) { + log_error_and_set_non_retry_failure(response.error_string); + return Progress::EXIT_EARLY; + } else if (response.status == Registration::Status::COMPLETED) { + // We're quiesced: set start time for 10 second quiescence hold timer + quiesced = true; + start_time = steady_clock::now(); + } else { + // Registration::Status::IN_PROCESS + quiesced = false; + } + } + } +} */ + +// +// Checkpoint support. +// +/* Progress RebootThread::perform_checkpoint(swss::Select &s) { + SWSS_LOG_ENTER(); + if (check_and_log_critical_state( + "system entered critical state before checkpointing")) { + return Progress::EXIT_EARLY; + } + + swss::SelectableTimer l_timer( + timespec{.tv_sec = m_checkpoint_timeout, .tv_nsec = 0}); + s.addSelectable(&l_timer); + + swss::SubscriberStateTable sub(&m_db, STATE_WARM_RESTART_TABLE_NAME); + s.addSelectable(&sub); + + l_timer.start(); + + send_nsf_manager_notification( + m_db, swss::WarmStart::WarmBootNotification::kCheckpoint); + SWSS_LOG_NOTICE( + "checkpoint signal sent, waiting for apps to reach checkpointed state: " + "%s", + m_registration + .join_pending_apps(swss::WarmStart::WarmBootStage::STAGE_CHECKPOINT) + .c_str()); + + Progress progress = checkpoint_select_stage_one(s, l_timer, sub); + + l_timer.stop(); + s.removeSelectable(&l_timer); + s.removeSelectable(&sub); + return progress; +} */ + +/* Progress RebootThread::checkpoint_select_stage_one( + swss::Select &s, swss::SelectableTimer &l_timer, + swss::SubscriberStateTable &sub) { + SWSS_LOG_ENTER(); + + // We're subscribed: so we wont miss any events. + // Check the current status of all registered apps. + Registration::Response response = m_registration.check_checkpointed(); + if (response.status == Registration::Status::COMPLETED) { + return Progress::PROCEED; + } + if (response.status == Registration::Status::FAILURE) { + log_error_and_set_non_retry_failure( + "check_checkpointed returned error: " + response.error_string + + ". Outstanding apps: " + + m_registration.join_pending_apps( + swss::WarmStart::WarmBootStage::STAGE_CHECKPOINT)); + return Progress::EXIT_EARLY; + } + return checkpoint_stage_two(s, l_timer, sub); +} */ + +/* Progress RebootThread::checkpoint_stage_two(swss::Select &s, + swss::SelectableTimer &l_timer, + swss::SubscriberStateTable &sub) { + while (true) { + swss::Selectable *sel; + int select_ret; + select_ret = s.select(&sel); + + if (select_ret == swss::Select::ERROR) { + SWSS_LOG_NOTICE("Error: %s!", strerror(errno)); + continue; + } + if (select_ret != swss::Select::OBJECT) { + SWSS_LOG_NOTICE("select returned unexpected non-OBJECT"); + continue; + } + + if (sel == &m_stop) { + std::string error_string = "m_stop (sigterm) rx'd during reboot " + + Registration::get_warm_boot_stage_name( + WarmBootStage::STAGE_CHECKPOINT); + SWSS_LOG_ERROR("%s\n", error_string.c_str()); + return Progress::EXIT_EARLY; + } else if (sel == &l_timer) { + // TODO: use getWarmBootStageFromState() or warmBootStateToStageMap() + // to get warm restart stage rather state + std::string error_string = + "timeout occurred during reboot stage " + + Registration::get_warm_boot_stage_name( + WarmBootStage::STAGE_CHECKPOINT) + + ". Outstanding apps: " + + m_registration.join_pending_apps( + swss::WarmStart::WarmBootStage::STAGE_CHECKPOINT); + log_error_and_set_non_retry_failure(error_string); + return Progress::EXIT_EARLY; + } else if (sel == &sub) { + swss::KeyOpFieldsValuesTuple kco; + sub.pop(kco); + Registration::Response response = m_registration.handle_state_event( + WarmBootStage::STAGE_CHECKPOINT, kco); + if (response.status == Registration::Status::COMPLETED) { + return Progress::PROCEED; + } else if (response.status == Registration::Status::FAILURE) { + log_error_and_set_non_retry_failure(response.error_string); + return Progress::EXIT_EARLY; + } else { + continue; + } + } + } +} */ + +} // namespace rebootbackend diff --git a/src/sonic-framework/rebootbackend/reboot_thread.h b/src/sonic-framework/rebootbackend/reboot_thread.h new file mode 100644 index 000000000000..3b9d42852dca --- /dev/null +++ b/src/sonic-framework/rebootbackend/reboot_thread.h @@ -0,0 +1,418 @@ +#pragma once + +#include +#include +#include + +#include "dbconnector.h" +#include "notificationproducer.h" +#include "reboot_common.h" +#include "reboot_interfaces.h" +#include "redis_utils.h" +#include "select.h" +#include "selectableevent.h" +#include "selectabletimer.h" +#include "subscriberstatetable.h" +#include "system/system.pb.h" + +namespace rebootbackend { + +#define SELECT_TIMEOUT_250_MS (250) +#define SELECT_TIMEOUT_500_MS (500) + +// Hold/manage the contents of a RebootStatusResponse as defined +// in system.proto +// Thread-safe: expectation is one thread will write and multiple +// threads can read. +class ThreadStatus { + public: + ThreadStatus() { + m_proto_status.set_active(false); + + // Reason for reboot as specified in message from a RebootRequest. + // This is "message" in RebootRequest. + m_proto_status.set_reason(""); + + // Number of reboots since active. + m_proto_status.set_count(0); + + // RebootMethod is type of of reboot: cold, nsf, warm, fast from a + // RebootRequest + m_proto_status.set_method(gnoi::system::RebootMethod::UNKNOWN); + + // Status can be UNKNOWN, SUCCESS, RETRIABLE_FAILURE or FAILURE. + m_proto_status.mutable_status()->set_status( + gnoi::system::RebootStatus_Status::RebootStatus_Status_STATUS_UNKNOWN); + + // In the event of error: message is human readable error explanation. + m_proto_status.mutable_status()->set_message(""); + } + + void set_start_status(const gnoi::system::RebootMethod &method, + const std::string &reason) { + m_mutex.lock(); + + m_proto_status.set_active(true); + m_proto_status.set_reason(reason); + m_proto_status.set_count(m_proto_status.count() + 1); + m_proto_status.set_method(method); + m_proto_status.mutable_status()->set_status( + gnoi::system::RebootStatus_Status::RebootStatus_Status_STATUS_UNKNOWN); + m_proto_status.mutable_status()->set_message(""); + + // set when to time reboot starts + std::chrono::nanoseconds ns = + std::chrono::system_clock::now().time_since_epoch(); + m_proto_status.set_when(ns.count()); + + m_mutex.unlock(); + } + + bool get_active(void) { + m_mutex.lock(); + bool ret = m_proto_status.active(); + m_mutex.unlock(); + return ret; + } + + void set_completed_status(const gnoi::system::RebootStatus_Status &status, + const std::string &message) { + m_mutex.lock(); + + // Status should only be updated while reboot is active + if (m_proto_status.active()) { + m_proto_status.mutable_status()->set_status(status); + m_proto_status.mutable_status()->set_message(message); + } + + m_mutex.unlock(); + } + + void set_inactive(void) { + m_mutex.lock(); + m_proto_status.set_active(false); + m_mutex.unlock(); + } + + int get_reboot_count() { + const std::lock_guard lock(m_mutex); + return m_proto_status.count(); + } + + gnoi::system::RebootStatus_Status get_last_reboot_status(void) { + gnoi::system::RebootStatusResponse response = get_response(); + return response.status().status(); + } + + gnoi::system::RebootStatusResponse get_response(void) { + m_mutex.lock(); + // make a copy + gnoi::system::RebootStatusResponse lstatus = m_proto_status; + m_mutex.unlock(); + + if (lstatus.active()) { + // RebootStatus isn't applicable if we're active + lstatus.mutable_status()->set_status( + gnoi::system::RebootStatus_Status:: + RebootStatus_Status_STATUS_UNKNOWN); + lstatus.mutable_status()->set_message(""); + } else { + // When is only valid while we're active (since delayed + // start isn't supported). Value is set when reboot begins. + lstatus.set_when(0); + } + + return lstatus; + } + + private: + std::mutex m_mutex; + gnoi::system::RebootStatusResponse m_proto_status; +}; + +// RebootThread performs reboot actions leading up to a platform +// request to reboot. +// thread-compatible: expectation is Stop, Start and Join will be +// called from the same thread. +class RebootThread { + public: + enum class Status { SUCCESS, FAILURE, KEEP_WAITING }; + enum class Progress { PROCEED, EXIT_EARLY }; + + // interface: dbus reboot host service access + // m_finished: let launching task know thread has finished + RebootThread(DbusInterface &dbus_interface, + // CriticalStateInterface &critical_interface, + TelemetryInterface &telemetry_interface, + swss::SelectableEvent &m_finished); + + NotificationResponse Start(const gnoi::system::RebootRequest &request); + + // Request thread stop/exit. Only used when platform is shutting down + // all containers/processes. + void Stop(void); + + // Called by launching task after notification sent to m_finished. + bool Join(void); + + // Return Status of last reboot attempt + gnoi::system::RebootStatusResponse GetResponse(); + + // Returns true if the RebootThread has been started since the last reboot, + // and false otherwise. + bool HasRun(); + + private: + void reboot_thread(void); + void do_reboot(void); + Progress send_dbus_reboot_request(); + Progress nsf_reboot_helper(swss::Select &s); + void do_nsf_reboot(swss::Select &s); + void do_cold_reboot(swss::Select &s); + + // Inner loop select handler to wait for platform reboot. + // wait for timeout + // wait for a stop request (sigterm) + // Returns: + // EXIT_EARLY: an issue occurred that stops NSF + // PROCEED: if reboot timeout expired + Progress platform_reboot_select(swss::Select &s, + swss::SelectableTimer &l_timer); + + // Wait for platform to reboot while waiting for possible stop + // Returns: + // EXIT_EARLY: an issue occurred that stops NSF + // PROCEED: if reboot timeout expired + Progress wait_for_platform_reboot(swss::Select &s); + + // Check for critical state: log error and update status. + // Returns: + // true: if system is in critical state + // false: all is well + bool check_and_log_critical_state(const std::string error_string); + + // Log error string, set status to RebootStatus_Status_STATUS_FAILURE + // Set status message to error_string. + void log_error_and_set_non_retry_failure(const std::string error_string); + + // Log error string, set status to + // RebootStatus_Status_STATUS_RETRIABLE_FAILURE Set status message to + // error_string. + void log_error_and_set_failure_as_retriable(const std::string error_string); + + // Handle a database subscription update to STATE_VERIFICATION_RESP_TABLE + // Confirm update is for the "all" component with correct timestamp. + // if update is not_run: then restart + // Args: + // sub: [input] selectable subscription to STATE_VERIFICATION_RESP_TABLE + // data is pending + // timestamp: [input && output] the timestamp sent to state verification + // with the state verification request + // Returns: + // KEEP_WAITING: keep waiting for success, fail or timeout + // SUCCESS: state verification passed, procced + // FAILURE: state verification failed + Status handle_state_verification_event(swss::SubscriberStateTable &sub, + std::string ×tamp); + + // Infinite lop select for state verification + // Listen for a stop, timer expiration or database update + // Args: + // s: select to be monitored (stop, timer, subscription) events + // l_timer: timeout expiration selectable + // sub: subscription to STATE_VERIFICATION_RESP_TABLE + // timestamp: [input] the timestamp sent with the state verification + // request. Used to match response with request. + // Returns: + // EXIT_EARLY: an issue occurred that stops NSF + // PROCEED: if reboot timeout expired + Progress state_verification_select(swss::Select &s, + swss::SelectableTimer &l_timer, + swss::SubscriberStateTable &sub, + std::string ×tamp); + + // If enabled: perform non-frozen state verification + // Check for critical state, listen for stop, handle a timeout + // Returns: + // EXIT_EARLY: an issue occurred that stops NSF + // PROCEED: if reboot timeout expired + Progress perform_state_verification(swss::Select &s); + + // Perform freeze/quiescence with container stop support. + // Request platform stop (stop on freeze) containers. + // Request applications freeze and wait for registered apps + // to quiesce or checkpoint. + // Poll platform till containers have stopped. + // Check for critical state, listen for stop, handle a timeout + // Returns: + // EXIT_EARLY: an issue occurred that stops NSF + // PROCEED: if reboot timeout expired + Progress perform_freeze_w_container_stop(swss::Select &s); + + // Wait for stop_on_freeze containers to exit, then + // wait for freeze containers to quiesce (or checkpoint). + // Check for critical state, listen for stop, handle a timeout + // Args: + // s: select to be monitored (stop, timer, subscription) events + // l_timer: timeout expiration selectable, running at function + // start + // request_id: [input] request_id populated in StopContainersRequest. + // This is used/needed when sending StopContainersStatusRequest. + // Returns: + // EXIT_EARLY: an issue occurred that stops NSF + // PROCEED: if reboot timeout expired + Progress wait_for_container_stop_and_quiescence( + swss::Select &s, swss::SelectableTimer &l_timer, + const std::string &request_id); + + // Build a json formatted stop container request proto message. + // Message populated with containers that registered stop on freeze. + // Args: + // json_request: [output] json formatted StopContainersRequest + // message + // request_id: [output] request_id populated in StopContainersRequest. + // This is used/needed when sending StopContainersStatusRequest. + Progress build_stop_container_request(std::string &json_request, + std::string &request_id); + + // Send a StopContainersRequest message to the gnoi_stop_container + // sonic host service requesting list of containres be stopped. + // Args: + // request_id: [output] request_id populated in StopContainersRequest. + // This is used/needed when sending StopContainersStatusRequest. + Progress request_stop_on_freeze(std::string &request_id); + + // Send a StopContainersStatusRequest message to the gnoi_stop_container + // sonic host service to check if all containers have stopped. + // Args: + // request_id: [input] request_id populated in StopContainersRequest. + // This is used/needed when sending StopContainersStatusRequest. + // Returns: + // SUCCESS: containers have stopped, we're done. + // KEEP_WAITING: containers haven't stopped + // FAILURE: dbus error or protobuf conversion error + // suggest retry till timeout + Status check_container_stop(const std::string &request_id); + + // Check if containers have stopped, or there are no containers to stop + // Args: + // request_id: [input] request_id populated in StopContainersRequest. + // This is used/needed when sending StopContainersStatusRequest. + // Returns: + // SUCCESS: containers have stopped, we're done. + // KEEP_WAITING: containers haven't stopped + // FAILURE: dbus error or protobuf conversion error + // suggest retry till timeout + Status precheck_wait_for_container_stop(const std::string &request_id); + + // Poll the gnoi_stop_container host service to determine if requested + // set of containers have exited. + // Check for critical state, listen for stop, handle a timeout + // Args: + // s: [input] select statement that has m_stop as a selectable + // request_id: [input] request_id populated in StopContainersRequest. + // This is used/needed when sending StopContainersStatusRequest. + // l_timer: timeout expiration selectable, running at function + // start + Progress wait_for_container_stop(swss::Select &s, + const std::string &request_id, + swss::SelectableTimer &l_timer); + + // Perform freeze/quiescence. + // Request applications freeze and wait for registered apps + // to quiesce or checkpoint. + // Check for critical state, listen for stop, handle a timeout + // Args: + // s: [input] select statement that has m_stop as a selectable + // l_timer: [inpu] timeout expiration selectable, running at function start + // Returns: + // EXIT_EARLY: an issue occurred that stops NSF + // PROCEED: if reboot timeout expired + Progress perform_freeze_quiescence(swss::Select &s, + swss::SelectableTimer &l_timer); + + // Helper function for freeze quiescence stage: + // Check current database status before waiting for subscriptions updates. + // infinite loop select for checkpoint + // Listen for a stop, timer expiration or database update + // We must be quiescent for 10 seconds before PROCEED. + // Returns: + // EXIT_EARLY: an issue occurred that stops NSF + // PROCEED: if reboot timeout expired + Progress freeze_quiescence_select(swss::Select &s, + swss::SelectableTimer &l_timer, + swss::SubscriberStateTable &sub); + + // Perform checkpointing + // Request applications checkpoint and wait for registered apps + // to checkpoint. + // Check for critical state, listen for stop, handle a timeout + // Returns: + // EXIT_EARLY: an issue occurred that stops NSF + // PROCEED: if reboot timeout expired + Progress perform_checkpoint(swss::Select &s); + + // Hepler function for checkpoint: Check initial checkpoint + // status before entering select loop. + // Returns: + // EXIT_EARLY: an issue occurred that stops NSF + // PROCEED: if reboot timeout expired + Progress checkpoint_select_stage_one(swss::Select &s, + swss::SelectableTimer &l_timer, + swss::SubscriberStateTable &sub); + + // Helper function for checkpoint stage: + // infinite loop select for checkpoint + // Listen for a stop, timer expiration or database update + // Returns: + // EXIT_EARLY: an issue occurred that stops NSF + // PROCEED: if reboot timeout expired + Progress checkpoint_stage_two(swss::Select &s, swss::SelectableTimer &l_timer, + swss::SubscriberStateTable &sub); + + // Request is input only. + // Response is ouput only. + // Return true if preconditions met, false otherwise. + bool check_start_preconditions(const gnoi::system::RebootRequest &request, + NotificationResponse &response); + + std::thread m_thread; + + // Signal m_finished to let main thread know weve completed. + // Main thread should call Join. + swss::SelectableEvent &m_finished; + + // m_stop signalled by main thread on sigterm: cleanup and exit. + swss::SelectableEvent m_stop; + DbusInterface &m_dbus_interface; + //CriticalStateInterface &m_critical_interface; + TelemetryInterface &m_telemetry; + swss::DBConnector m_db; + ThreadStatus m_status; + gnoi::system::RebootRequest m_request; + Registration m_registration; + + // Wait for system to reboot: allow unit test to shorten. + // TODO: there is a plan to make these timer values + // available in CONFIG_DB + static constexpr uint32_t kRebootTime = 260; + uint32_t m_reboot_timeout = kRebootTime; + + static constexpr uint32_t kStateVerificationTime = 180; + uint32_t m_state_verification_timeout = kStateVerificationTime; + + static constexpr uint32_t kQuiescenceTimeMs = 60 * ONE_THOUSAND; + uint32_t m_quiescence_timeout_ms = kQuiescenceTimeMs; + + // We must remain quiescent for 5 seconds. + static constexpr uint32_t kQuiescenceHoldTimeMs = 5 * ONE_THOUSAND; + uint32_t m_quiescence_hold_time_ms = kQuiescenceHoldTimeMs; + + static constexpr uint32_t kCheckpointTime = 30; + uint32_t m_checkpoint_timeout = kCheckpointTime; + + friend class RebootBETestWithoutStop; + friend class RebootThreadTest; +}; + +} // namespace rebootbackend diff --git a/src/sonic-framework/rebootbackend/rebootbackend.cpp b/src/sonic-framework/rebootbackend/rebootbackend.cpp new file mode 100644 index 000000000000..f02f209fdedd --- /dev/null +++ b/src/sonic-framework/rebootbackend/rebootbackend.cpp @@ -0,0 +1,16 @@ +#include "interfaces.h" +#include "reboot_interfaces.h" +#include "rebootbe.h" +#include "telemetry_helper.h" + +using namespace ::rebootbackend; + +int main(int argc, char** argv) { + HostServiceDbus dbus_interface; + //CriticalState critical_interface; + TelemetryHelper telemetry_helper; + //RebootBE rebootbe(dbus_interface, critical_interface, telemetry_helper); + RebootBE rebootbe(dbus_interface, telemetry_helper); + rebootbe.Start(); + return 0; +} diff --git a/src/sonic-framework/rebootbackend/rebootbe.cpp b/src/sonic-framework/rebootbackend/rebootbe.cpp new file mode 100644 index 000000000000..b4f03c8c6962 --- /dev/null +++ b/src/sonic-framework/rebootbackend/rebootbe.cpp @@ -0,0 +1,332 @@ +#include "rebootbe.h" + +#include +#include + +#include +#include +#include + +#include "init_thread.h" +#include "logger.h" +#include "notificationconsumer.h" +#include "notificationproducer.h" +#include "reboot_common.h" +#include "reboot_interfaces.h" +#include "select.h" +#include "status_code_util.h" +#include "warm_restart.h" + +namespace rebootbackend { + +namespace gpu = ::google::protobuf::util; + +bool sigterm_requested = false; + +RebootBE::RebootBE(DbusInterface &dbus_interface, +// CriticalStateInterface &critical_interface, + TelemetryInterface &telemetry_interface) + : m_db("STATE_DB", 0), + m_rebootResponse(&m_db, REBOOT_RESPONSE_NOTIFICATION_CHANNEL), + m_notificationConsumer(&m_db, REBOOT_REQUEST_NOTIFICATION_CHANNEL), + m_dbus(dbus_interface), + //m_critical(critical_interface), + m_telemetry(telemetry_interface), + m_init_thread( + //std::make_unique(critical_interface, telemetry_interface, + std::make_unique(telemetry_interface, + m_init_thread_done, m_stack_unfrozen)), + //m_reboot_thread(dbus_interface, critical_interface, telemetry_interface, + m_reboot_thread(dbus_interface, telemetry_interface, + m_reboot_thread_finished) { + swss::Logger::linkToDbNative("rebootbackend"); +} + +RebootBE::NsfManagerStatus RebootBE::GetCurrentStatus() { + const std::lock_guard lock(m_status_mutex); + return m_current_status; +} + +void RebootBE::SetCurrentStatus(NsfManagerStatus new_status) { + const std::lock_guard lock(m_status_mutex); + m_current_status = new_status; +} + +void RebootBE::Start() { + SWSS_LOG_ENTER(); + SWSS_LOG_NOTICE("--- Starting rebootbackend ---"); + + swss::WarmStart::initialize("rebootbackend", "sonic-framework"); + swss::WarmStart::checkWarmStart("rebootbackend", "sonic-framework", + /*incr_restore_cnt=*/false); + + swss::Select s; + s.addSelectable(&m_notificationConsumer); + s.addSelectable(&m_done); + s.addSelectable(&m_init_thread_done); + s.addSelectable(&m_stack_unfrozen); + s.addSelectable(&m_reboot_thread_finished); + + if (swss::WarmStart::isWarmStart()) { + SWSS_LOG_NOTICE("Launching init thread for warm start"); + SetCurrentStatus(NsfManagerStatus::NSF_INIT_WAIT); + swss::StatusCode result = m_init_thread->Start(); + if (result != swss::StatusCode::SWSS_RC_SUCCESS) { + SetCurrentStatus(NsfManagerStatus::IDLE); + SWSS_LOG_ERROR("Error launching init thread: %s", + swss::statusCodeToStr(result).c_str()); + } + } else { + SWSS_LOG_NOTICE("Warm restart not enabled, not starting init thread"); + } + + SWSS_LOG_NOTICE("RebootBE entering operational loop"); + while (true) { + swss::Selectable *sel; + int ret; + + ret = s.select(&sel); + if (ret == swss::Select::ERROR) { + SWSS_LOG_NOTICE("Error: %s!", strerror(errno)); + } else if (ret == swss::Select::OBJECT) { + if (sel == &m_notificationConsumer) { + do_task(m_notificationConsumer); + } else if (sel == &m_stack_unfrozen) { + handle_unfreeze(); + } else if (sel == &m_init_thread_done) { + handle_init_finish(); + } else if (sel == &m_reboot_thread_finished) { + handle_reboot_finish(); + } else if (sel == &m_done) { + handle_done(); + break; + } + } + } + return; +} + +void RebootBE::Stop() { + SWSS_LOG_ENTER(); + m_done.notify(); + return; +} + +bool RebootBE::retrieve_notification_data( + swss::NotificationConsumer &consumer, + RebootBE::NotificationRequest &request) { + SWSS_LOG_ENTER(); + + request.op = ""; + request.ret_string = ""; + + std::string data; + std::vector values; + consumer.pop(request.op, data, values); + + for (auto &fv : values) { + if (DATA_TUPLE_KEY == fvField(fv)) { + request.ret_string = fvValue(fv); + return true; + } + } + return false; +} + +// Send a response on the Reboot_Response_Channel notification channel.. +// Key is one of: Reboot, RebootStatus, or CancelReboot +// code is swss::StatusCode, hopefully SWSS_RC_SUCCESS. +// message is json formatted RebootResponse, RebootStatusResponse +// or CancelRebootResponse as defined in system.proto +void RebootBE::send_notification_response(const std::string key, + const swss::StatusCode code, + const std::string message) { + SWSS_LOG_ENTER(); + + std::vector ret_values; + ret_values.push_back(swss::FieldValueTuple(DATA_TUPLE_KEY, message)); + + m_rebootResponse.send(key, swss::statusCodeToStr(code), ret_values); +} + +NotificationResponse RebootBE::handle_reboot_request( + const std::string &json_reboot_request) { + using namespace google::protobuf::util; + + SWSS_LOG_ENTER(); + + // On success an emtpy string is returned. RebootResponse in system.proto + // is an empty proto. + NotificationResponse response = {.status = swss::StatusCode::SWSS_RC_SUCCESS, + .json_string = ""}; + + gnoi::system::RebootRequest request; + Status status = gpu::JsonStringToMessage(json_reboot_request, &request); + + if (!status.ok()) { + std::string error_string = + "unable to convert json to rebootRequest protobuf: " + + status.message().as_string(); + SWSS_LOG_ERROR("%s", error_string.c_str()); + SWSS_LOG_ERROR("json = |%s|", json_reboot_request.c_str()); + response.status = swss::StatusCode::SWSS_RC_INTERNAL, + response.json_string = error_string; + return response; + } + + if (!reboot_allowed(request.method())) { + response.status = swss::StatusCode::SWSS_RC_IN_USE; + response.json_string = + "Reboot not allowed at this time. Reboot or " + "post-warmboot NSF in progress"; + SWSS_LOG_WARN("%s", response.json_string.c_str()); + return response; + } + + SWSS_LOG_NOTICE("Forwarding request to RebootThread: %s", + request.DebugString().c_str()); + response = m_reboot_thread.Start(request); + if (response.status == swss::StatusCode::SWSS_RC_SUCCESS) { + if (request.method() == gnoi::system::RebootMethod::COLD) { + SetCurrentStatus(NsfManagerStatus::COLD_REBOOT_IN_PROGRESS); + } else if (request.method() == gnoi::system::RebootMethod::NSF) { + SetCurrentStatus(NsfManagerStatus::NSF_REBOOT_IN_PROGRESS); + } + } + return response; +} + +bool RebootBE::reboot_allowed(const gnoi::system::RebootMethod reboot_method) { + NsfManagerStatus current_status = GetCurrentStatus(); + switch (current_status) { + case NsfManagerStatus::COLD_REBOOT_IN_PROGRESS: + case NsfManagerStatus::NSF_REBOOT_IN_PROGRESS: { + return false; + } + case NsfManagerStatus::NSF_INIT_WAIT: { + return reboot_method == gnoi::system::RebootMethod::COLD; + } + case NsfManagerStatus::IDLE: { + return true; + } + default: { + return true; + } + } +} + +NotificationResponse RebootBE::handle_status_request( + const std::string &json_status_request) { + SWSS_LOG_ENTER(); + + gnoi::system::RebootStatusResponse reboot_response = + m_reboot_thread.HasRun() ? m_reboot_thread.GetResponse() + : m_init_thread->GetResponse(); + + std::string json_reboot_response_string; + google::protobuf::util::Status status = + gpu::MessageToJsonString(reboot_response, &json_reboot_response_string); + + NotificationResponse response; + if (status.ok()) { + response.status = swss::StatusCode::SWSS_RC_SUCCESS; + response.json_string = json_reboot_response_string; + } else { + std::string error_string = + "unable to convert reboot status response protobuf to json: " + + status.message().as_string(); + SWSS_LOG_ERROR("%s", error_string.c_str()); + response.status = swss::StatusCode::SWSS_RC_INTERNAL; + response.json_string = error_string; + } + + return response; +} + +NotificationResponse RebootBE::handle_cancel_request( + const std::string &json_cancel_request) { + SWSS_LOG_ENTER(); + + NotificationResponse response; + + // CancelReboot isn't supported: not needed until/unless delayed support + // is added: return unimplemented. + response.status = swss::StatusCode::SWSS_RC_UNIMPLEMENTED; + response.json_string = "Cancel reboot isn't supported"; + SWSS_LOG_WARN("%s", response.json_string.c_str()); + return response; +} + +void RebootBE::do_task(swss::NotificationConsumer &consumer) { + SWSS_LOG_ENTER(); + + NotificationResponse response; + RebootBE::NotificationRequest request; + + if (!retrieve_notification_data(consumer, request)) { + // Response is simple string (not json) on error. + response.json_string = + "MESSAGE not present in reboot notification request message, op = " + + request.op; + SWSS_LOG_ERROR("%s", response.json_string.c_str()); + response.status = swss::StatusCode::SWSS_RC_INVALID_PARAM; + } else if (request.op == REBOOT_KEY) { + response = handle_reboot_request(request.ret_string); + } else if (request.op == REBOOT_STATUS_KEY) { + response = handle_status_request(request.ret_string); + } else if (request.op == CANCEL_REBOOT_KEY) { + response = handle_cancel_request(request.ret_string); + } else { + // Response is simple string (not json) on error. + response.json_string = + "Unrecognized op in reboot request, op = " + request.op; + SWSS_LOG_ERROR("%s", response.json_string.c_str()); + response.status = swss::StatusCode::SWSS_RC_INVALID_PARAM; + } + send_notification_response(request.op, response.status, response.json_string); +} + +void RebootBE::handle_unfreeze() { + SWSS_LOG_ENTER(); + SWSS_LOG_NOTICE("Receieved notification that UNFREEZE signal has been sent"); +} + +void RebootBE::handle_init_finish() { + SWSS_LOG_ENTER(); + SWSS_LOG_NOTICE("Receieved notification that InitThread is done"); + NsfManagerStatus current_status = GetCurrentStatus(); + if (current_status == NsfManagerStatus::NSF_INIT_WAIT) { + SetCurrentStatus(NsfManagerStatus::IDLE); + } + if (m_init_thread->GetResponse().active()) { + bool result = m_init_thread->Join(); + if (!result) { + SWSS_LOG_ERROR("Encountered error trying to join init thread"); + } + } +} + +void RebootBE::handle_reboot_finish() { + SWSS_LOG_ENTER(); + SWSS_LOG_WARN( + "Receieved notification that reboot has finished. This probably means " + "something is wrong"); + m_reboot_thread.Join(); + SetCurrentStatus(m_init_thread->GetResponse().active() + ? NsfManagerStatus::NSF_INIT_WAIT + : NsfManagerStatus::IDLE); +} + +void RebootBE::handle_done() { + SWSS_LOG_INFO("RebootBE received signal to stop"); + if (m_init_thread->GetResponse().active()) { + m_init_thread->Stop(); + m_init_thread->Join(); + } + if (m_reboot_thread.GetResponse().active()) { + m_reboot_thread.Stop(); + m_reboot_thread.Join(); + } +} + +} // namespace rebootbackend diff --git a/src/sonic-framework/rebootbackend/rebootbe.h b/src/sonic-framework/rebootbackend/rebootbe.h new file mode 100644 index 000000000000..3fa562ceb558 --- /dev/null +++ b/src/sonic-framework/rebootbackend/rebootbe.h @@ -0,0 +1,101 @@ +#pragma once +#include "dbconnector.h" +#include "init_thread.h" +#include "notificationconsumer.h" +#include "notificationproducer.h" +#include "reboot_common.h" +#include "reboot_interfaces.h" +#include "reboot_thread.h" +#include "selectableevent.h" +#include "status_code_util.h" + +namespace rebootbackend { + +#define REBOOT_REQUEST_NOTIFICATION_CHANNEL "Reboot_Request_Channel" +#define REBOOT_RESPONSE_NOTIFICATION_CHANNEL "Reboot_Response_Channel" +#define REBOOT_KEY "Reboot" +#define REBOOT_STATUS_KEY "RebootStatus" +#define CANCEL_REBOOT_KEY "CancelReboot" +#define DATA_TUPLE_KEY "MESSAGE" + +class RebootBE { + public: + struct NotificationRequest { + std::string op; + std::string ret_string; + }; + + enum class NsfManagerStatus { + NSF_INIT_WAIT, + IDLE, + COLD_REBOOT_IN_PROGRESS, + NSF_REBOOT_IN_PROGRESS + }; + + RebootBE(DbusInterface &interface, + // CriticalStateInterface &critical_interface, + TelemetryInterface &telemetry_interface); + + NsfManagerStatus GetCurrentStatus(); + + void Start(); + void Stop(); + + private: + std::mutex m_status_mutex; + NsfManagerStatus m_current_status = NsfManagerStatus::IDLE; + swss::SelectableEvent m_done; + + swss::DBConnector m_db; + swss::NotificationProducer m_rebootResponse; + swss::NotificationConsumer m_notificationConsumer; + + DbusInterface &m_dbus; + //CriticalStateInterface &m_critical; + TelemetryInterface &m_telemetry; + + // Signals for init thread. + swss::SelectableEvent m_init_thread_done; + swss::SelectableEvent m_stack_unfrozen; + std::unique_ptr m_init_thread; + + // Signalled by reboot thread when thread completes. + swss::SelectableEvent m_reboot_thread_finished; + RebootThread m_reboot_thread; + + void SetCurrentStatus(NsfManagerStatus new_status); + + // Reboot_Request_Channel notifications should all contain {"MESSAGE" : Data} + // in the notification Data field. + // Return true if "MESSAGE" is found, false otherwise. + // Set message_value to the Data string if found, "" otherwise. + // consumer is input: this is the consumer from which we pop + // reboot/cancel/status requests. + // request is output: this the request recevied from consumer + bool retrieve_notification_data(swss::NotificationConsumer &consumer, + NotificationRequest &request); + NotificationResponse handle_reboot_request( + const std::string &json_reboot_request); + NotificationResponse handle_status_request( + const std::string &json_status_request); + NotificationResponse handle_cancel_request( + const std::string &json_cancel_request); + void send_notification_response(const std::string key, + const swss::StatusCode code, + const std::string message); + + // Returns true if a reboot is allowed at this time given the current NSF + // manager state and reboot type, and false otherwise. + bool reboot_allowed(const gnoi::system::RebootMethod reboot_method); + + void do_task(swss::NotificationConsumer &consumer); + + void handle_unfreeze(); + void handle_init_finish(); + void handle_reboot_finish(); + void handle_done(); + + friend class RebootBETestWithoutStop; +}; + +} // namespace rebootbackend diff --git a/src/sonic-framework/rebootbackend/redis_utils.cpp b/src/sonic-framework/rebootbackend/redis_utils.cpp new file mode 100644 index 000000000000..18a3b9d69720 --- /dev/null +++ b/src/sonic-framework/rebootbackend/redis_utils.cpp @@ -0,0 +1,476 @@ +#include "redis_utils.h" + +#include +#include +#include +#include + +#include "dbconnector.h" +#include "notificationproducer.h" +//#include "stateverification.h" +#include "table.h" +#include "timestamp.h" +#include "warm_restart.h" + +namespace rebootbackend { + +using WarmStartState = ::swss::WarmStart::WarmStartState; + +/* const std::unordered_map> + Registration::kStageToTargetStates = { + {swss::WarmStart::WarmBootStage::STAGE_FREEZE, + {get_warm_start_state_name(WarmStartState::QUIESCENT), + get_warm_start_state_name(WarmStartState::CHECKPOINTED)}}, + {swss::WarmStart::WarmBootStage::STAGE_CHECKPOINT, + {get_warm_start_state_name(WarmStartState::CHECKPOINTED)}}, + {swss::WarmStart::WarmBootStage::STAGE_RECONCILIATION, + {get_warm_start_state_name(WarmStartState::RECONCILED)}}, + {swss::WarmStart::WarmBootStage::STAGE_UNFREEZE, + {get_warm_start_state_name(WarmStartState::COMPLETED)}}, +}; */ + +/*void send_nsf_manager_notification( + swss::DBConnector &db, swss::WarmStart::WarmBootNotification notification) { + swss::NotificationProducer producer( + &db, swss::WarmStart::kNsfManagerNotificationChannel); + + std::vector values; + std::string notification_string = + swss::WarmStart::warmBootNotificationNameMap()->at(notification); + + producer.send(notification_string, "", values); +} */ + +/* std::string send_state_verification_notification(swss::DBConnector &ldb, + const bool freeze) { + swss::NotificationProducer producer(&ldb, STATE_VERIFICATION_REQ_CHANNEL); + + std::vector values; + values.push_back( + swss::FieldValueTuple(FREEZE_FIELD, freeze ? "true" : "false")); + + std::string timestamp = swss::getTimestamp(); + producer.send(ALL_COMPONENT, timestamp, values); + return timestamp; +} */ + +void init_warm_reboot_states(const swss::DBConnector &db) { + swss::Table table(&db, STATE_WARM_RESTART_TABLE_NAME); + std::vector keys; + + table.getKeys(keys); + for (auto &key : keys) { + table.hdel(key, "state"); + table.hdel(key, "timestamp"); + } +} + +void set_warm_restart_enable(const swss::DBConnector &db, bool enabled) { + swss::Table table(&db, STATE_WARM_RESTART_ENABLE_TABLE_NAME); + table.hset("system", "enable", enabled ? "true" : "false"); +} + +bool is_valid_key(const std::string &key, const std::string &separator) { + if (separator.empty()) { + return false; + } + + size_t pos = key.find(separator); + // The separator must exist in the string, and cannot be the first or last + // character. + return !(pos == std::string::npos || pos == 0 || pos == key.size() - 1); +} + +bool get_docker_app_from_key(const std::string &key, + const std::string &separator, std::string &docker, + std::string &app) { + SWSS_LOG_ENTER(); + + size_t pos = key.find(separator); + + if (separator.empty()) { + SWSS_LOG_ERROR("separator [%s] shouldn't be empty", separator.c_str()); + return false; + } + + if (pos == std::string::npos) { + SWSS_LOG_ERROR("key [%s] should contain separator [%s]", key.c_str(), + separator.c_str()); + return false; + } + + docker = key.substr(0, pos); + app = key.substr(pos + separator.length(), std::string::npos); + + if (docker.empty()) { + SWSS_LOG_ERROR("docker name shouldn't be empty, key = %s", key.c_str()); + return false; + } + + if (app.empty()) { + SWSS_LOG_ERROR("app name shouldn't be empty, key = %s", key.c_str()); + return false; + } + return true; +} + +/* std::string get_warm_start_state_name(swss::WarmStart::WarmStartState state) { + return swss::WarmStart::warmStartStateNameMap()->at(state).c_str(); +} */ + +void set_warm_restart_counter(swss::DBConnector &db, int count) { + swss::Table table(&db, "BOOT_INFO"); + table.hset("system", "warmboot-count", std::to_string(count)); +} + +std::string get_warm_restart_counter(swss::DBConnector &db) { + swss::Table warmRestartTable(&db, "BOOT_INFO"); + std::string counter; + warmRestartTable.hget("system", "warmboot-count", counter); + return counter; +} + +Registration::Registration() + : m_db("STATE_DB", 0), + m_separator(swss::TableBase::getTableSeparator(m_db.getDbId())) + {} +/* m_remaining_apps( + {{swss::WarmStart::WarmBootStage::STAGE_FREEZE, {}}, + {swss::WarmStart::WarmBootStage::STAGE_CHECKPOINT, {}}, + {swss::WarmStart::WarmBootStage::STAGE_RECONCILIATION, {}}, + {swss::WarmStart::WarmBootStage::STAGE_UNFREEZE, {}}}) {} + +std::string Registration::get_warm_boot_stage_name( + swss::WarmStart::WarmBootStage stage) { + { + return swss::WarmStart::warmBootStageToNameMap()->at(stage); +} */ + +/* void Registration::clear_contents() { + m_registered.clear(); + m_stop.clear(); + for (auto &stage_set_pair : m_remaining_apps) { + stage_set_pair.second.clear(); + } +}*/ + +Registration::RegistrationSet Registration::get_stop_on_freeze_set() { + return m_stop; +} + +Registration::RegistrationSet Registration::get_registered_app_set() { + return m_registered; +} + +/* void Registration::fetch_registration_info() { + SWSS_LOG_ENTER(); + + clear_contents(); + + swss::Table table(&m_db, STATE_WARM_RESTART_REGISTRATION_TABLE_NAME); + std::vector keys; + + table.getKeys(keys); + for (auto &key : keys) { + std::string docker, app; + if (!get_docker_app_from_key(key, m_separator, docker, app)) { + SWSS_LOG_ERROR("skipping registration for key = %s", key.c_str()); + continue; + } + + m_registered.insert(key); + + std::vector values; + table.get(key, values); + for (auto &v : values) { + // We only care about this field if value is "true". + // Skip this key if value is false. + if ("false" == fvValue(v)) continue; + + if (swss::WarmStart::kRegistrationStopOnFreezeKey == fvField(v)) { + m_stop.insert(docker); + } + if (swss::WarmStart::kRegistrationFreezeKey == fvField(v)) { + m_ro_quiescent_list.insert(app); + m_remaining_apps.at(swss::WarmStart::WarmBootStage::STAGE_FREEZE) + .insert(app); + m_remaining_apps.at(swss::WarmStart::WarmBootStage::STAGE_UNFREEZE) + .insert(app); + } + if (swss::WarmStart::kRegistrationCheckpointKey == fvField(v)) { + m_remaining_apps.at(swss::WarmStart::WarmBootStage::STAGE_CHECKPOINT) + .insert(app); + } + if (swss::WarmStart::kRegistrationReconciliationKey == fvField(v)) { + m_remaining_apps + .at(swss::WarmStart::WarmBootStage::STAGE_RECONCILIATION) + .insert(app); + } + } + } +} */ + +/* Registration::Response Registration::check_quiesced() { + return check_stage(swss::WarmStart::WarmBootStage::STAGE_FREEZE); +} + +Registration::Response Registration::check_checkpointed() { + return check_stage(swss::WarmStart::WarmBootStage::STAGE_CHECKPOINT); +} + +Registration::Response Registration::check_reconciled() { + return check_stage(swss::WarmStart::WarmBootStage::STAGE_RECONCILIATION); +} + +Registration::Response Registration::check_unfrozen() { + return check_stage(swss::WarmStart::WarmBootStage::STAGE_UNFREEZE); +} + +Registration::Response Registration::check_stage( + swss::WarmStart::WarmBootStage nsf_stage) { + Registration::Response response = check_states_are( + m_remaining_apps.at(nsf_stage), kStageToTargetStates.at(nsf_stage)); + if (response.status == Registration::Status::FAILURE) { + response.error_string = + "check_stage: app: " + response.error_string + + " reported FAILED during stage: " + get_warm_boot_stage_name(nsf_stage); + } + return response; +} */ + +Registration::Response Registration::check_states_are( + RegistrationSet &set_to_check, + const std::unordered_set &state_names) { + Registration::Response response; + + swss::Table warmRestartTable(&m_db, STATE_WARM_RESTART_TABLE_NAME); + for (auto key = set_to_check.begin(); key != set_to_check.end();) { + std::string state; + + warmRestartTable.hget(*key, "state", state); + +/* if (state == get_warm_start_state_name(WarmStartState::FAILED)) { + response.status = Registration::Status::FAILURE; + response.error_string = *key; + return response; + } */ + + if (state_names.find(state) != std::end(state_names)) { + key = set_to_check.erase(key); + } else { + ++key; + } + } + + if (set_to_check.empty()) { + response.status = Registration::Status::COMPLETED; + return response; + } + + response.status = Registration::Status::IN_PROCESS; + return response; +} + +/* Registration::Response Registration::handle_state_event( + swss::WarmStart::WarmBootStage monitored_stage, + const swss::KeyOpFieldsValuesTuple &kco) { + SWSS_LOG_ENTER(); + + RegistrationSet &set_to_check = m_remaining_apps.at(monitored_stage); + + std::string op = kfvOp(kco); + if (op != "SET") { + SWSS_LOG_ERROR("ignoring non-SET event: %s", op.c_str()); + return {set_to_check.empty() ? Registration::Status::COMPLETED + : Registration::Status::IN_PROCESS, + ""}; + } + + Registration::Response response = + filter_app_list(set_to_check, kfvKey(kco), monitored_stage, kco, + kStageToTargetStates.at(monitored_stage)); + + if (response.status == Registration::Status::FAILURE) { + return response; + } + + if (monitored_stage == swss::WarmStart::WarmBootStage::STAGE_FREEZE) { + response = handle_quiescence_event(kco); + } + return response; +} */ + +// Helper for handle_state_event. +// Pre-condition: caller verifies that operation is a set. +// Caller handles apps entering FAILED state. +/* Registration::Response Registration::handle_quiescence_event( + const swss::KeyOpFieldsValuesTuple &kco) { + SWSS_LOG_ENTER(); + + RegistrationSet &set_to_check = + m_remaining_apps.at(swss::WarmStart::WarmBootStage::STAGE_FREEZE); ` + + std::string app_name = kfvKey(kco); + std::string new_state = extract_event_state(kco); + + std::unordered_set state_names = + kStageToTargetStates.at(swss::WarmStart::WarmBootStage::STAGE_FREEZE); + + if (state_names.find(new_state) == std::end(state_names)) { + // the new_state is not QUIESCENT or CHECKPOINTED, the app isn't quiescent + if (m_ro_quiescent_list.find(app_name) != std::end(m_ro_quiescent_list)) { + // We are monitoring quiescence for this app: app isn't quiescent + // readd app to monitoring list (it might already be there ...) + set_to_check.insert(app_name); + } + } + return {set_to_check.empty() ? Registration::Status::COMPLETED + : Registration::Status::IN_PROCESS, + ""}; +} */ + +Registration::Response Registration::filter_app_list( + RegistrationSet &set_to_filter, const std::string app_name, +// const swss::WarmStart::WarmBootStage monitored_stage, + const swss::KeyOpFieldsValuesTuple &kco, + const std::unordered_set &state_names) { + std::string new_state = extract_event_state(kco); + + /*if (new_state == get_warm_start_state_name(WarmStartState::FAILED)) { + return {Registration::Status::FAILURE, + "handle_state_event: app: " + app_name + + " reported FAILED when looking for state: " + + get_warm_boot_stage_name(monitored_stage)}; + }*/ + + if (state_names.find(new_state) != std::end(state_names)) { + set_to_filter.erase(app_name); + } + + Registration::Response response; + response.status = set_to_filter.empty() ? Registration::Status::COMPLETED + : Registration::Status::IN_PROCESS; + + return response; +} + +std::string Registration::extract_event_state( + const swss::KeyOpFieldsValuesTuple &kco) { + for (const auto &field_value : kfvFieldsValues(kco)) { + if (fvField(field_value) == "state") { + return fvValue(field_value); + } + } + return ""; +} + +/* void Registration::clear_all_init_apps() { + swss::Table table(&m_db, STATE_WARM_RESTART_INIT_TABLE_NAME); + std::vector keys; + table.getKeys(keys); + for (auto &key : keys) { + table.del(key); + } +} + +void Registration::save_all_init_apps() { + SWSS_LOG_ENTER(); + std::ostringstream stream; + std::copy(m_registered.begin(), m_registered.end(), + std::ostream_iterator(stream, ",")); + SWSS_LOG_NOTICE("Saving registered apps to init table: %s", + stream.str().c_str()); + + swss::Table table(&m_db, STATE_WARM_RESTART_INIT_TABLE_NAME); + std::string separator = swss::TableBase::getTableSeparator(m_db.getDbId()); + for (const auto &key : m_registered) { + if (is_valid_key(key, separator)) { + table.hset(key, "timestamp", swss::getTimestamp()); + } else { + SWSS_LOG_ERROR("skipping saving key = %s", key.c_str()); + } + } +} */ + +/* std::string Registration::join_pending_apps( + swss::WarmStart::WarmBootStage target_stage) { + std::ostringstream stream; + std::copy(m_remaining_apps.at(target_stage).begin(), + m_remaining_apps.at(target_stage).end(), + std::ostream_iterator(stream, ",")); + return stream.str(); +} */ + +InitRegistration::InitRegistration() + : m_db("STATE_DB", 0), + m_separator(swss::TableBase::getTableSeparator(m_db.getDbId())) {} + +void InitRegistration::fetch_init_app_info() { + m_missing_registrations.clear(); + + //swss::Table table(&m_db, STATE_WARM_RESTART_INIT_TABLE_NAME); + std::vector keys; + +// table.getKeys(keys); + for (auto &key : keys) { + if (!is_valid_key(key, m_separator)) { + SWSS_LOG_ERROR("Could not parse init app name from key = %s", + key.c_str()); + continue; + } + + m_missing_registrations.insert(key); + } +} + +InitRegistration::Status InitRegistration::get_reregistration_status() { + return m_missing_registrations.empty() + ? InitRegistration::Status::COMPLETED + : InitRegistration::Status::IN_PROGRESS; +} + +InitRegistration::Status InitRegistration::check_reregistration_status() { + SWSS_LOG_ENTER(); + + // swss::Table table(&m_db, STATE_WARM_RESTART_REGISTRATION_TABLE_NAME); + std::vector keys; + + // table.getKeys(keys); + for (auto &key : keys) { + remove_pending_app(key); + } + + return get_reregistration_status(); +} + +InitRegistration::Status InitRegistration::handle_registration_event( + const swss::KeyOpFieldsValuesTuple &kco) { + remove_pending_app(kfvKey(kco)); + return get_reregistration_status(); +} + +const InitRegistration::RegistrationSet &InitRegistration::get_pending_apps() + const { + return m_missing_registrations; +} + +void InitRegistration::remove_pending_app(const std::string &key) { + SWSS_LOG_ENTER(); + if (!is_valid_key(key, m_separator)) { + SWSS_LOG_ERROR("ignoring invalid key for reregistration = %s", key.c_str()); + return; + } + if (m_missing_registrations.find(key) != std::end(m_missing_registrations)) { + m_missing_registrations.erase(key); + } +} + +std::string InitRegistration::join_pending_apps() { + std::ostringstream stream; + std::copy(m_missing_registrations.begin(), m_missing_registrations.end(), + std::ostream_iterator(stream, ",")); + return stream.str(); +} + +} // namespace rebootbackend diff --git a/src/sonic-framework/rebootbackend/redis_utils.h b/src/sonic-framework/rebootbackend/redis_utils.h new file mode 100644 index 000000000000..73e76eb321cf --- /dev/null +++ b/src/sonic-framework/rebootbackend/redis_utils.h @@ -0,0 +1,290 @@ +#pragma once +#include +#include +#include + +#include "dbconnector.h" +#include "notificationconsumer.h" +#include "notificationproducer.h" +#include "selectableevent.h" +#include "status_code_util.h" +#include "warm_restart.h" + +namespace rebootbackend { + +// Return string corresponding to state +std::string get_warm_start_state_name( + const swss::WarmStart::WarmStartState state); + +// Send Freeze, Checkpoint or Unfreeze notifications to all subscribed +// apps on NSF_MANAGER_COMMON_NOTIFICATION_CHANNEL +void send_nsf_manager_notification( + swss::DBConnector &db ); +// swss::WarmStart::WarmBootNotification notification); + +// For all keys in STATE_WARM_RESTART_TABLE_NAME: delete state field +// This is executed at the beginning of nsf/warm restart to clear out +// existing states. +// From: +// https://github.com/sonic-net/sonic-utilities/blob/20d1495b6f7e82c4d9aa377c3c281d8d0d9d8594/scripts/fast-reboot#L167 +void init_warm_reboot_states(const swss::DBConnector &db); + +// Set the system warm start state to a new enabled/disabled state. +// STATE_WARM_RESTART_TABLE_NAME +// key = system, field = enable, value = "true"/"false" +void set_warm_restart_enable(const swss::DBConnector &db, bool enabled); + +// Send a request to state verifiation daemon to perform state +// verification. +// Set freeze == true if system is frozen (i.e. after reboot +// before reconciliation and unfreeze have occurred. +// timestamp is used to verify that a state update is a response +// to our request, and not someone else's. +std::string send_state_verification_notification(swss::DBConnector &db, + const bool freeze); + +// Returns true if key is in the formm "texttext", and false +// otherwise. +bool is_valid_key(const std::string &key, const std::string &separator); + +// Helper function: given key of form "docker|app" +// extract docker and app. (separator = | in this case) +// return false if docker or app are empty or separator +// isn't present, else true. +// key and separator are inputs +// docker and app are outputs +bool get_docker_app_from_key(const std::string &key, + const std::string &separator, std::string &docker, + std::string &app); + +std::string get_warm_start_state_name(swss::WarmStart::WarmStartState state); + +// Sets the warm restart count in the database. +void set_warm_restart_counter(swss::DBConnector &db, int count); + +// Returns the current warm restart count from the database. Returns an empty +// string if the warm restart count is not set, and a string representation +// of an integer otherwise. +std::string get_warm_restart_counter(swss::DBConnector &db); + +// This class is meant to handle registration information in the +// STATE_WARM_RESTART_REGISTRATION_TABLE_NAME. +// - we maintain the list of registered applications +// used after to reboot to wait for all to register +// - the list of apps we will wait to quiesce +// - the list of apps we will wait to checkpoint +// - the list of apps we will wait reconcile +// - the list of containers that have requested stop on freeze. +// Not thread safe. +class Registration { + public: + enum class Status { COMPLETED, FAILURE, IN_PROCESS }; + + struct Response { + Status status = Status::IN_PROCESS; + std::string error_string = ""; + }; + + typedef std::unordered_set RegistrationSet; + + Registration(); + + //static std::string get_warm_boot_stage_name( + // swss::WarmStart::WarmBootStage stage); + + // Populate this class with contents of + // STATE_WARM_RESTART_REGISTRATION_TABLE_NAME. + void fetch_registration_info(); + + // Return the set of containers that have requested stop on freeze. + RegistrationSet get_stop_on_freeze_set(); + + // Return the set of applications that have registered. + RegistrationSet get_registered_app_set(); + + // Check application states in warm restart table. + // Pop applications that are quiesced or checkpointed. + // Returns: + // IN_PROCESS: not all apps have quiesced. + // COMPLETED: all registered apps have quiesced. + // FAILURE: an application set its state to failed. + // error_string in response is populated + Response check_quiesced(); + + // Check application states in warm restart table. + // Pop applications that are checkpointed. + // Returns: + // IN_PROCESS: not all apps have checkpointed. + // COMPLETED: all registered apps have checkpointed. + // FAILURE: an application set its state to failed. + // error_string in response is populated + Response check_checkpointed(); + + // Check application states in warm restart table. + // Pop applications that are checkpointed. + // Returns: + // IN_PROCESS: not all apps have checkpointed. + // COMPLETED: all registered apps have checkpointed. + // FAILURE: an application set its state to failed. + // error_string in response is populated + Response check_reconciled(); + + // Check application states in warm restart table. + // Pop applications that are unfrozen. + // Returns: + // IN_PROCESS: not all apps have unfrozen. + // COMPLETED: all registered apps have unfrozen. + // FAILURE: an application set its state to failed. + // error_string in response is populated + Response check_unfrozen(); + + // Check application states in warm restart table. + // Pop applications that have reached the target state. + // Returns: + // IN_PROCESS: not all apps have reached the target state. + // COMPLETED: all registered apps have reached the target state. + // FAILURE: an application set its state to failed. + // error_string in response is populated + // Response check_stage(swss::WarmStart::WarmBootStage nsf_stage); + + // Handle an application state change, and update the tracked progress + // towards that state. + // Pop applications that have reached the monitored state. + // FAILURE statuses are sticky, and subsequent calls to handle_state_event + // will return the FAILURE status. + // Returns: + // IN_PROCESS: not all apps have reached monitored_stage. + // COMPLETED: all registered apps have monitored_stage. + // FAILURE: an application set its state to failed. + // error_string in response is populated + // Response handle_state_event(swss::WarmStart::WarmBootStage monitored_stage, + // const swss::KeyOpFieldsValuesTuple &kco); + + // Clear all registered app names in the WARM_RESTART_INIT_TABLE. + void clear_all_init_apps(); + + // Saves all registered app names to the WARM_RESTART_INIT_TABLE. + void save_all_init_apps(); + + // Returns a string representation of the current apps that have not + // reached the target state For debug and logging only. + //std::string join_pending_apps(swss::WarmStart::WarmBootStage target_stage); + + private: + // Helper function for check_ functions. + // Pop applications that have reached one of the target state names. + // Returns: + // IN_PROCESS: not all apps have reached the correct state. + // COMPLETED: all registered apps have reached the correct state. + // FAILURE: an application set its state to failed. + // error_string in response is populated + Response check_states_are(RegistrationSet &set_to_check, + const std::unordered_set &state_names); + + // Helper for handle_state_event: specific handling for FREZE stage. + // Pre-condition: caller verifies that operation is a set. + // caller handles apps entering FAILED state. + // Push applications that report a state other than quiescence/checkpointed. + // -- applications may exit/enter quiescence state. + // Returns: + // IN_PROCESS: not all apps have reached monitored_stage. + // COMPLETED: all registered apps have monitored_stage. + Response handle_quiescence_event(const swss::KeyOpFieldsValuesTuple &kco); + + // Filter a specified app list based on an application state change event. + // Pop applications that have reached one of the target states. + // IN_PROCESS: not all apps have reached the correct state. + // COMPLETED: all registered apps have reached the correct state. + // FAILURE: an application set its state to failed. + // error_string in response is populated + Response filter_app_list(RegistrationSet &set_to_filter, + const std::string app_name, +// const swss::WarmStart::WarmBootStage monitored_state, + const swss::KeyOpFieldsValuesTuple &kco, + const std::unordered_set &state_names); + + // Extracts a "status" field from the event, and returns the value of it. + // Returns an empty string if the "status" field is not present. + std::string extract_event_state(const swss::KeyOpFieldsValuesTuple &kco); + + // Clear contents of all sets. + void clear_contents(); + +// const static std::unordered_map> +// kStageToTargetStates; + + RegistrationSet m_registered; + RegistrationSet m_stop; + RegistrationSet m_ro_quiescent_list; +// std::unordered_map +// m_remaining_apps; + + swss::DBConnector m_db; + + std::string m_separator; + + friend class RebootThreadTest; + friend class RedisTest; +}; + +// This class handles the monitoring of applications re-registered warmboot +// requirements after a warmboot. In general, data from +// WARM_RESTART_INIT_TABLE is used to generate a list of apps that must +// re-register, and the provided API functions monitor +// WARM_RESTART_REGISTRATION_TABLE to determine if all of these apps +// have registered again. +class InitRegistration { + public: + enum class Status { COMPLETED, IN_PROGRESS }; + + typedef std::unordered_set RegistrationSet; + + InitRegistration(); + + // Reads the list of apps that must reregister from the + // WARM_RESTART_INIT_TABLE. + void fetch_init_app_info(); + + // Returns the current state of re-registration. + // Returns: + // COMPLETED: all apps that were registered before the warmboot have + // re-registered. This is a requirement for warmboot. + // IN_PROGRESS: not all apps have re-registered. + Status get_reregistration_status(); + + // Polls the WARM_RESTART_REGISTRATION_TABLE to retermine if re-registration + // is complete. Pops elements from the internal set. + // Returns: + // COMPLETED: all apps that were registered before the warmboot have + // re-registered. This is a requirement for warmboot. + // IN_PROGRESS: not all apps have re-registered. + Status check_reregistration_status(); + + // Handles an registration event in the WARM_RESTART_REGISTRATION_TABLE. Pops + // elements from the internal set, and returns the current re-registration + // status. + // Returns: + // COMPLETED: all apps that were registered before the warmboot have + // re-registered. This is a requirement for warmboot. + // IN_PROGRESS: not all apps have re-registered. + Status handle_registration_event(const swss::KeyOpFieldsValuesTuple &kco); + + const RegistrationSet &get_pending_apps() const; + + // Returns a string representation of the current apps that have not + // re-registered. For debug and logging only. + std::string join_pending_apps(); + + private: + // Pops the app name in key from the internal set, if it exists. + void remove_pending_app(const std::string &key); + + RegistrationSet m_missing_registrations; + swss::DBConnector m_db; + std::string m_separator; + + friend class RedisTest; +}; + +} // namespace rebootbackend diff --git a/src/sonic-framework/rebootbackend/telemetry_helper.cpp b/src/sonic-framework/rebootbackend/telemetry_helper.cpp new file mode 100644 index 000000000000..c4d9591c22bb --- /dev/null +++ b/src/sonic-framework/rebootbackend/telemetry_helper.cpp @@ -0,0 +1,120 @@ +#include "telemetry_helper.h" + +#include +#include +#include + +#include "dbconnector.h" +#include "reboot_interfaces.h" +#include "redis_utils.h" +#include "table.h" +#include "warm_restart.h" + +namespace rebootbackend { + +TelemetryHelper::TelemetryHelper() + : m_db("STATE_DB", 0), + m_separator(swss::TableBase::getTableSeparator(m_db.getDbId())) {} + +void TelemetryHelper::record_overall_start() { + //clear_performance_table(); + + //swss::WarmStart::updateSystemWarmBootStart(); + + initialize_warmboot_count(); + //backup_overall_values(m_reboot_count); +} + +void TelemetryHelper::record_overall_end(bool success) { + //swss::WarmStart::updateSystemWarmBootEnd(success ? "success" : "failure"); + + //backup_overall_values(get_reboot_count()); +} + +/* void TelemetryHelper::record_stage_start( + swss::WarmStart::WarmBootStage nsf_stage) { + swss::WarmStart::updateWarmBootStageStart(nsf_stage); + + backup_stage_values(nsf_stage); +} */ + +/* void TelemetryHelper::record_stage_end(swss::WarmStart::WarmBootStage nsf_stage, + bool success) { + swss::WarmStart::updateWarmBootStageEnd(nsf_stage, + success ? "success" : "failure"); + + backup_stage_values(nsf_stage); +} */ + +// Called at start of an nsf reboot: at least one nsf reboot (the one in +// progress) has occurred +void TelemetryHelper::initialize_warmboot_count() { + std::string warmboot_counter_str = get_warm_restart_counter(m_db); + if (warmboot_counter_str.empty()) { + m_reboot_count = 1; + } + try { + m_reboot_count = std::stoi(warmboot_counter_str) + 1; + } catch (const std::logic_error &e) { + m_reboot_count = 1; + } + set_warm_restart_counter(m_db, m_reboot_count); + m_fetched_count = true; +} + +/* void TelemetryHelper::backup_overall_values(int count) { + swss::Table perf_table(&m_db, STATE_WARM_RESTART_PERF_TABLE_NAME); + std::vector values; + if (!perf_table.get("system", values)) { + return; + } + + swss::Table hist_table(&m_db, STATE_WARM_RESTART_PERF_HISTORY_TABLE_NAME); + hist_table.set(std::to_string(count) + m_separator + "system", values); +} */ + +/* void TelemetryHelper::backup_stage_values( + swss::WarmStart::WarmBootStage nsf_stage) { + std::string stage_name = + swss::WarmStart::warmBootStageToNameMap()->at(nsf_stage); + int count = get_reboot_count(); + + swss::Table perf_table(&m_db, STATE_WARM_RESTART_PERF_TABLE_NAME); + swss::Table hist_table(&m_db, STATE_WARM_RESTART_PERF_HISTORY_TABLE_NAME); + + std::vector perf_keys; + perf_table.getKeys(perf_keys); + for (const auto &key : perf_keys) { + if (key.rfind(stage_name, 0) == 0) { + std::vector values; + if (!perf_table.get(key, values)) { + continue; + } + + hist_table.set(std::to_string(count) + m_separator + key, values); + } + } +} */ + +int TelemetryHelper::get_reboot_count() { + if (!m_fetched_count) { + try { + m_reboot_count = std::stoi(get_warm_restart_counter(m_db)); + } catch (const std::logic_error &e) { + m_reboot_count = 0; + } + m_fetched_count = true; + } + return m_reboot_count; +} + +/*void TelemetryHelper::clear_performance_table() { + swss::Table perf_table(&m_db, STATE_WARM_RESTART_PERF_TABLE_NAME); + std::vector perf_keys; + perf_table.getKeys(perf_keys); + for (const auto &key : perf_keys) { + perf_table.del(key); + } +} */ + +} // namespace rebootbackend diff --git a/src/sonic-framework/rebootbackend/telemetry_helper.h b/src/sonic-framework/rebootbackend/telemetry_helper.h new file mode 100644 index 000000000000..12de453a6ed7 --- /dev/null +++ b/src/sonic-framework/rebootbackend/telemetry_helper.h @@ -0,0 +1,49 @@ +#pragma once + +#include "dbconnector.h" +#include "reboot_interfaces.h" +#include "warm_restart.h" + +namespace rebootbackend { + +class TelemetryHelper : public TelemetryInterface { + public: + TelemetryHelper(); + ~TelemetryHelper() override = default; + + void record_overall_start() override; + void record_overall_end(bool success) override; + +// void record_stage_start(swss::WarmStart::WarmBootStage nsf_stage) override; +// void record_stage_end(swss::WarmStart::WarmBootStage nsf_stage, +// bool success) override; + + private: + // Initialize the warmboot count in Redis for a new reboot. Sets the count to + // 0 if it is not populated, and increment the value otherwise. + void initialize_warmboot_count(); + + // Backup the performance entries for the overall NSF reboot from + // WARM_RESTART_PERFORMANCE_TABLE to WARM_RESTART_PERFORMANCE_HISTORY_TABLE. + void backup_overall_values(int count); + + // Backup the performance entries for a particular stage of the NSF reboot + // from WARM_RESTART_PERFORMANCE_TABLE to + // WARM_RESTART_PERFORMANCE_HISTORY_TABLE. + //void backup_stage_values(swss::WarmStart::WarmBootStage nsf_stage); + + // Fetch the reboot warmboot count value, or return the cached + // value for the appropriate value if it has already been fetched. + int get_reboot_count(); + + // Clears all keys from the performance table in preparation for a new reboot. + void clear_performance_table(); + + swss::DBConnector m_db; + std::string m_separator; + + bool m_fetched_count = false; + int m_reboot_count = 0; +}; + +} // namespace rebootbackend diff --git a/src/sonic-framework/tests/Makefile.am b/src/sonic-framework/tests/Makefile.am new file mode 100644 index 000000000000..a61aaadd4886 --- /dev/null +++ b/src/sonic-framework/tests/Makefile.am @@ -0,0 +1,60 @@ +INCLUDES = -I $(top_srcdir) -I $(top_srcdir)/rebootbackend -I $(top_srcdir)/rebootbackend/system + +TESTS = tests tests_asan tests_tsan tests_usan + +noinst_PROGRAMS = tests tests_asan tests_tsan tests_usan + +if DEBUG +DBGFLAGS = -ggdb -DDEBUG +else +DBGFLAGS = -g -DNDEBUG +endif + +CFLAGS_GTEST = +LDADD_GTEST = -lgtest -lgtest_main -lgmock -lgmock_main +CFLAGS_COVERAGE = --coverage -fprofile-arcs -ftest-coverage +LDADD_COVERAGE = -lgcov +CFLAGS_ASAN = -fsanitize=address +CFLAGS_TSAN = -fsanitize=thread +CFLAGS_USAN = -fsanitize=undefined + +tests_SOURCES = test_utils_common.cpp \ + $(top_srcdir)/rebootbackend/telemetry_helper.cpp \ + telemetry_helper_test.cpp \ + rebootbe_test.cpp \ + $(top_srcdir)/rebootbackend/rebootbe.cpp \ + reboot_thread_test.cpp \ + $(top_srcdir)/rebootbackend/reboot_thread.cpp \ + init_thread_test.cpp \ + $(top_srcdir)/rebootbackend/init_thread.cpp \ + $(top_srcdir)/rebootbackend/system/system.pb.cc \ + $(top_srcdir)/rebootbackend/types/types.pb.cc \ + $(top_srcdir)/rebootbackend/common/common.pb.cc \ + $(top_srcdir)/rebootbackend/container_stop.pb.cc \ + redis_utils_test.cpp \ + $(top_srcdir)/rebootbackend/redis_utils.cpp \ + reboot_common_test.cpp \ + $(top_srcdir)/rebootbackend/reboot_common.cpp \ + test_main.cpp + +tests_CFLAGS = $(DBGFLAGS) $(AM_CFLAGS) $(CFLAGS_COMMON) $(CFLAGS_GTEST) $(CFLAGS_COVERAGE) $(CFLAGS_SAI) +tests_CPPFLAGS = $(DBGFLAGS) $(AM_CFLAGS) $(CFLAGS_COMMON) $(CFLAGS_GTEST) $(CFLAGS_COVERAGE) $(CFLAGS_SAI) +tests_LDADD = $(LDADD_GTEST) $(LDADD_COVERAGE) -lswsscommon -lpthread -lprotobuf + +tests_asan_SOURCES = $(tests_SOURCES) +tests_asan_CFLAGS = $(DBGFLAGS) $(AM_CFLAGS) $(CFLAGS_COMMON) $(CFLAGS_GTEST) $(CFLAGS_ASAN) $(CFLAGS_SAI) +tests_asan_CPPFLAGS = $(DBGFLAGS) $(AM_CFLAGS) $(CFLAGS_COMMON) $(CFLAGS_GTEST) $(CFLAGS_ASAN) $(CFLAGS_SAI) +tests_asan_LDFLAGS = $(CFLAGS_ASAN) +tests_asan_LDADD = $(LDADD_GTEST) -lswsscommon -lpthread -lprotobuf + +tests_tsan_SOURCES = $(tests_SOURCES) +tests_tsan_CFLAGS = $(DBGFLAGS) $(AM_CFLAGS) $(CFLAGS_COMMON) $(CFLAGS_GTEST) $(CFLAGS_TSAN) $(CFLAGS_SAI) +tests_tsan_CPPFLAGS = $(DBGFLAGS) $(AM_CFLAGS) $(CFLAGS_COMMON) $(CFLAGS_GTEST) $(CFLAGS_TSAN) $(CFLAGS_SAI) +tests_tsan_LDFLAGS = $(CFLAGS_TSAN) +tests_tsan_LDADD = $(LDADD_GTEST) -lswsscommon -lpthread -lprotobuf + +tests_usan_SOURCES = $(tests_SOURCES) +tests_usan_CFLAGS = $(DBGFLAGS) $(AM_CFLAGS) $(CFLAGS_COMMON) $(CFLAGS_GTEST) $(CFLAGS_USAN) $(CFLAGS_SAI) +tests_usan_CPPFLAGS = $(DBGFLAGS) $(AM_CFLAGS) $(CFLAGS_COMMON) $(CFLAGS_GTEST) $(CFLAGS_USAN) $(CFLAGS_SAI) +tests_usan_LDFLAGS = $(CFLAGS_USAN) +tests_usan_LDADD = $(LDADD_GTEST) -lswsscommon -lpthread -lprotobuf diff --git a/src/sonic-framework/tests/init_thread_test.cpp b/src/sonic-framework/tests/init_thread_test.cpp new file mode 100644 index 000000000000..482170b76d6b --- /dev/null +++ b/src/sonic-framework/tests/init_thread_test.cpp @@ -0,0 +1,923 @@ +#include "init_thread.h" + +#include +#include +#include + +#include +#include +#include +#include + +#include "mock_reboot_interfaces.h" +#include "reboot_interfaces.h" +#include "redis_utils.h" +#include "select.h" +#include "selectableevent.h" +#include "stateverification.h" +#include "status_code_util.h" +#include "table.h" +#include "test_utils_common.h" +#include "timestamp.h" +#include "warm_restart.h" + +namespace rebootbackend { + +using WarmBootStage = ::swss::WarmStart::WarmBootStage; + +using ::testing::_; +using ::testing::AtLeast; +using ::testing::ExplainMatchResult; +using ::testing::IsEmpty; +using ::testing::Not; +using ::testing::Return; +using ::testing::StrEq; +using ::testing::StrictMock; + +constexpr int kSelectTimeoutSeconds = 5; +constexpr int kShortSelectTimeoutSeconds = 1; + +MATCHER(IsDoneStatus, "") { + const InitThreadStatus::DetailedStatus &status = arg; + if (status.thread_state.active()) { + *result_listener << "Status was active, expected inactive"; + return false; + } + if (status.detailed_thread_status != InitThreadStatus::ThreadStatus::DONE) { + *result_listener << "Status was not DONE: " + << status.detailed_thread_status; + return false; + } + if (status.thread_state.method() != gnoi::system::RebootMethod::NSF) { + *result_listener << "Proto method was not NSF: " + << status.thread_state.status().status(); + } + if (status.thread_state.status().status() != + gnoi::system::RebootStatus_Status::RebootStatus_Status_STATUS_SUCCESS) { + *result_listener << "Proto status was not SUCCESS: " + << status.thread_state.status().status(); + return false; + } + return true; +} + +MATCHER_P(IsActiveStatus, state_matcher, "") { + const InitThreadStatus::DetailedStatus &status = arg; + if (!status.thread_state.active()) { + *result_listener << "Status was inactive, expected active"; + return false; + } + if (status.thread_state.status().status() != + gnoi::system::RebootStatus_Status::RebootStatus_Status_STATUS_UNKNOWN) { + *result_listener << "Proto status was not UNKNOWN: " + << status.thread_state.status().status(); + return false; + } + return ExplainMatchResult(state_matcher, status.detailed_thread_status, + result_listener); +} + +MATCHER_P(IsErrorStatus, error_condition_matcher, "") { + const InitThreadStatus::DetailedStatus &status = arg; + if (status.thread_state.active()) { + *result_listener << "Status was active, expected inactive"; + return false; + } + if (status.detailed_thread_status != InitThreadStatus::ThreadStatus::ERROR) { + *result_listener << "Status was not ERROR: " + << status.detailed_thread_status; + return false; + } + if (status.thread_state.method() != gnoi::system::RebootMethod::NSF) { + *result_listener << "Proto method was not NSF: " + << status.thread_state.status().status(); + } + if (status.thread_state.status().status() != + gnoi::system::RebootStatus_Status::RebootStatus_Status_STATUS_FAILURE) { + *result_listener << "Proto status was not FAILURE: " + << status.thread_state.status().status(); + return false; + } + return ExplainMatchResult(error_condition_matcher, + status.detailed_thread_error_condition, + result_listener); +} + +class InitThreadTest : public ::testing::Test { + public: + InitThreadTest() + : m_db("STATE_DB", 0), + m_config_db("CONFIG_DB", 0), + m_critical_interface(), + m_nsf_channel(&m_db, swss::WarmStart::kNsfManagerNotificationChannel), + m_init_thread(m_critical_interface, m_telemetry, m_finished, + m_stack_unfrozen) { + swss::WarmStart::initialize("fake_app", "fake_docker"); + // sigterm_requested and the Redis tables have global state that is + // maintained across tests. + sigterm_requested = false; + TestUtils::clear_tables(m_db); + init_redis_defaults(); + overwrite_reconciliation_timeout(5); + } + + void init_redis_defaults() { + set_warm_restart_enable(m_db, true); + TestUtils::set_state_verification_enable(m_config_db, /*bootup=*/true, + /*enabled=*/true); + } + + void set_default_success_expects() { + EXPECT_CALL(m_critical_interface, is_system_critical()) + .Times(AtLeast(1)) + .WillRepeatedly(Return(false)); + EXPECT_CALL(m_telemetry, record_overall_end(true)).Times(1); + } + + void check_final_success_expects(bool state_verification_enabled) { + TestUtils::check_warmboot_enabled(m_db, /*expected_state=*/false); + if (state_verification_enabled) { + check_nsf_manager_notification_sent( + swss::WarmStart::WarmBootNotification::kUnfreeze); + } + } + + void check_final_failure_expects() { + TestUtils::check_warmboot_enabled(m_db, /*expected_state=*/false); + } + + void check_nsf_manager_notification_sent( + swss::WarmStart::WarmBootNotification notification_type) { + swss::Select s; + s.addSelectable(&m_nsf_channel); + + swss::Selectable *sel; + int select_result = s.select(&sel, 2000); + EXPECT_EQ(select_result, swss::Select::OBJECT); + + if (sel == &m_nsf_channel) { + std::string op, data; + std::vector values; + m_nsf_channel.pop(op, data, values); + EXPECT_EQ(op, swss::WarmStart::warmBootNotificationNameMap()->at( + notification_type)); + } + } + + void set_telemetry_stage_expects(WarmBootStage nsf_stage, bool success) { + EXPECT_CALL(m_telemetry, record_stage_start(nsf_stage)).Times(1); + EXPECT_CALL(m_telemetry, record_stage_end(nsf_stage, success)).Times(1); + } + + void overwrite_reconciliation_timeout(uint32_t timeout_seconds) { + m_init_thread.m_reconciliation_timeout = timeout_seconds; + } + + void overwrite_state_verification_timeout(uint32_t timeout_seconds) { + m_init_thread.m_state_verification_timeout = timeout_seconds; + } + + void overwrite_unfreeze_timeout(uint32_t timeout_seconds) { + m_init_thread.m_unfreeze_timeout = timeout_seconds; + } + + void populate_default_init_table() { + swss::Table initTable(&m_db, STATE_WARM_RESTART_INIT_TABLE_NAME); + initTable.hset("docker1|app1", "timestamp", ""); + initTable.hset("docker2|app2", "timestamp", ""); + initTable.hset("docker3|app3", "timestamp", ""); + // The invalid entry should not end up in the list of apps. + initTable.hset("invalid", "timestamp", ""); + } + + void advance_through_registration() { + populate_default_init_table(); + TestUtils::populate_registration_table(m_db, "docker1|app1", false, false, + false, true); + TestUtils::populate_registration_table(m_db, "docker2|app2", true, true, + true, false); + TestUtils::populate_registration_table(m_db, "docker3|app3", false, false, + true, false); + } + + void set_apps_to_state(std::string state) { + TestUtils::populate_restart_table_state(m_db, "app1", state); + TestUtils::populate_restart_table_state(m_db, "app2", state); + TestUtils::populate_restart_table_state(m_db, "app3", state); + } + + void advance_through_reconciliation() { + EXPECT_CALL(m_telemetry, + record_stage_end(WarmBootStage::STAGE_RECONCILIATION, + /*success=*/true)) + .Times(1); + advance_through_registration(); + set_apps_to_state("reconciled"); + } + + // Must be run in a separate thread. + void advance_through_state_verification() { + swss::NotificationConsumer nc(&m_db, STATE_VERIFICATION_REQ_CHANNEL); + + advance_through_reconciliation(); + + std::string timestamp = TestUtils::wait_for_state_verification_trigger( + nc, kSelectTimeoutSeconds, /*freeze=*/true); + EXPECT_THAT(timestamp, Not(IsEmpty())); + + if (timestamp.empty()) { + return; + } + + TestUtils::write_state_verification_result(m_db, ALL_COMPONENT, SV_PASS, + timestamp); + } + + // Must be run in a separate thread. + void advance_through_unfreeze_with_state(std::string final_state) { + set_telemetry_stage_expects(WarmBootStage::STAGE_UNFREEZE, + final_state == "completed"); + + swss::NotificationConsumer nc(&m_db, STATE_VERIFICATION_REQ_CHANNEL); + + advance_through_reconciliation(); + + std::string timestamp = TestUtils::wait_for_state_verification_trigger( + nc, kSelectTimeoutSeconds, /*freeze=*/true); + EXPECT_THAT(timestamp, Not(IsEmpty())); + if (timestamp.empty()) { + return; + } + + // Set apps to their final state before unfreeze runs. + set_apps_to_state(final_state); + + TestUtils::write_state_verification_result(m_db, ALL_COMPONENT, SV_PASS, + timestamp); + } + + protected: + swss::DBConnector m_db; + swss::DBConnector m_config_db; + StrictMock m_critical_interface; + StrictMock m_telemetry; + swss::NotificationConsumer m_nsf_channel; + swss::SelectableEvent m_finished; + swss::SelectableEvent m_stack_unfrozen; + InitThread m_init_thread; +}; + +TEST_F(InitThreadTest, TestJoinWithoutStart) { + EXPECT_FALSE(m_init_thread.Join()); +} + +TEST_F(InitThreadTest, NoNsfIfCritical) { + EXPECT_CALL(m_critical_interface, is_system_critical()) + .Times(AtLeast(1)) + .WillRepeatedly(Return(true)); + EXPECT_CALL(m_telemetry, record_overall_end(false)).Times(1); + + EXPECT_EQ(m_init_thread.Start(), + swss::StatusCode::SWSS_RC_FAILED_PRECONDITION); + + EXPECT_THAT( + m_init_thread.GetDetailedStatus(), + IsErrorStatus(InitThreadStatus::ErrorCondition::DETECTED_CRITICAL_STATE)); + check_final_failure_expects(); +} + +TEST_F(InitThreadTest, RegistrationCancelsForCritical) { + EXPECT_CALL(m_critical_interface, is_system_critical()) + .Times(AtLeast(2)) + .WillOnce(Return(false)) + .WillRepeatedly(Return(true)); + EXPECT_CALL(m_telemetry, record_overall_end(false)).Times(1); + + populate_default_init_table(); + + EXPECT_EQ(m_init_thread.Start(), swss::StatusCode::SWSS_RC_SUCCESS); + m_init_thread.Join(); + + EXPECT_THAT( + m_init_thread.GetDetailedStatus(), + IsErrorStatus(InitThreadStatus::ErrorCondition::REGISTRATION_FAILED)); + check_final_failure_expects(); +} + +TEST_F(InitThreadTest, SigtermRequestedBeforeRun) { + EXPECT_CALL(m_critical_interface, is_system_critical()) + .Times(AtLeast(1)) + .WillRepeatedly(Return(false)); + EXPECT_CALL(m_critical_interface, report_critical_state(_)).Times(1); + EXPECT_CALL(m_telemetry, record_overall_end(false)).Times(1); + + populate_default_init_table(); + sigterm_requested = true; + + EXPECT_EQ(m_init_thread.Start(), swss::StatusCode::SWSS_RC_SUCCESS); + m_init_thread.Join(); + + EXPECT_THAT(m_init_thread.GetDetailedStatus(), IsErrorStatus(_)); + check_final_failure_expects(); +} + +TEST_F(InitThreadTest, RegistrationStopped) { + EXPECT_CALL(m_critical_interface, is_system_critical()) + .Times(AtLeast(1)) + .WillRepeatedly(Return(false)); + EXPECT_CALL(m_critical_interface, report_critical_state(_)).Times(1); + EXPECT_CALL(m_telemetry, record_overall_end(false)).Times(1); + + populate_default_init_table(); + + EXPECT_EQ(m_init_thread.Start(), swss::StatusCode::SWSS_RC_SUCCESS); + // This will stop the thread in the registration loop. + std::this_thread::sleep_for(std::chrono::milliseconds(100)); + m_init_thread.Stop(); + m_init_thread.Join(); + + EXPECT_THAT( + m_init_thread.GetDetailedStatus(), + IsErrorStatus(InitThreadStatus::ErrorCondition::REGISTRATION_FAILED)); + check_final_failure_expects(); +} + +TEST_F(InitThreadTest, RegistrationTimeout) { + EXPECT_CALL(m_critical_interface, is_system_critical()) + .Times(AtLeast(1)) + .WillRepeatedly(Return(false)); + EXPECT_CALL(m_critical_interface, report_critical_state(_)).Times(1); + EXPECT_CALL(m_telemetry, record_overall_end(false)).Times(1); + + populate_default_init_table(); + overwrite_reconciliation_timeout(1); + + EXPECT_EQ(m_init_thread.Start(), swss::StatusCode::SWSS_RC_SUCCESS); + m_init_thread.Join(); + + EXPECT_THAT( + m_init_thread.GetDetailedStatus(), + IsErrorStatus(InitThreadStatus::ErrorCondition::REGISTRATION_FAILED)); + check_final_failure_expects(); +} + +TEST_F(InitThreadTest, ReconciliationStopped) { + EXPECT_CALL(m_critical_interface, is_system_critical()) + .Times(AtLeast(1)) + .WillRepeatedly(Return(false)); + EXPECT_CALL(m_critical_interface, report_critical_state(_)).Times(1); + EXPECT_CALL(m_telemetry, record_overall_end(false)).Times(1); + EXPECT_CALL(m_telemetry, record_stage_end(WarmBootStage::STAGE_RECONCILIATION, + /*success=*/false)) + .Times(1); + + advance_through_registration(); + + EXPECT_EQ(m_init_thread.Start(), swss::StatusCode::SWSS_RC_SUCCESS); + // Registration is done, so this will stop the thread in the reconciliation + // loop. + std::this_thread::sleep_for(std::chrono::milliseconds(100)); + m_init_thread.Stop(); + m_init_thread.Join(); + + EXPECT_THAT( + m_init_thread.GetDetailedStatus(), + IsErrorStatus(InitThreadStatus::ErrorCondition::RECONCILIATION_FAILED)); + check_final_failure_expects(); +} + +TEST_F(InitThreadTest, ReconciliationCritical) { + EXPECT_CALL(m_critical_interface, is_system_critical()) + .Times(AtLeast(3)) + .WillOnce(Return(false)) + .WillOnce(Return(false)) + .WillRepeatedly(Return(true)); + EXPECT_CALL(m_telemetry, record_overall_end(false)).Times(1); + EXPECT_CALL(m_telemetry, record_stage_end(WarmBootStage::STAGE_RECONCILIATION, + /*success=*/false)) + .Times(1); + + advance_through_registration(); + + EXPECT_EQ(m_init_thread.Start(), swss::StatusCode::SWSS_RC_SUCCESS); + m_init_thread.Join(); + + EXPECT_THAT( + m_init_thread.GetDetailedStatus(), + IsErrorStatus(InitThreadStatus::ErrorCondition::RECONCILIATION_FAILED)); + check_final_failure_expects(); +} + +TEST_F(InitThreadTest, ReconciliationTimeout) { + EXPECT_CALL(m_critical_interface, is_system_critical()) + .Times(AtLeast(1)) + .WillRepeatedly(Return(false)); + EXPECT_CALL(m_critical_interface, report_critical_state(_)).Times(1); + EXPECT_CALL(m_telemetry, record_overall_end(false)).Times(1); + EXPECT_CALL(m_telemetry, record_stage_end(WarmBootStage::STAGE_RECONCILIATION, + /*success=*/false)) + .Times(1); + + advance_through_registration(); + + overwrite_reconciliation_timeout(1); + + EXPECT_EQ(m_init_thread.Start(), swss::StatusCode::SWSS_RC_SUCCESS); + m_init_thread.Join(); + + EXPECT_THAT( + m_init_thread.GetDetailedStatus(), + IsErrorStatus(InitThreadStatus::ErrorCondition::RECONCILIATION_FAILED)); + check_final_failure_expects(); +} + +TEST_F(InitThreadTest, ReconciliationAlreadyFailed) { + EXPECT_CALL(m_critical_interface, is_system_critical()) + .Times(AtLeast(1)) + .WillRepeatedly(Return(false)); + EXPECT_CALL(m_critical_interface, report_critical_state(_)).Times(1); + EXPECT_CALL(m_telemetry, record_overall_end(false)).Times(1); + EXPECT_CALL(m_telemetry, record_stage_end(WarmBootStage::STAGE_RECONCILIATION, + /*success=*/false)) + .Times(1); + + advance_through_registration(); + TestUtils::populate_restart_table_state(m_db, "app1", "failed"); + + swss::Select s; + s.addSelectable(&m_finished); + + EXPECT_EQ(m_init_thread.Start(), swss::StatusCode::SWSS_RC_SUCCESS); + m_init_thread.Join(); + + EXPECT_THAT( + m_init_thread.GetDetailedStatus(), + IsErrorStatus(InitThreadStatus::ErrorCondition::RECONCILIATION_FAILED)); + check_final_failure_expects(); +} + +TEST_F(InitThreadTest, ReconciliationAlreadyDone) { + TestUtils::set_state_verification_enable(m_config_db, /*bootup=*/true, + /*enabled=*/false); + set_default_success_expects(); + EXPECT_CALL(m_telemetry, record_stage_end(WarmBootStage::STAGE_RECONCILIATION, + /*success=*/true)) + .Times(1); + + advance_through_registration(); + TestUtils::populate_restart_table_state(m_db, "app1", "reconciled"); + TestUtils::populate_restart_table_state(m_db, "app2", "reconciled"); + TestUtils::populate_restart_table_state(m_db, "app3", "reconciled"); + + swss::Select s; + s.addSelectable(&m_finished); + + EXPECT_EQ(m_init_thread.Start(), swss::StatusCode::SWSS_RC_SUCCESS); + TestUtils::wait_for_finish(s, m_finished, kSelectTimeoutSeconds); + m_init_thread.Join(); + + EXPECT_THAT(m_init_thread.GetDetailedStatus(), IsDoneStatus()); + check_final_success_expects(/*state_verification_enabled=*/false); +} + +TEST_F(InitThreadTest, ReconciliationFails) { + EXPECT_CALL(m_critical_interface, is_system_critical()) + .Times(AtLeast(1)) + .WillRepeatedly(Return(false)); + EXPECT_CALL(m_critical_interface, report_critical_state(_)).Times(1); + EXPECT_CALL(m_telemetry, record_overall_end(false)).Times(1); + EXPECT_CALL(m_telemetry, record_stage_end(WarmBootStage::STAGE_RECONCILIATION, + /*success=*/false)) + .Times(1); + + advance_through_registration(); + + // Apps register one-by-one. + auto test_sequence = [&] { + std::this_thread::sleep_for(std::chrono::milliseconds(100)); + TestUtils::populate_restart_table_state(m_db, "app1", "failed"); + }; + std::thread test_thread = std::thread(test_sequence); + + EXPECT_EQ(m_init_thread.Start(), swss::StatusCode::SWSS_RC_SUCCESS); + swss::Select s; + s.addSelectable(&m_finished); + TestUtils::wait_for_finish(s, m_finished, kSelectTimeoutSeconds); + m_init_thread.Join(); + + test_thread.join(); + + EXPECT_THAT( + m_init_thread.GetDetailedStatus(), + IsErrorStatus(InitThreadStatus::ErrorCondition::RECONCILIATION_FAILED)); + check_final_failure_expects(); +} + +TEST_F(InitThreadTest, StateVerificationStopped) { + EXPECT_CALL(m_critical_interface, is_system_critical()) + .Times(AtLeast(1)) + .WillRepeatedly(Return(false)); + EXPECT_CALL(m_critical_interface, report_critical_state(_)).Times(1); + EXPECT_CALL(m_telemetry, record_overall_end(false)).Times(1); + + advance_through_reconciliation(); + + EXPECT_EQ(m_init_thread.Start(), swss::StatusCode::SWSS_RC_SUCCESS); + // Registration and reconciliation are done, so this will stop the thread in + // the state verification loop. + std::this_thread::sleep_for(std::chrono::milliseconds(100)); + m_init_thread.Stop(); + m_init_thread.Join(); + + EXPECT_THAT(m_init_thread.GetDetailedStatus(), + IsErrorStatus( + InitThreadStatus::ErrorCondition::STATE_VERIFICATION_FAILED)); + check_final_failure_expects(); +} + +TEST_F(InitThreadTest, StateVerificationCritical) { + EXPECT_CALL(m_critical_interface, is_system_critical()) + .Times(AtLeast(4)) + .WillOnce(Return(false)) + .WillOnce(Return(false)) + .WillOnce(Return(false)) + .WillRepeatedly(Return(true)); + EXPECT_CALL(m_telemetry, record_overall_end(false)).Times(1); + + advance_through_reconciliation(); + + EXPECT_EQ(m_init_thread.Start(), swss::StatusCode::SWSS_RC_SUCCESS); + m_init_thread.Join(); + + EXPECT_THAT(m_init_thread.GetDetailedStatus(), + IsErrorStatus( + InitThreadStatus::ErrorCondition::STATE_VERIFICATION_FAILED)); + check_final_failure_expects(); +} + +TEST_F(InitThreadTest, StateVerificationFails) { + EXPECT_CALL(m_critical_interface, is_system_critical()) + .Times(AtLeast(1)) + .WillRepeatedly(Return(false)); + EXPECT_CALL(m_critical_interface, report_critical_state(_)).Times(1); + EXPECT_CALL(m_telemetry, record_overall_end(false)).Times(1); + + advance_through_reconciliation(); + + overwrite_state_verification_timeout(1); + + std::string timestamp; + auto test_sequence = [&] { + swss::NotificationConsumer nc(&m_db, STATE_VERIFICATION_REQ_CHANNEL); + timestamp = TestUtils::wait_for_state_verification_trigger( + nc, kSelectTimeoutSeconds, /*freeze=*/true); + + TestUtils::write_state_verification_result(m_db, ALL_COMPONENT, SV_FAIL, + timestamp); + }; + std::thread test_thread = std::thread(test_sequence); + + EXPECT_EQ(m_init_thread.Start(), swss::StatusCode::SWSS_RC_SUCCESS); + m_init_thread.Join(); + + test_thread.join(); + + EXPECT_THAT(timestamp, Not(IsEmpty())); + EXPECT_THAT(m_init_thread.GetDetailedStatus(), + IsErrorStatus( + InitThreadStatus::ErrorCondition::STATE_VERIFICATION_FAILED)); + check_final_failure_expects(); +} + +TEST_F(InitThreadTest, UnfreezeStopped) { + EXPECT_CALL(m_critical_interface, is_system_critical()) + .Times(AtLeast(1)) + .WillRepeatedly(Return(false)); + EXPECT_CALL(m_critical_interface, report_minor_alarm(_)).Times(1); + EXPECT_CALL(m_telemetry, record_overall_end(false)).Times(1); + set_telemetry_stage_expects(WarmBootStage::STAGE_UNFREEZE, + /*success=*/false); + + swss::Select s; + s.addSelectable(&m_stack_unfrozen); + std::thread test_thread = + std::thread(&InitThreadTest::advance_through_state_verification, this); + + EXPECT_EQ(m_init_thread.Start(), swss::StatusCode::SWSS_RC_SUCCESS); + TestUtils::wait_for_finish(s, m_stack_unfrozen, kSelectTimeoutSeconds); + // Registration, reconciliation, and state verification are done, so this + // will stop the thread in the unfreeze loop. + std::this_thread::sleep_for(std::chrono::milliseconds(100)); + m_init_thread.Stop(); + m_init_thread.Join(); + + test_thread.join(); + + EXPECT_THAT(m_init_thread.GetDetailedStatus(), + IsErrorStatus(InitThreadStatus::ErrorCondition::UNFREEZE_FAILED)); + check_final_failure_expects(); +} + +TEST_F(InitThreadTest, UnfreezeCritical) { + EXPECT_CALL(m_critical_interface, is_system_critical()) + .Times(AtLeast(5)) + .WillOnce(Return(false)) + .WillOnce(Return(false)) + .WillOnce(Return(false)) + .WillOnce(Return(false)) + .WillRepeatedly(Return(true)); + EXPECT_CALL(m_critical_interface, report_minor_alarm(_)).Times(1); + EXPECT_CALL(m_telemetry, record_overall_end(false)).Times(1); + set_telemetry_stage_expects(WarmBootStage::STAGE_UNFREEZE, + /*success=*/false); + + swss::Select s; + s.addSelectable(&m_stack_unfrozen); + std::thread test_thread = + std::thread(&InitThreadTest::advance_through_state_verification, this); + + EXPECT_EQ(m_init_thread.Start(), swss::StatusCode::SWSS_RC_SUCCESS); + TestUtils::wait_for_finish(s, m_stack_unfrozen, kSelectTimeoutSeconds); + m_init_thread.Join(); + + test_thread.join(); + + EXPECT_THAT(m_init_thread.GetDetailedStatus(), + IsErrorStatus(InitThreadStatus::ErrorCondition::UNFREEZE_FAILED)); + check_final_failure_expects(); +} + +TEST_F(InitThreadTest, UnfreezeTimeout) { + EXPECT_CALL(m_critical_interface, is_system_critical()) + .Times(AtLeast(1)) + .WillRepeatedly(Return(false)); + EXPECT_CALL(m_critical_interface, report_minor_alarm(_)).Times(1); + EXPECT_CALL(m_telemetry, record_overall_end(false)).Times(1); + set_telemetry_stage_expects(WarmBootStage::STAGE_UNFREEZE, + /*success=*/false); + + swss::Select s; + s.addSelectable(&m_stack_unfrozen); + std::thread test_thread = + std::thread(&InitThreadTest::advance_through_state_verification, this); + + overwrite_unfreeze_timeout(1); + + EXPECT_EQ(m_init_thread.Start(), swss::StatusCode::SWSS_RC_SUCCESS); + TestUtils::wait_for_finish(s, m_stack_unfrozen, kSelectTimeoutSeconds); + m_init_thread.Join(); + + test_thread.join(); + + EXPECT_THAT(m_init_thread.GetDetailedStatus(), + IsErrorStatus(InitThreadStatus::ErrorCondition::UNFREEZE_FAILED)); + check_final_failure_expects(); +} + +TEST_F(InitThreadTest, UnfreezeAlreadyFailed) { + EXPECT_CALL(m_critical_interface, is_system_critical()) + .Times(AtLeast(1)) + .WillRepeatedly(Return(false)); + EXPECT_CALL(m_critical_interface, report_minor_alarm(_)).Times(1); + EXPECT_CALL(m_telemetry, record_overall_end(false)).Times(1); + + swss::Select s; + s.addSelectable(&m_stack_unfrozen); + std::thread test_thread = std::thread( + &InitThreadTest::advance_through_unfreeze_with_state, this, "failed"); + + EXPECT_EQ(m_init_thread.Start(), swss::StatusCode::SWSS_RC_SUCCESS); + TestUtils::wait_for_finish(s, m_stack_unfrozen, kSelectTimeoutSeconds); + m_init_thread.Join(); + + test_thread.join(); + + EXPECT_THAT(m_init_thread.GetDetailedStatus(), + IsErrorStatus(InitThreadStatus::ErrorCondition::UNFREEZE_FAILED)); + check_final_failure_expects(); +} + +TEST_F(InitThreadTest, UnfreezeAlreadyDone) { + set_default_success_expects(); + + swss::Select s; + s.addSelectable(&m_stack_unfrozen); + std::thread test_thread = std::thread( + &InitThreadTest::advance_through_unfreeze_with_state, this, "completed"); + + EXPECT_EQ(m_init_thread.Start(), swss::StatusCode::SWSS_RC_SUCCESS); + TestUtils::wait_for_finish(s, m_stack_unfrozen, kSelectTimeoutSeconds); + m_init_thread.Join(); + + test_thread.join(); + + EXPECT_THAT(m_init_thread.GetDetailedStatus(), IsDoneStatus()); + check_final_success_expects(/*state_verification_enabled=*/true); +} + +class InitThreadTestWithSvResult + : public InitThreadTest, + public testing::WithParamInterface {}; + +TEST_P(InitThreadTestWithSvResult, FullPassWorks) { + set_default_success_expects(); + if (GetParam() == SV_NOT_RUN) { + EXPECT_CALL(m_critical_interface, report_minor_alarm(_)).Times(1); + } + EXPECT_CALL(m_telemetry, record_stage_end(WarmBootStage::STAGE_RECONCILIATION, + /*success=*/true)) + .Times(1); + set_telemetry_stage_expects(WarmBootStage::STAGE_UNFREEZE, + /*success=*/true); + + populate_default_init_table(); + + // Apps register one-by-one. + auto test_sequence = [&] { + // Registration step. + std::this_thread::sleep_for(std::chrono::milliseconds(100)); + EXPECT_THAT(m_init_thread.GetDetailedStatus(), + IsActiveStatus( + InitThreadStatus::ThreadStatus::WAITING_FOR_REGISTRATION)); + TestUtils::populate_registration_table(m_db, "docker1|app1", false, true, + true, true); + std::this_thread::sleep_for(std::chrono::milliseconds(100)); + TestUtils::populate_registration_table(m_db, "docker2|app2", false, true, + true, true); + std::this_thread::sleep_for(std::chrono::milliseconds(100)); + TestUtils::populate_registration_table(m_db, "docker3|app3", false, true, + true, true); + std::this_thread::sleep_for(std::chrono::milliseconds(100)); + + // Reconciliation step. + EXPECT_THAT( + m_init_thread.GetDetailedStatus(), + IsActiveStatus( + InitThreadStatus::ThreadStatus::WAITING_FOR_RECONCILIATION)); + TestUtils::populate_restart_table_state(m_db, "app1", "reconciled"); + std::this_thread::sleep_for(std::chrono::milliseconds(100)); + TestUtils::populate_restart_table_state(m_db, "app2", "reconciled"); + std::this_thread::sleep_for(std::chrono::milliseconds(100)); + // Start listening for the verfication request just before completing + // reconciliation. + swss::NotificationConsumer nc(&m_db, STATE_VERIFICATION_REQ_CHANNEL); + TestUtils::populate_restart_table_state(m_db, "app3", "reconciled"); + std::this_thread::sleep_for(std::chrono::milliseconds(100)); + + // State verification step. + EXPECT_THAT( + m_init_thread.GetDetailedStatus(), + IsActiveStatus( + InitThreadStatus::ThreadStatus::WAITING_FOR_STATE_VERIFICATION)); + std::string timestamp = TestUtils::wait_for_state_verification_trigger( + nc, kSelectTimeoutSeconds, /*freeze=*/true); + std::this_thread::sleep_for(std::chrono::milliseconds(100)); + TestUtils::write_state_verification_result(m_db, ALL_COMPONENT, GetParam(), + "wrong_timestamp"); + std::this_thread::sleep_for(std::chrono::milliseconds(100)); + TestUtils::write_state_verification_result(m_db, "fake_component", + GetParam(), "timestamp"); + std::this_thread::sleep_for(std::chrono::milliseconds(100)); + swss::Select unfreeze_select; + unfreeze_select.addSelectable(&m_stack_unfrozen); + TestUtils::write_state_verification_result(m_db, ALL_COMPONENT, GetParam(), + timestamp); + std::this_thread::sleep_for(std::chrono::milliseconds(100)); + + // Unfreeze step. + EXPECT_THAT( + m_init_thread.GetDetailedStatus(), + IsActiveStatus(InitThreadStatus::ThreadStatus::WAITING_FOR_UNFREEZE)); + TestUtils::wait_for_finish(unfreeze_select, m_stack_unfrozen, + kSelectTimeoutSeconds); + TestUtils::populate_restart_table_state(m_db, "app1", "completed"); + std::this_thread::sleep_for(std::chrono::milliseconds(100)); + TestUtils::populate_restart_table_state(m_db, "app2", "completed"); + std::this_thread::sleep_for(std::chrono::milliseconds(100)); + TestUtils::populate_restart_table_state(m_db, "app3", "completed"); + }; + std::thread test_thread = std::thread(test_sequence); + + EXPECT_EQ(m_init_thread.Start(), swss::StatusCode::SWSS_RC_SUCCESS); + + swss::Select s; + s.addSelectable(&m_finished); + TestUtils::wait_for_finish(s, m_finished, kSelectTimeoutSeconds); + + test_thread.join(); + m_init_thread.Join(); + + EXPECT_THAT(m_init_thread.GetDetailedStatus(), IsDoneStatus()); + check_final_success_expects(/*state_verification_enabled=*/true); +} + +INSTANTIATE_TEST_SUITE_P(FullPassSuite, InitThreadTestWithSvResult, + testing::Values(SV_PASS, SV_NOT_RUN)); + +TEST_F(InitThreadTest, StateVerificationTimeoutIsSuccess) { + EXPECT_CALL(m_critical_interface, is_system_critical()) + .Times(AtLeast(1)) + .WillRepeatedly(Return(false)); + EXPECT_CALL(m_critical_interface, report_minor_alarm(_)).Times(1); + EXPECT_CALL(m_telemetry, record_overall_end(true)).Times(1); + + advance_through_reconciliation(); + set_telemetry_stage_expects(WarmBootStage::STAGE_UNFREEZE, + /*success=*/true); + + overwrite_state_verification_timeout(1); + + std::string timestamp; + auto test_sequence = [&] { + swss::Select unfreeze_select; + unfreeze_select.addSelectable(&m_stack_unfrozen); + + // State verification step. State Verification daemon reports no results + // and times out. + swss::NotificationConsumer nc(&m_db, STATE_VERIFICATION_REQ_CHANNEL); + timestamp = TestUtils::wait_for_state_verification_trigger( + nc, kSelectTimeoutSeconds, /*freeze=*/true); + + // Unfreeze step. + TestUtils::wait_for_finish(unfreeze_select, m_stack_unfrozen, + kSelectTimeoutSeconds); + EXPECT_THAT( + m_init_thread.GetDetailedStatus(), + IsActiveStatus(InitThreadStatus::ThreadStatus::WAITING_FOR_UNFREEZE)); + TestUtils::populate_restart_table_state(m_db, "app1", "completed"); + std::this_thread::sleep_for(std::chrono::milliseconds(100)); + TestUtils::populate_restart_table_state(m_db, "app2", "completed"); + std::this_thread::sleep_for(std::chrono::milliseconds(100)); + TestUtils::populate_restart_table_state(m_db, "app3", "completed"); + }; + std::thread test_thread = std::thread(test_sequence); + + EXPECT_EQ(m_init_thread.Start(), swss::StatusCode::SWSS_RC_SUCCESS); + + swss::Select s; + s.addSelectable(&m_finished); + TestUtils::wait_for_finish(s, m_finished, kSelectTimeoutSeconds); + + test_thread.join(); + m_init_thread.Join(); + + EXPECT_THAT(m_init_thread.GetDetailedStatus(), IsDoneStatus()); + check_final_success_expects(/*state_verification_enabled=*/true); +} + +TEST_F(InitThreadTest, FullPassNoStateVerification) { + TestUtils::set_state_verification_enable(m_config_db, /*bootup=*/true, + /*enabled=*/false); + + set_default_success_expects(); + EXPECT_CALL(m_telemetry, record_stage_end(WarmBootStage::STAGE_RECONCILIATION, + /*success=*/true)) + .Times(1); + + populate_default_init_table(); + + // Apps register one-by-one. + auto test_sequence = [&] { + // Registration step. + std::this_thread::sleep_for(std::chrono::milliseconds(100)); + TestUtils::populate_registration_table(m_db, "docker1|app1", false, true, + true, true); + std::this_thread::sleep_for(std::chrono::milliseconds(100)); + TestUtils::populate_registration_table(m_db, "docker2|app2", false, true, + true, true); + std::this_thread::sleep_for(std::chrono::milliseconds(100)); + TestUtils::populate_registration_table(m_db, "docker3|app3", false, true, + true, true); + std::this_thread::sleep_for(std::chrono::milliseconds(100)); + + // Reconciliation step. + TestUtils::populate_restart_table_state(m_db, "app1", "reconciled"); + std::this_thread::sleep_for(std::chrono::milliseconds(100)); + TestUtils::populate_restart_table_state(m_db, "app2", "reconciled"); + std::this_thread::sleep_for(std::chrono::milliseconds(100)); + // Start listening for the verfication request just before completing + // reconciliation. + swss::Select unfreeze_select; + unfreeze_select.addSelectable(&m_stack_unfrozen); + swss::NotificationConsumer nc(&m_db, STATE_VERIFICATION_REQ_CHANNEL); + TestUtils::populate_restart_table_state(m_db, "app3", "reconciled"); + + // No state verification signal. + TestUtils::confirm_no_state_verification_trigger( + nc, kShortSelectTimeoutSeconds); + }; + std::thread test_thread = std::thread(test_sequence); + + EXPECT_EQ(m_init_thread.Start(), swss::StatusCode::SWSS_RC_SUCCESS); + swss::Select s; + s.addSelectable(&m_finished); + TestUtils::wait_for_finish(s, m_finished, kSelectTimeoutSeconds); + + m_init_thread.Join(); + test_thread.join(); + + EXPECT_THAT(m_init_thread.GetDetailedStatus(), IsDoneStatus()); + check_final_success_expects(/*state_verification_enabled=*/false); +} + +} // namespace rebootbackend diff --git a/src/sonic-framework/tests/mock_reboot_interfaces.h b/src/sonic-framework/tests/mock_reboot_interfaces.h new file mode 100644 index 000000000000..58a34792cff2 --- /dev/null +++ b/src/sonic-framework/tests/mock_reboot_interfaces.h @@ -0,0 +1,62 @@ +#pragma once +#include + +#include "init_thread.h" +#include "reboot_interfaces.h" +#include "selectableevent.h" +#include "system/system.pb.h" + +namespace rebootbackend { + +class MockDbusInterface : public DbusInterface { + public: + MOCK_METHOD(DbusInterface::DbusResponse, Reboot, (const std::string &), + (override)); + MOCK_METHOD(DbusInterface::DbusResponse, RebootStatus, (const std::string &), + (override)); + MOCK_METHOD(DbusInterface::DbusResponse, StopContainers, (const std::string&), + (override)); + MOCK_METHOD(DbusInterface::DbusResponse, StopContainerStatus, + (const std::string&), (override)); +}; + +class MockCriticalStateInterface : public CriticalStateInterface { + public: + MOCK_METHOD(bool, is_system_critical, (), (override)); + MOCK_METHOD(void, report_minor_alarm, (const std::string &), (override)); + MOCK_METHOD(void, report_critical_state, (const std::string &), (override)); +}; + +class MockTelemetryInterface : public TelemetryInterface { + public: + ~MockTelemetryInterface() override = default; + + MOCK_METHOD(void, record_overall_start, (), (override)); + MOCK_METHOD(void, record_overall_end, (bool success), (override)); + MOCK_METHOD(void, record_stage_start, + (swss::WarmStart::WarmBootStage nsf_stage), (override)); + MOCK_METHOD(void, record_stage_end, + (swss::WarmStart::WarmBootStage nsf_stage, bool success), + (override)); +}; + +class MockInitThread : public InitThread { + public: + MockInitThread() + : InitThread(m_unused_critical_state, m_unused_telemetry, m_unused_event, + m_unused_event) {} + + MOCK_METHOD(swss::StatusCode, Start, (), (override)); + MOCK_METHOD(void, Stop, (), (override)); + MOCK_METHOD(bool, Join, (), (override)); + MOCK_METHOD(gnoi::system::RebootStatusResponse, GetResponse, (), (override)); + MOCK_METHOD(InitThreadStatus::DetailedStatus, GetDetailedStatus, (), + (override)); + + private: + MockCriticalStateInterface m_unused_critical_state; + MockTelemetryInterface m_unused_telemetry; + swss::SelectableEvent m_unused_event; +}; + +} // namespace rebootbackend \ No newline at end of file diff --git a/src/sonic-framework/tests/reboot_common_test.cpp b/src/sonic-framework/tests/reboot_common_test.cpp new file mode 100644 index 000000000000..72f0cd9dc7ca --- /dev/null +++ b/src/sonic-framework/tests/reboot_common_test.cpp @@ -0,0 +1,27 @@ +#include "reboot_common.h" + +#include +#include +#include + +namespace rebootbackend { + +using ::testing::_; +using ::testing::AtLeast; +using ::testing::ExplainMatchResult; +using ::testing::StrEq; + +MATCHER_P2(CheckTimespec, secs, nsecs, "") { + return (arg.tv_sec == secs && arg.tv_nsec == nsecs); +} + +TEST(RebootCommon, MillisecToTimespec) { + timespec l_timespec = milliseconds_to_timespec(0); + EXPECT_THAT(l_timespec, CheckTimespec(0, 0)); + l_timespec = milliseconds_to_timespec(200); + EXPECT_THAT(l_timespec, CheckTimespec(0, 200 * 1000 * 1000)); + l_timespec = milliseconds_to_timespec(1800); + EXPECT_THAT(l_timespec, CheckTimespec(1, 800 * 1000 * 1000)); +} + +} // namespace rebootbackend diff --git a/src/sonic-framework/tests/reboot_thread_test.cpp b/src/sonic-framework/tests/reboot_thread_test.cpp new file mode 100644 index 000000000000..1bdfa4ea6c88 --- /dev/null +++ b/src/sonic-framework/tests/reboot_thread_test.cpp @@ -0,0 +1,1489 @@ +#include "reboot_thread.h" + +#include +#include +#include +#include + +#include +#include +#include + +#include "container_stop.pb.h" +#include "mock_reboot_interfaces.h" +#include "reboot_common.h" +#include "reboot_interfaces.h" +#include "redis_utils.h" +#include "select.h" +#include "selectableevent.h" +#include "stateverification.h" +#include "status_code_util.h" +#include "system/system.pb.h" +#include "test_utils_common.h" +#include "timestamp.h" +#include "warm_restart.h" + +namespace rebootbackend { + +#define TENTH_SECOND_MS (100) + +using namespace gnoi::system; +namespace gpu = ::google::protobuf::util; +using WarmStartState = ::swss::WarmStart::WarmStartState; +using Progress = ::rebootbackend::RebootThread::Progress; +using RebootThread = ::rebootbackend::RebootThread; +using ::testing::_; +using ::testing::ExplainMatchResult; +using ::testing::HasSubstr; +using ::testing::NiceMock; +using ::testing::Return; +using ::testing::StrEq; +using ::testing::StrictMock; + +MATCHER_P2(IsStatus, status, message, "") { + return (arg.status().status() == status && + ExplainMatchResult(message, arg.status().message(), result_listener)); +} + +class RebootStatusTest : public ::testing::Test { + protected: + RebootStatusTest() : m_status() {} + ThreadStatus m_status; +}; + +TEST_F(RebootStatusTest, TestInit) { + RebootStatusResponse response = m_status.get_response(); + + EXPECT_FALSE(response.active()); + EXPECT_THAT(response.reason(), StrEq("")); + EXPECT_EQ(response.count(), 0); + EXPECT_EQ(response.method(), RebootMethod::UNKNOWN); + EXPECT_EQ(response.status().status(), + RebootStatus_Status::RebootStatus_Status_STATUS_UNKNOWN); + EXPECT_THAT(response.status().message(), StrEq("")); + + EXPECT_FALSE(m_status.get_active()); +} +TEST_F(RebootStatusTest, TestStartStatus) { + m_status.set_start_status(RebootMethod::NSF, "reboot because"); + + RebootStatusResponse response = m_status.get_response(); + + EXPECT_TRUE(response.active()); + EXPECT_THAT(response.reason(), StrEq("reboot because")); + EXPECT_EQ(response.count(), 1); + EXPECT_EQ(response.method(), RebootMethod::NSF); + EXPECT_THAT(response.status().message(), StrEq("")); + + EXPECT_TRUE(m_status.get_active()); +} + +TEST_F(RebootStatusTest, TestSets) { + m_status.set_start_status(RebootMethod::NSF, "reboot because"); + + RebootStatus_Status reboot_status = m_status.get_last_reboot_status(); + EXPECT_EQ(reboot_status, + RebootStatus_Status::RebootStatus_Status_STATUS_UNKNOWN); + + m_status.set_completed_status( + RebootStatus_Status::RebootStatus_Status_STATUS_FAILURE, "timeout"); + + // Have to be inactive to read the status + m_status.set_inactive(); + EXPECT_FALSE(m_status.get_active()); + + RebootStatusResponse response = m_status.get_response(); + EXPECT_THAT(response.status().message(), StrEq("timeout")); + EXPECT_EQ(response.status().status(), + RebootStatus_Status::RebootStatus_Status_STATUS_FAILURE); + + // Can't set message status while inactive + m_status.set_completed_status( + RebootStatus_Status::RebootStatus_Status_STATUS_RETRIABLE_FAILURE, + "anything"); + response = m_status.get_response(); + EXPECT_THAT(response.status().message(), StrEq("timeout")); + EXPECT_EQ(response.status().status(), + RebootStatus_Status::RebootStatus_Status_STATUS_FAILURE); +} + +TEST_F(RebootStatusTest, TestGetStatus) { + std::chrono::nanoseconds curr_ns = std::chrono::high_resolution_clock::now().time_since_epoch(); + + m_status.set_start_status(RebootMethod::COLD, "reboot because"); + + RebootStatusResponse response = m_status.get_response(); + EXPECT_EQ(response.status().status(), + RebootStatus_Status::RebootStatus_Status_STATUS_UNKNOWN); + + m_status.set_completed_status( + RebootStatus_Status::RebootStatus_Status_STATUS_SUCCESS, "anything"); + + response = m_status.get_response(); + + // message should be empty while reboot is active + EXPECT_THAT(response.status().message(), StrEq("")); + + uint64_t reboot_ns = response.when(); + EXPECT_TRUE(reboot_ns > (uint64_t)curr_ns.count()); + + m_status.set_inactive(); + response = m_status.get_response(); + EXPECT_THAT(response.status().message(), StrEq("anything")); + EXPECT_EQ(response.status().status(), + RebootStatus_Status::RebootStatus_Status_STATUS_SUCCESS); + EXPECT_EQ(0, response.when()); +} + +class RebootThreadTest : public ::testing::Test { + protected: + RebootThreadTest() + : m_dbus_interface(), + m_critical_interface(), + m_db("STATE_DB", 0), + m_config_db("CONFIG_DB", 0), + m_reboot_thread(m_dbus_interface, m_critical_interface, m_telemetry, + m_finished) { + swss::WarmStart::initialize("app1", "docker1"); + TestUtils::clear_tables(m_db); + sigterm_requested = false; + } + + void overwrite_reboot_timeout(uint32_t timeout_seconds) { + m_reboot_thread.m_reboot_timeout = timeout_seconds; + } + + void overwrite_state_verification_timeout(uint32_t timeout_seconds) { + m_reboot_thread.m_state_verification_timeout = timeout_seconds; + } + + void overwrite_quiescence_timeout_ms(uint32_t timeout_ms) { + m_reboot_thread.m_quiescence_timeout_ms = timeout_ms; + } + + void overwrite_quiescence_hold_time_ms(uint32_t timeout_ms) { + m_reboot_thread.m_quiescence_hold_time_ms = timeout_ms; + } + + void overwrite_checkpoint_timeout(uint32_t timeout_seconds) { + m_reboot_thread.m_checkpoint_timeout = timeout_seconds; + } + + RebootStatusResponse get_response(void) { + return m_reboot_thread.m_status.get_response(); + } + + void set_start_status(const RebootMethod &method, const std::string &reason) { + return m_reboot_thread.m_status.set_start_status(method, reason); + } + + void set_completed_status(const RebootStatus_Status &status, + const std::string &message) { + return m_reboot_thread.m_status.set_completed_status(status, message); + } + + void force_inactive(void) { return m_reboot_thread.m_status.set_inactive(); } + + void force_active(void) { return m_reboot_thread.m_status.set_inactive(); } + + void do_reboot(void) { return m_reboot_thread.do_reboot(); } + + Progress wait_for_platform_reboot(swss::Select &s) { + return m_reboot_thread.wait_for_platform_reboot(s); + } + + Progress perform_state_verification(swss::Select &s) { + return m_reboot_thread.perform_state_verification(s); + } + + Progress perform_state_verification_select(swss::Select &s, + swss::SelectableTimer &l_timer, + swss::SubscriberStateTable &sub, + std::string ×tamp) { + return m_reboot_thread.state_verification_select(s, l_timer, sub, + timestamp); + } + + RebootThread::Status handle_state_verification_event( + swss::SubscriberStateTable &sub, std::string ×tamp) { + return m_reboot_thread.handle_state_verification_event(sub, timestamp); + } + + // stop: set to true if calling m_reboot_thread.Stop() is desired. + // timeout_ms: replaces m_quiescence_timout_ms if > 0 + Progress perform_freeze_quiescence_w_stop(bool stop, int timeout_ms = -1) { + timespec l_timespec; + if (timeout_ms >= 0) { + l_timespec = milliseconds_to_timespec(timeout_ms); + } else { + l_timespec = + milliseconds_to_timespec(m_reboot_thread.m_quiescence_timeout_ms); + } + + swss::SelectableTimer l_timer(l_timespec); + + swss::Select s; + s.addSelectable(&l_timer); + l_timer.start(); + s.addSelectable(&(return_m_stop_reference())); + + if (stop) { + m_reboot_thread.Stop(); + } + return m_reboot_thread.perform_freeze_quiescence(s, l_timer); + } + + Progress checkpoint_stage_two(swss::Select &s, swss::SelectableTimer &l_timer, + swss::SubscriberStateTable &sub) { + return m_reboot_thread.checkpoint_stage_two(s, l_timer, sub); + } + + Progress perform_checkpoint(swss::Select &s) { + return m_reboot_thread.perform_checkpoint(s); + } + + RebootThread::Status check_container_stop(const std::string &request_id) { + return m_reboot_thread.check_container_stop(request_id); + } + + Progress wait_for_container_stop(int timeout_ms = -1) { + timespec l_timespec; + if (timeout_ms >= 0) { + l_timespec = milliseconds_to_timespec(timeout_ms); + } else { + l_timespec = + milliseconds_to_timespec(m_reboot_thread.m_quiescence_timeout_ms); + } + + swss::SelectableTimer l_timer(l_timespec); + + swss::Select s; + s.addSelectable(&l_timer); + l_timer.start(); + s.addSelectable(&(return_m_stop_reference())); + + m_reboot_thread.Stop(); + + return m_reboot_thread.wait_for_container_stop(s, "reqA", l_timer); + } + + void fetch_registration_info() { + m_reboot_thread.m_registration.fetch_registration_info(); + } + + swss::SelectableEvent &return_m_stop_reference() { + return m_reboot_thread.m_stop; + } + + swss::DBConnector m_db; + swss::DBConnector m_config_db; + NiceMock m_dbus_interface; + NiceMock m_critical_interface; + StrictMock m_telemetry; + swss::SelectableEvent m_finished; + RebootThread m_reboot_thread; +}; + +MATCHER_P2(Status, status, message, "") { + return (arg.status().status() == status && arg.status().message() == message); +} + +TEST_F(RebootThreadTest, TestStop) { + EXPECT_CALL(m_dbus_interface, Reboot(_)) + .Times(1) + .WillOnce(Return(DbusInterface::DbusResponse{ + DbusInterface::DbusStatus::DBUS_SUCCESS, ""})); + EXPECT_CALL(m_critical_interface, is_system_critical()) + .Times(1) + .WillOnce(Return(false)); + EXPECT_CALL(m_critical_interface, + report_critical_state("platform failed to reboot")) + .Times(0); + RebootRequest request; + request.set_method(RebootMethod::COLD); + overwrite_reboot_timeout(2); + m_reboot_thread.Start(request); + m_reboot_thread.Stop(); + m_reboot_thread.Join(); + gnoi::system::RebootStatusResponse response = m_reboot_thread.GetResponse(); + EXPECT_THAT( + response, + IsStatus(RebootStatus_Status::RebootStatus_Status_STATUS_UNKNOWN, "")); +} + +TEST_F(RebootThreadTest, TestCleanExit) { + EXPECT_CALL(m_dbus_interface, Reboot(_)) + .Times(1) + .WillOnce(Return(DbusInterface::DbusResponse{ + DbusInterface::DbusStatus::DBUS_SUCCESS, ""})); + EXPECT_CALL(m_critical_interface, + report_critical_state(("platform failed to reboot"))) + .Times(1); + EXPECT_CALL(m_critical_interface, is_system_critical()) + .Times(1) + .WillOnce(Return(false)); + overwrite_reboot_timeout(1); + + swss::Select s; + s.addSelectable(&m_finished); + + RebootRequest request; + request.set_method(RebootMethod::COLD); + request.set_message("time to reboot"); + m_reboot_thread.Start(request); + TestUtils::wait_for_finish(s, m_finished, 5); + + // Status should be active until we call join + RebootStatusResponse response = get_response(); + EXPECT_TRUE(response.active()); + EXPECT_THAT(response.reason(), StrEq("time to reboot")); + EXPECT_EQ(response.count(), 1); + + EXPECT_THAT(response.status().message(), StrEq("")); + + m_reboot_thread.Join(); + + response = get_response(); + EXPECT_FALSE(response.active()); + EXPECT_THAT(response.status().message(), StrEq("platform failed to reboot")); +} + +TEST_F(RebootThreadTest, TestJoinWithoutStart) { + bool ret = m_reboot_thread.Join(); + EXPECT_FALSE(ret); +} + +// Call Start a second time while first thread is still executing. +TEST_F(RebootThreadTest, TestStartWhileRunning) { + EXPECT_CALL(m_dbus_interface, Reboot(_)) + .Times(1) + .WillOnce(Return(DbusInterface::DbusResponse{ + DbusInterface::DbusStatus::DBUS_SUCCESS, ""})); + EXPECT_CALL(m_critical_interface, + report_critical_state("platform failed to reboot")) + .Times(1); + EXPECT_CALL(m_critical_interface, is_system_critical()) + .Times(1) + .WillOnce(Return(false)); + overwrite_reboot_timeout(2); + + RebootRequest request; + request.set_method(RebootMethod::COLD); + request.set_message("time to reboot"); + m_reboot_thread.Start(request); + + // First thread is still running ... + NotificationResponse response = m_reboot_thread.Start(request); + EXPECT_EQ(response.status, swss::StatusCode::SWSS_RC_IN_USE); + EXPECT_THAT(response.json_string, + StrEq("RebootThread: can't Start while active")); + + bool ret = m_reboot_thread.Join(); + EXPECT_TRUE(ret); +} + +// Call Start a second time after first thread completed +// but before first thread was joined. +// Second start should fail. +TEST_F(RebootThreadTest, TestStartWithoutJoin) { + EXPECT_CALL(m_dbus_interface, Reboot(_)) + .Times(1) + .WillOnce(Return(DbusInterface::DbusResponse{ + DbusInterface::DbusStatus::DBUS_SUCCESS, ""})); + EXPECT_CALL(m_critical_interface, + report_critical_state("platform failed to reboot")) + .Times(1); + EXPECT_CALL(m_critical_interface, is_system_critical()) + .Times(1) + .WillOnce(Return(false)); + overwrite_reboot_timeout(1); + + swss::Select s; + s.addSelectable(&m_finished); + + RebootRequest request; + request.set_method(RebootMethod::COLD); + request.set_message("time to reboot"); + m_reboot_thread.Start(request); + TestUtils::wait_for_finish(s, m_finished, 3); + + // First thread has stopped: we need to join before + // restart will succeed + NotificationResponse response = m_reboot_thread.Start(request); + EXPECT_EQ(response.status, swss::StatusCode::SWSS_RC_IN_USE); + + // This should join the first start. + bool ret = m_reboot_thread.Join(); + EXPECT_TRUE(ret); +} + +TEST_F(RebootThreadTest, TestUnsupportedRebootType) { + RebootRequest request; + request.set_method(RebootMethod::POWERDOWN); + + NotificationResponse response = m_reboot_thread.Start(request); + EXPECT_EQ(response.status, swss::StatusCode::SWSS_RC_INVALID_PARAM); + EXPECT_EQ(response.json_string, + "RebootThread: Start rx'd unsupported method"); +} + +TEST_F(RebootThreadTest, TestDelayedStartUnsupported) { + RebootRequest request; + request.set_method(RebootMethod::NSF); + request.set_delay(1); + + NotificationResponse response = m_reboot_thread.Start(request); + EXPECT_EQ(response.status, swss::StatusCode::SWSS_RC_INVALID_PARAM); + EXPECT_THAT(response.json_string, + StrEq("RebootThread: delayed start not supported")); +} + +TEST_F(RebootThreadTest, TestNoNSFIfNonRetriableFailure) { + set_start_status(RebootMethod::NSF, "time to reboot"); + set_completed_status(RebootStatus_Status::RebootStatus_Status_STATUS_FAILURE, + "platform failed to reboot"); + force_inactive(); + + RebootRequest request; + request.set_method(RebootMethod::NSF); + + NotificationResponse response = m_reboot_thread.Start(request); + EXPECT_EQ(response.status, swss::StatusCode::SWSS_RC_FAILED_PRECONDITION); + EXPECT_EQ(response.json_string, + "RebootThread: last NSF failed with non-retriable failure"); +} + +TEST_F(RebootThreadTest, TestNoNSFIfSystemCritical) { + EXPECT_CALL(m_critical_interface, is_system_critical()) + .Times(1) + .WillOnce(Return(true)); + set_start_status(RebootMethod::NSF, "time to reboot"); + + force_inactive(); + + RebootRequest request; + request.set_method(RebootMethod::NSF); + + NotificationResponse response = m_reboot_thread.Start(request); + EXPECT_EQ(response.status, swss::StatusCode::SWSS_RC_FAILED_PRECONDITION); + EXPECT_EQ(response.json_string, + "RebootThread: in critical state, NSF not allowed"); +} + +TEST_F(RebootThreadTest, TestSigTermStartofDoReboot) { + sigterm_requested = true; + set_start_status(RebootMethod::NSF, "time to reboot"); + do_reboot(); + force_inactive(); + RebootStatusResponse response = m_reboot_thread.GetResponse(); + EXPECT_THAT( + response, + IsStatus(RebootStatus_Status::RebootStatus_Status_STATUS_UNKNOWN, "")); +} + +TEST_F(RebootThreadTest, TestInvalidMethodfDoReboot) { + set_start_status(RebootMethod::POWERUP, "time to reboot"); + do_reboot(); + force_inactive(); + RebootStatusResponse response = m_reboot_thread.GetResponse(); + EXPECT_THAT( + response, + IsStatus(RebootStatus_Status::RebootStatus_Status_STATUS_UNKNOWN, "")); +} + +TEST_F(RebootThreadTest, TestWaitForRebootPositive) { + overwrite_reboot_timeout(1); + EXPECT_CALL(m_critical_interface, is_system_critical()) + .Times(1) + .WillOnce(Return(false)); + set_start_status(RebootMethod::NSF, "time to reboot"); + swss::Select s; + swss::SelectableEvent m_stop; + s.addSelectable(&m_stop); + RebootThread::Progress progress = wait_for_platform_reboot(s); + EXPECT_EQ(progress, RebootThread::Progress::PROCEED); + // EXPECT_EQ(progress, RebootThread::Progress::EXIT_EARLY); +} + +TEST_F(RebootThreadTest, TestWaitForRebootCriticalState) { + EXPECT_CALL(m_critical_interface, is_system_critical()) + .Times(1) + .WillOnce(Return(true)); + set_start_status(RebootMethod::NSF, "time to reboot"); + swss::Select s; + swss::SelectableEvent m_stop; + s.addSelectable(&m_stop); + RebootThread::Progress progress = wait_for_platform_reboot(s); + EXPECT_EQ(progress, RebootThread::Progress::EXIT_EARLY); + force_inactive(); + RebootStatusResponse response = m_reboot_thread.GetResponse(); + EXPECT_THAT( + response, + IsStatus(RebootStatus_Status::RebootStatus_Status_STATUS_FAILURE, + "system entered critical state after platfrom reboot request")); +} + +TEST_F(RebootThreadTest, TestWaitForRebootRxStop) { + EXPECT_CALL(m_critical_interface, is_system_critical()) + .Times(1) + .WillOnce(Return(false)); + set_start_status(RebootMethod::NSF, "time to reboot"); + + swss::Select s; + s.addSelectable(&(return_m_stop_reference())); + m_reboot_thread.Stop(); + RebootThread::Progress progress = wait_for_platform_reboot(s); + EXPECT_EQ(progress, RebootThread::Progress::EXIT_EARLY); + force_inactive(); + RebootStatusResponse response = m_reboot_thread.GetResponse(); + EXPECT_THAT( + response, + IsStatus(RebootStatus_Status::RebootStatus_Status_STATUS_UNKNOWN, "")); +} + +// +// State Verification Tests +// + +TEST_F(RebootThreadTest, TestStateVerificationCriticalState) { + EXPECT_CALL(m_critical_interface, is_system_critical()) + .Times(1) + .WillOnce(Return(true)); + set_start_status(RebootMethod::NSF, "time to reboot"); + + swss::Select s; + s.addSelectable(&(return_m_stop_reference())); + + RebootThread::Progress progress = perform_state_verification(s); + EXPECT_EQ(progress, RebootThread::Progress::EXIT_EARLY); + + force_inactive(); + RebootStatusResponse response = m_reboot_thread.GetResponse(); + EXPECT_THAT( + response, + IsStatus( + RebootStatus_Status::RebootStatus_Status_STATUS_FAILURE, + "system entered critical state before reboot state verification")); +} + +TEST_F(RebootThreadTest, TestStateVerificationDisabled) { + EXPECT_CALL(m_critical_interface, is_system_critical()) + .Times(1) + .WillOnce(Return(false)); + + set_start_status(RebootMethod::NSF, "time to reboot"); + + swss::Table warmRestartTable(&m_config_db, CFG_WARM_RESTART_TABLE_NAME); + warmRestartTable.hset("system", "state_verification_shutdown", "false"); + + swss::Select s; + s.addSelectable(&(return_m_stop_reference())); + + RebootThread::Progress progress = perform_state_verification(s); + EXPECT_EQ(progress, RebootThread::Progress::PROCEED); + + force_inactive(); + RebootStatusResponse response = m_reboot_thread.GetResponse(); + EXPECT_THAT( + response, + IsStatus(RebootStatus_Status::RebootStatus_Status_STATUS_UNKNOWN, "")); +} + +TEST_F(RebootThreadTest, TestStateVerificationTimeout) { + EXPECT_CALL(m_critical_interface, is_system_critical()) + .Times(1) + .WillOnce(Return(false)); + + overwrite_state_verification_timeout(1); + + set_start_status(RebootMethod::NSF, "time to reboot"); + + swss::Table warmRestartTable(&m_config_db, CFG_WARM_RESTART_TABLE_NAME); + warmRestartTable.hset("system", "state_verification_shutdown", "true"); + + swss::Select s; + s.addSelectable(&(return_m_stop_reference())); + + RebootThread::Progress progress = perform_state_verification(s); + EXPECT_EQ(progress, RebootThread::Progress::EXIT_EARLY); + + force_inactive(); + RebootStatusResponse response = m_reboot_thread.GetResponse(); + EXPECT_THAT( + response, + IsStatus( + RebootStatus_Status::RebootStatus_Status_STATUS_RETRIABLE_FAILURE, + "timeout occurred during reboot state verification: retriable " + "error")); +} + +TEST_F(RebootThreadTest, TestStateVerificationStop) { + EXPECT_CALL(m_critical_interface, is_system_critical()) + .Times(1) + .WillOnce(Return(false)); + + overwrite_state_verification_timeout(1); + + set_start_status(RebootMethod::NSF, "time to reboot"); + + swss::Table warmRestartTable(&m_config_db, CFG_WARM_RESTART_TABLE_NAME); + warmRestartTable.hset("system", "state_verification_shutdown", "true"); + + swss::Select s; + s.addSelectable(&(return_m_stop_reference())); + m_reboot_thread.Stop(); + + RebootThread::Progress progress = perform_state_verification(s); + EXPECT_EQ(progress, RebootThread::Progress::EXIT_EARLY); + + force_inactive(); + RebootStatusResponse response = m_reboot_thread.GetResponse(); + EXPECT_THAT( + response, + IsStatus(RebootStatus_Status::RebootStatus_Status_STATUS_UNKNOWN, "")); +} + +TEST_F(RebootThreadTest, TestStateVerificationSelectTimeout) { + set_start_status(RebootMethod::NSF, "time to reboot"); + + swss::Select s; + s.addSelectable(&(return_m_stop_reference())); + + swss::SelectableTimer l_timer(timespec{.tv_sec = 1, .tv_nsec = 0}); + s.addSelectable(&l_timer); + + swss::SubscriberStateTable sub(&m_db, STATE_VERIFICATION_RESP_TABLE); + s.addSelectable(&sub); + + l_timer.start(); + + std::string timestamp = "timestamp-b"; + TestUtils::write_state_verification_result(m_db, ALL_COMPONENT, SV_PASS, + "wrong-timestamp"); + + RebootThread::Progress progress = + perform_state_verification_select(s, l_timer, sub, timestamp); + + EXPECT_EQ(progress, RebootThread::Progress::EXIT_EARLY); + + force_inactive(); + RebootStatusResponse response = m_reboot_thread.GetResponse(); + EXPECT_THAT( + response, + IsStatus( + RebootStatus_Status::RebootStatus_Status_STATUS_RETRIABLE_FAILURE, + "timeout occurred during reboot state verification: retriable " + "error")); +} + +TEST_F(RebootThreadTest, TestStateVerificationSelectTimeoutNotRun) { + set_start_status(RebootMethod::NSF, "time to reboot"); + + swss::Select s; + s.addSelectable(&(return_m_stop_reference())); + + swss::SelectableTimer l_timer(timespec{.tv_sec = 1, .tv_nsec = 0}); + s.addSelectable(&l_timer); + + swss::SubscriberStateTable sub(&m_db, STATE_VERIFICATION_RESP_TABLE); + s.addSelectable(&sub); + + l_timer.start(); + + std::string timestamp = "timestamp-b"; + TestUtils::write_state_verification_result(m_db, ALL_COMPONENT, SV_NOT_RUN, + timestamp); + + RebootThread::Progress progress = + perform_state_verification_select(s, l_timer, sub, timestamp); + + EXPECT_EQ(progress, RebootThread::Progress::EXIT_EARLY); + EXPECT_NE("timestamp-b", timestamp); + + force_inactive(); + RebootStatusResponse response = m_reboot_thread.GetResponse(); + EXPECT_THAT( + response, + IsStatus( + RebootStatus_Status::RebootStatus_Status_STATUS_RETRIABLE_FAILURE, + "timeout occurred during reboot state verification: retriable " + "error")); +} + +TEST_F(RebootThreadTest, TestHandleStateVerificationKeepWaiting) { + set_start_status(RebootMethod::NSF, "time to reboot"); + + swss::Select s; + swss::SubscriberStateTable sub(&m_db, STATE_VERIFICATION_RESP_TABLE); + s.addSelectable(&sub); + swss::Selectable *sel; + + // Unrecognized component returns KEEP_WAITING + std::string timestamp = "timestamp-a"; + TestUtils::write_state_verification_result(m_db, "not-all-component", + "dont care", timestamp); + s.select(&sel); + RebootThread::Status status = handle_state_verification_event(sub, timestamp); + EXPECT_EQ(status, RebootThread::Status::KEEP_WAITING); + + // Wrong timestamp returns KEEP_WAITING + TestUtils::write_state_verification_result(m_db, ALL_COMPONENT, SV_PASS, + "wrong-timestamp"); + s.select(&sel); + status = handle_state_verification_event(sub, timestamp); + EXPECT_EQ(status, RebootThread::Status::KEEP_WAITING); + + // Unrecognized status + correct timestamp = KEEP_WAITING + TestUtils::write_state_verification_result(m_db, ALL_COMPONENT, + "undefined-status", timestamp); + s.select(&sel); + status = handle_state_verification_event(sub, timestamp); + EXPECT_EQ(status, RebootThread::Status::KEEP_WAITING); + + // If we receive NOT_RUN as a status: we KEEP_WAITING + // timestamp should be updated with new value after re-request of state + // verification + TestUtils::write_state_verification_result(m_db, ALL_COMPONENT, SV_NOT_RUN, + timestamp); + s.select(&sel); + status = handle_state_verification_event(sub, timestamp); + EXPECT_EQ(status, RebootThread::Status::KEEP_WAITING); + EXPECT_NE(timestamp, "timestamp-a"); +} + +TEST_F(RebootThreadTest, TestHandleStateVerificationSuccess) { + set_start_status(RebootMethod::NSF, "time to reboot"); + + swss::Select s; + swss::SubscriberStateTable sub(&m_db, STATE_VERIFICATION_RESP_TABLE); + s.addSelectable(&sub); + swss::Selectable *sel; + + // Pass + Correct timestamp == SUCCESS + std::string timestamp = "timestamp-b"; + TestUtils::write_state_verification_result(m_db, ALL_COMPONENT, SV_PASS, + timestamp); + int select_ret = s.select(&sel); + EXPECT_EQ(select_ret, swss::Select::OBJECT); + EXPECT_EQ(sel, &sub); + RebootThread::Status status = handle_state_verification_event(sub, timestamp); + EXPECT_EQ(status, RebootThread::Status::SUCCESS); +} + +TEST_F(RebootThreadTest, TestHandleStateVerificationFail) { + set_start_status(RebootMethod::NSF, "time to reboot"); + + swss::Select s; + swss::SubscriberStateTable sub(&m_db, STATE_VERIFICATION_RESP_TABLE); + s.addSelectable(&sub); + swss::Selectable *sel; + + // Fail with correct timestampe = FAILURE + // status and message are updated + std::string timestamp = "timestamp-b"; + TestUtils::write_state_verification_result(m_db, ALL_COMPONENT, SV_FAIL, + timestamp); + s.select(&sel); + RebootThread::Status status = handle_state_verification_event(sub, timestamp); + EXPECT_EQ(status, RebootThread::Status::FAILURE); + + force_inactive(); + RebootStatusResponse response = m_reboot_thread.GetResponse(); + EXPECT_THAT(response, + IsStatus(RebootStatus_Status::RebootStatus_Status_STATUS_FAILURE, + "state verification failed during reboot")); +} + +// +// Quiescence Tests +// + +TEST_F(RebootThreadTest, TestPerformFreezeQuiescenceCriticalState) { + EXPECT_CALL(m_critical_interface, is_system_critical()) + .Times(1) + .WillOnce(Return(true)); + set_start_status(RebootMethod::NSF, "time to reboot"); + + Progress progress = perform_freeze_quiescence_w_stop(false); + EXPECT_EQ(progress, RebootThread::Progress::EXIT_EARLY); + force_inactive(); + RebootStatusResponse response = m_reboot_thread.GetResponse(); + EXPECT_THAT(response, + IsStatus(RebootStatus_Status::RebootStatus_Status_STATUS_FAILURE, + "system entered critical state before freezing")); +} + +TEST_F(RebootThreadTest, TestPerformFreezeQuiescenceTimeout) { + EXPECT_CALL(m_critical_interface, is_system_critical()) + .Times(1) + .WillOnce(Return(false)); + + TestUtils::populate_registration_table(m_db, "docker1|app1", false, true, + false, false); + TestUtils::populate_registration_table(m_db, "docker2|app2", false, true, + false, false); + fetch_registration_info(); + + overwrite_quiescence_timeout_ms(300); + + set_start_status(RebootMethod::NSF, "time to reboot"); + + Progress progress = perform_freeze_quiescence_w_stop(false); + EXPECT_EQ(progress, RebootThread::Progress::EXIT_EARLY); + + force_inactive(); + RebootStatusResponse response = m_reboot_thread.GetResponse(); + EXPECT_THAT(response, + IsStatus(RebootStatus_Status::RebootStatus_Status_STATUS_FAILURE, + "timeout occurred during reboot stage freeze")); +} + +TEST_F(RebootThreadTest, TestPerformFreezeQuiescenceStop) { + EXPECT_CALL(m_critical_interface, is_system_critical()) + .Times(1) + .WillOnce(Return(false)); + + TestUtils::populate_registration_table(m_db, "docker1|app1", false, true, + false, false); + TestUtils::populate_registration_table(m_db, "docker2|app2", false, true, + false, false); + fetch_registration_info(); + overwrite_quiescence_timeout_ms(1000); + + set_start_status(RebootMethod::NSF, "time to reboot"); + + Progress progress = perform_freeze_quiescence_w_stop(true); + EXPECT_EQ(progress, RebootThread::Progress::EXIT_EARLY); + + force_inactive(); + RebootStatusResponse response = m_reboot_thread.GetResponse(); + + // No error on request to stop, just log. + EXPECT_THAT( + response, + IsStatus(RebootStatus_Status::RebootStatus_Status_STATUS_UNKNOWN, "")); +} + +TEST_F(RebootThreadTest, TestPerformFreezeQuiescenceStartCompleted) { + EXPECT_CALL(m_critical_interface, is_system_critical()) + .Times(1) + .WillOnce(Return(false)); + + TestUtils::populate_registration_table(m_db, "docker1|app1", false, true, + false, false); + TestUtils::populate_registration_table(m_db, "docker2|app2", false, true, + false, false); + TestUtils::populate_restart_table_state( + m_db, "app1", get_warm_start_state_name(WarmStartState::CHECKPOINTED)); + TestUtils::populate_restart_table_state( + m_db, "app2", get_warm_start_state_name(WarmStartState::QUIESCENT)); + fetch_registration_info(); + overwrite_quiescence_hold_time_ms(100); + + set_start_status(RebootMethod::NSF, "time to reboot"); + + Progress progress = perform_freeze_quiescence_w_stop(false, 1000); + EXPECT_EQ(progress, RebootThread::Progress::PROCEED); +} + +TEST_F(RebootThreadTest, + TestPerformFreezeQuiescenceUninterestingStatesAtStart) { + EXPECT_CALL(m_critical_interface, is_system_critical()) + .Times(1) + .WillOnce(Return(false)); + + TestUtils::populate_registration_table(m_db, "docker2|app2", false, true, + false, false); + TestUtils::populate_restart_table_state( + m_db, "app2", get_warm_start_state_name(WarmStartState::RECONCILED)); + TestUtils::populate_restart_table_state( + m_db, "app2", get_warm_start_state_name(WarmStartState::INITIALIZED)); + TestUtils::populate_restart_table_state( + m_db, "app2", get_warm_start_state_name(WarmStartState::FROZEN)); + fetch_registration_info(); + overwrite_quiescence_timeout_ms(1000); + + set_start_status(RebootMethod::NSF, "time to reboot"); + + Progress progress = perform_freeze_quiescence_w_stop(false); + EXPECT_EQ(progress, RebootThread::Progress::EXIT_EARLY); + + force_inactive(); + RebootStatusResponse response = m_reboot_thread.GetResponse(); + EXPECT_THAT(response, + IsStatus(RebootStatus_Status::RebootStatus_Status_STATUS_FAILURE, + "timeout occurred during reboot stage freeze")); +} + +TEST_F(RebootThreadTest, TestPerformFreezeQuiescenceStartFailed) { + EXPECT_CALL(m_critical_interface, is_system_critical()) + .Times(1) + .WillOnce(Return(false)); + + TestUtils::populate_registration_table(m_db, "docker1|app1", false, true, + false, false); + TestUtils::populate_registration_table(m_db, "docker2|app2", false, true, + false, false); + TestUtils::populate_restart_table_state( + m_db, "app1", get_warm_start_state_name(WarmStartState::CHECKPOINTED)); + TestUtils::populate_restart_table_state( + m_db, "app2", get_warm_start_state_name(WarmStartState::FAILED)); + fetch_registration_info(); + overwrite_quiescence_timeout_ms(500); + + set_start_status(RebootMethod::NSF, "time to reboot"); + + Progress progress = perform_freeze_quiescence_w_stop(true); + EXPECT_EQ(progress, RebootThread::Progress::EXIT_EARLY); + + force_inactive(); + RebootStatusResponse response = m_reboot_thread.GetResponse(); + EXPECT_THAT( + response, + IsStatus(RebootStatus_Status::RebootStatus_Status_STATUS_FAILURE, + "check_stage: app: app2 reported FAILED during stage: freeze")); +} + +TEST_F(RebootThreadTest, TestPerformFreezeQuiescenceCompleted) { + overwrite_quiescence_hold_time_ms(100); + TestUtils::populate_registration_table(m_db, "docker1|app1", false, true, + false, false); + TestUtils::populate_registration_table(m_db, "docker2|app2", false, true, + false, false); + fetch_registration_info(); + + set_start_status(RebootMethod::NSF, "time to reboot"); + auto test_sequence = [&] { + // We want to skip past the initial completed check at start of + // freeze_quiescence_select and process below as subscriptions updates + std::this_thread::sleep_for(std::chrono::milliseconds(TENTH_SECOND_MS)); + TestUtils::populate_restart_table_state( + m_db, "app1", get_warm_start_state_name(WarmStartState::CHECKPOINTED)); + TestUtils::populate_restart_table_state( + m_db, "app2", get_warm_start_state_name(WarmStartState::CHECKPOINTED)); + }; + + std::thread test_thread = std::thread(test_sequence); + + Progress progress = perform_freeze_quiescence_w_stop(false); + EXPECT_EQ(progress, Progress::PROCEED); + test_thread.join(); +} + +TEST_F(RebootThreadTest, + TestPerformFreezeQuiescenceUninterestingStatesViaSubscription) { + TestUtils::populate_registration_table(m_db, "docker1|app1", false, true, + false, false); + fetch_registration_info(); + + set_start_status(RebootMethod::NSF, "time to reboot"); + + auto test_sequence = [&] { + std::this_thread::sleep_for(std::chrono::milliseconds(TENTH_SECOND_MS)); + TestUtils::populate_restart_table_state( + m_db, "app1", get_warm_start_state_name(WarmStartState::RECONCILED)); + TestUtils::populate_restart_table_state( + m_db, "app1", get_warm_start_state_name(WarmStartState::WSDISABLED)); + TestUtils::populate_restart_table_state( + m_db, "app1", get_warm_start_state_name(WarmStartState::WSUNKNOWN)); + }; + + std::thread test_thread = std::thread(test_sequence); + + Progress progress = perform_freeze_quiescence_w_stop(false, 300); + EXPECT_EQ(progress, Progress::EXIT_EARLY); + + force_inactive(); + RebootStatusResponse response = m_reboot_thread.GetResponse(); + EXPECT_THAT(response, + IsStatus(RebootStatus_Status::RebootStatus_Status_STATUS_FAILURE, + "timeout occurred during reboot stage freeze")); + test_thread.join(); +} + +TEST_F(RebootThreadTest, TestPerformFreezeQuiescenceFailed) { + TestUtils::populate_registration_table(m_db, "docker1|app1", false, true, + false, false); + TestUtils::populate_registration_table(m_db, "docker2|app2", false, true, + false, false); + fetch_registration_info(); + + set_start_status(RebootMethod::NSF, "time to reboot"); + + auto test_sequence = [&] { + std::this_thread::sleep_for(std::chrono::milliseconds(TENTH_SECOND_MS)); + TestUtils::populate_restart_table_state( + m_db, "app1", get_warm_start_state_name(WarmStartState::CHECKPOINTED)); + TestUtils::populate_restart_table_state( + m_db, "app2", get_warm_start_state_name(WarmStartState::FAILED)); + }; + + std::thread test_thread = std::thread(test_sequence); + + Progress progress = perform_freeze_quiescence_w_stop(false, 500); + EXPECT_EQ(progress, Progress::EXIT_EARLY); + + force_inactive(); + RebootStatusResponse response = m_reboot_thread.GetResponse(); + EXPECT_THAT(response, + IsStatus(RebootStatus_Status::RebootStatus_Status_STATUS_FAILURE, + "handle_state_event: app: app2 reported FAILED when " + "looking for state: freeze")); + test_thread.join(); +} + +TEST_F(RebootThreadTest, TestQuiescenceTimeoutDuringHoldTime) { + overwrite_quiescence_hold_time_ms(2000); + + TestUtils::populate_registration_table(m_db, "docker2|app2", false, true, + false, false); + fetch_registration_info(); + + set_start_status(RebootMethod::NSF, "time to reboot"); + + auto test_sequence = [&] { + std::this_thread::sleep_for(std::chrono::milliseconds(TENTH_SECOND_MS)); + TestUtils::populate_restart_table_state( + m_db, "app2", get_warm_start_state_name(WarmStartState::QUIESCENT)); + TestUtils::populate_restart_table_state( + m_db, "app2", get_warm_start_state_name(WarmStartState::INITIALIZED)); + TestUtils::populate_restart_table_state( + m_db, "app2", get_warm_start_state_name(WarmStartState::CHECKPOINTED)); + }; + + std::thread test_thread = std::thread(test_sequence); + + Progress progress = perform_freeze_quiescence_w_stop(false, 500); + EXPECT_EQ(progress, Progress::EXIT_EARLY); + + force_inactive(); + RebootStatusResponse response = m_reboot_thread.GetResponse(); + EXPECT_THAT(response, + IsStatus(RebootStatus_Status::RebootStatus_Status_STATUS_FAILURE, + "timeout occurred during reboot stage freeze")); + test_thread.join(); +} + +// Same as previous test with shorter hold_time. +TEST_F(RebootThreadTest, TestQuiescenceSuccessAfterHoldTime) { + overwrite_quiescence_hold_time_ms(100); + + TestUtils::populate_registration_table(m_db, "docker2|app2", false, true, + false, false); + fetch_registration_info(); + + set_start_status(RebootMethod::NSF, "time to reboot"); + + auto test_sequence = [&] { + std::this_thread::sleep_for(std::chrono::milliseconds(TENTH_SECOND_MS)); + TestUtils::populate_restart_table_state( + m_db, "app2", get_warm_start_state_name(WarmStartState::QUIESCENT)); + TestUtils::populate_restart_table_state( + m_db, "app2", get_warm_start_state_name(WarmStartState::INITIALIZED)); + TestUtils::populate_restart_table_state( + m_db, "app2", get_warm_start_state_name(WarmStartState::CHECKPOINTED)); + }; + + std::thread test_thread = std::thread(test_sequence); + + Progress progress = perform_freeze_quiescence_w_stop(false, 500); + EXPECT_EQ(progress, Progress::PROCEED); + test_thread.join(); +} + +TEST_F(RebootThreadTest, TestFailWhenExitQuiescence) { + overwrite_quiescence_hold_time_ms(200); + + TestUtils::populate_registration_table(m_db, "docker2|app2", false, true, + false, false); + fetch_registration_info(); + + set_start_status(RebootMethod::NSF, "time to reboot"); + + auto test_sequence = [&] { + std::this_thread::sleep_for(std::chrono::milliseconds(TENTH_SECOND_MS)); + // Enter quiescent state + TestUtils::populate_restart_table_state( + m_db, "app2", get_warm_start_state_name(WarmStartState::QUIESCENT)); + // Exit quiescent state during hold time. + TestUtils::populate_restart_table_state( + m_db, "app2", get_warm_start_state_name(WarmStartState::INITIALIZED)); + }; + + std::thread test_thread = std::thread(test_sequence); + + Progress progress = perform_freeze_quiescence_w_stop(false, 500); + EXPECT_EQ(progress, Progress::EXIT_EARLY); + + force_inactive(); + RebootStatusResponse response = m_reboot_thread.GetResponse(); + EXPECT_THAT(response, + IsStatus(RebootStatus_Status::RebootStatus_Status_STATUS_FAILURE, + "timeout occurred during reboot stage freeze")); + test_thread.join(); +} + +// +// Checkpoint +// + +TEST_F(RebootThreadTest, TestPerformCheckpointCriticalState) { + EXPECT_CALL(m_critical_interface, is_system_critical()) + .Times(1) + .WillOnce(Return(true)); + set_start_status(RebootMethod::NSF, "time to reboot"); + + swss::Select s; + s.addSelectable(&(return_m_stop_reference())); + Progress progress = perform_checkpoint(s); + EXPECT_EQ(progress, Progress::EXIT_EARLY); + + force_inactive(); + RebootStatusResponse response = m_reboot_thread.GetResponse(); + EXPECT_THAT(response, + IsStatus(RebootStatus_Status::RebootStatus_Status_STATUS_FAILURE, + "system entered critical state before checkpointing")); +} + +TEST_F(RebootThreadTest, TestPerformCheckpointTimeout) { + EXPECT_CALL(m_critical_interface, is_system_critical()) + .Times(1) + .WillOnce(Return(false)); + + TestUtils::populate_registration_table(m_db, "docker1|app1", false, false, + true, false); + TestUtils::populate_registration_table(m_db, "docker2|app2", false, false, + true, false); + fetch_registration_info(); + + overwrite_checkpoint_timeout(1); + + set_start_status(RebootMethod::NSF, "time to reboot"); + + swss::Select s; + s.addSelectable(&(return_m_stop_reference())); + + Progress progress = perform_checkpoint(s); + EXPECT_EQ(progress, Progress::EXIT_EARLY); + + force_inactive(); + RebootStatusResponse response = m_reboot_thread.GetResponse(); + EXPECT_THAT( + response, + IsStatus(RebootStatus_Status::RebootStatus_Status_STATUS_FAILURE, + HasSubstr("timeout occurred during reboot stage checkpoint"))); +} + +TEST_F(RebootThreadTest, TestPerformCheckpointStop) { + EXPECT_CALL(m_critical_interface, is_system_critical()) + .Times(1) + .WillOnce(Return(false)); + + TestUtils::populate_registration_table(m_db, "docker1|app1", false, false, + true, false); + TestUtils::populate_registration_table(m_db, "docker2|app2", false, false, + true, false); + fetch_registration_info(); + overwrite_quiescence_timeout_ms(1000); + + set_start_status(RebootMethod::NSF, "time to reboot"); + + swss::Select s; + s.addSelectable(&(return_m_stop_reference())); + m_reboot_thread.Stop(); + + Progress progress = perform_checkpoint(s); + EXPECT_EQ(progress, Progress::EXIT_EARLY); + + force_inactive(); + RebootStatusResponse response = m_reboot_thread.GetResponse(); + + // No error on request to stop, just log. + EXPECT_THAT( + response, + IsStatus(RebootStatus_Status::RebootStatus_Status_STATUS_UNKNOWN, "")); +} + +TEST_F(RebootThreadTest, TestPerformCheckpointStartCompleted) { + EXPECT_CALL(m_critical_interface, is_system_critical()) + .Times(1) + .WillOnce(Return(false)); + + TestUtils::populate_registration_table(m_db, "docker1|app1", false, false, + true, false); + TestUtils::populate_registration_table(m_db, "docker2|app2", false, false, + true, false); + TestUtils::populate_restart_table_state( + m_db, "app1", get_warm_start_state_name(WarmStartState::CHECKPOINTED)); + TestUtils::populate_restart_table_state( + m_db, "app2", get_warm_start_state_name(WarmStartState::CHECKPOINTED)); + fetch_registration_info(); + overwrite_quiescence_timeout_ms(1000); + + set_start_status(RebootMethod::NSF, "time to reboot"); + + swss::Select s; + s.addSelectable(&(return_m_stop_reference())); + m_reboot_thread.Stop(); + + Progress progress = perform_checkpoint(s); + EXPECT_EQ(progress, Progress::PROCEED); +} + +TEST_F(RebootThreadTest, TestPerformCheckpointStartFailed) { + EXPECT_CALL(m_critical_interface, is_system_critical()) + .Times(1) + .WillOnce(Return(false)); + + TestUtils::populate_registration_table(m_db, "docker1|app1", false, false, + true, false); + TestUtils::populate_registration_table(m_db, "docker2|app2", false, false, + true, false); + TestUtils::populate_restart_table_state( + m_db, "app1", get_warm_start_state_name(WarmStartState::CHECKPOINTED)); + TestUtils::populate_restart_table_state( + m_db, "app2", get_warm_start_state_name(WarmStartState::FAILED)); + fetch_registration_info(); + overwrite_quiescence_timeout_ms(1000); + + set_start_status(RebootMethod::NSF, "time to reboot"); + + swss::Select s; + s.addSelectable(&(return_m_stop_reference())); + m_reboot_thread.Stop(); + + Progress progress = perform_checkpoint(s); + EXPECT_EQ(progress, Progress::EXIT_EARLY); + + force_inactive(); + RebootStatusResponse response = m_reboot_thread.GetResponse(); + EXPECT_THAT(response, + IsStatus(RebootStatus_Status::RebootStatus_Status_STATUS_FAILURE, + HasSubstr("check_stage: app: app2 reported FAILED " + "during stage: checkpoint"))); +} + +TEST_F(RebootThreadTest, TestPerformCheckpointCompleted) { + TestUtils::populate_registration_table(m_db, "docker1|app1", false, false, + true, false); + TestUtils::populate_registration_table(m_db, "docker2|app2", false, false, + true, false); + fetch_registration_info(); + + swss::Select s; + s.addSelectable(&(return_m_stop_reference())); + + swss::SelectableTimer l_timer(timespec{.tv_sec = 1, .tv_nsec = 0}); + s.addSelectable(&l_timer); + + swss::SubscriberStateTable sub(&m_db, STATE_WARM_RESTART_TABLE_NAME); + s.addSelectable(&sub); + + set_start_status(RebootMethod::NSF, "time to reboot"); + + TestUtils::populate_restart_table_state( + m_db, "app1", get_warm_start_state_name(WarmStartState::CHECKPOINTED)); + TestUtils::populate_restart_table_state( + m_db, "app2", get_warm_start_state_name(WarmStartState::CHECKPOINTED)); + + l_timer.start(); + + Progress progress = checkpoint_stage_two(s, l_timer, sub); + EXPECT_EQ(progress, Progress::PROCEED); +} + +TEST_F(RebootThreadTest, TestPerformCheckpointUninterestingStatesIgnored) { + TestUtils::populate_registration_table(m_db, "docker1|app1", false, false, + true, false); + fetch_registration_info(); + + swss::Select s; + s.addSelectable(&(return_m_stop_reference())); + + swss::SelectableTimer l_timer(timespec{.tv_sec = 1, .tv_nsec = 0}); + s.addSelectable(&l_timer); + + swss::SubscriberStateTable sub(&m_db, STATE_WARM_RESTART_TABLE_NAME); + s.addSelectable(&sub); + + set_start_status(RebootMethod::NSF, "time to reboot"); + + // Confirm a non checkpoint state isn't treated as CHECKPOINTED + TestUtils::populate_restart_table_state( + m_db, "app1", get_warm_start_state_name(WarmStartState::RECONCILED)); + TestUtils::populate_restart_table_state( + m_db, "app2", get_warm_start_state_name(WarmStartState::INITIALIZED)); + TestUtils::populate_restart_table_state( + m_db, "app2", get_warm_start_state_name(WarmStartState::FROZEN)); + + l_timer.start(); + + Progress progress = checkpoint_stage_two(s, l_timer, sub); + EXPECT_EQ(progress, Progress::EXIT_EARLY); + + force_inactive(); + RebootStatusResponse response = m_reboot_thread.GetResponse(); + EXPECT_THAT( + response, + IsStatus(RebootStatus_Status::RebootStatus_Status_STATUS_FAILURE, + HasSubstr("timeout occurred during reboot stage checkpoint"))); +} + +TEST_F(RebootThreadTest, TestPerformCheckpointFailed) { + TestUtils::populate_registration_table(m_db, "docker1|app1", false, false, + true, false); + TestUtils::populate_registration_table(m_db, "docker2|app2", false, false, + true, false); + fetch_registration_info(); + + swss::Select s; + s.addSelectable(&(return_m_stop_reference())); + + swss::SelectableTimer l_timer(timespec{.tv_sec = 1, .tv_nsec = 0}); + s.addSelectable(&l_timer); + + swss::SubscriberStateTable sub(&m_db, STATE_WARM_RESTART_TABLE_NAME); + s.addSelectable(&sub); + + set_start_status(RebootMethod::NSF, "time to reboot"); + + TestUtils::populate_restart_table_state( + m_db, "app1", get_warm_start_state_name(WarmStartState::CHECKPOINTED)); + TestUtils::populate_restart_table_state( + m_db, "app2", get_warm_start_state_name(WarmStartState::FAILED)); + + l_timer.start(); + + Progress progress = checkpoint_stage_two(s, l_timer, sub); + + EXPECT_EQ(progress, Progress::EXIT_EARLY); + force_inactive(); + RebootStatusResponse response = m_reboot_thread.GetResponse(); + EXPECT_THAT( + response, + IsStatus(RebootStatus_Status::RebootStatus_Status_STATUS_FAILURE, + "handle_state_event: app: app2 reported FAILED when looking for " + "state: checkpoint")); +} + +TEST_F(RebootThreadTest, TestPerformCheckpointUnexpectedStatesViaSubscription) { + TestUtils::populate_registration_table(m_db, "docker1|app1", false, false, + true, false); + fetch_registration_info(); + + swss::Select s; + s.addSelectable(&(return_m_stop_reference())); + + swss::SelectableTimer l_timer(timespec{.tv_sec = 1, .tv_nsec = 0}); + s.addSelectable(&l_timer); + + swss::SubscriberStateTable sub(&m_db, STATE_WARM_RESTART_TABLE_NAME); + s.addSelectable(&sub); + + set_start_status(RebootMethod::NSF, "time to reboot"); + + TestUtils::populate_restart_table_state( + m_db, "app1", get_warm_start_state_name(WarmStartState::INITIALIZED)); + TestUtils::populate_restart_table_state( + m_db, "app1", get_warm_start_state_name(WarmStartState::RESTORED)); + TestUtils::populate_restart_table_state( + m_db, "app1", get_warm_start_state_name(WarmStartState::REPLAYED)); + + l_timer.start(); + + Progress progress = checkpoint_stage_two(s, l_timer, sub); + + EXPECT_EQ(progress, Progress::EXIT_EARLY); + force_inactive(); + RebootStatusResponse response = m_reboot_thread.GetResponse(); + EXPECT_THAT( + response, + IsStatus(RebootStatus_Status::RebootStatus_Status_STATUS_FAILURE, + HasSubstr("timeout occurred during reboot stage checkpoint"))); +} + +// +// Stop On Freeze Tests +// + +TEST_F(RebootThreadTest, TestCheckContainerStopDbusFail) { + DbusInterface::DbusResponse dbus_response{ + DbusInterface::DbusStatus::DBUS_FAIL, "dbus reboot failed"}; + EXPECT_CALL(m_dbus_interface, StopContainerStatus(_)) + .Times(1) + .WillOnce(Return(dbus_response)); + + RebootThread::Status status = check_container_stop("requestA"); + EXPECT_EQ(status, RebootThread::Status::FAILURE); +} + +TEST_F(RebootThreadTest, TestCheckContainerStopJsonParseFailure) { + DbusInterface::DbusResponse dbus_response{ + DbusInterface::DbusStatus::DBUS_SUCCESS, "dbus reboot failed"}; + EXPECT_CALL(m_dbus_interface, StopContainerStatus(_)) + .Times(1) + .WillOnce(Return(dbus_response)); + + RebootThread::Status status = check_container_stop("requestA"); + EXPECT_EQ(status, RebootThread::Status::FAILURE); +} + +TEST_F(RebootThreadTest, TestCheckContainerStopSuccess) { + StopContainersResponse response; + response.set_status(ShutdownStatus::DONE); + + std::string json_response; + gpu::MessageToJsonString(response, &json_response); + + DbusInterface::DbusResponse dbus_response{ + DbusInterface::DbusStatus::DBUS_SUCCESS, json_response.c_str()}; + EXPECT_CALL(m_dbus_interface, StopContainerStatus(_)) + .Times(1) + .WillOnce(Return(dbus_response)); + + RebootThread::Status status = check_container_stop("requestA"); + EXPECT_EQ(status, RebootThread::Status::SUCCESS); +} + +TEST_F(RebootThreadTest, TestWaitForContainerStopMStopSignal) { + TestUtils::populate_registration_table(m_db, "docker1|app1", true, false, + false, false); + fetch_registration_info(); + set_start_status(RebootMethod::NSF, "time to reboot"); + + Progress progress = wait_for_container_stop(300); + + EXPECT_EQ(progress, Progress::EXIT_EARLY); + force_inactive(); + RebootStatusResponse response = m_reboot_thread.GetResponse(); + + // No error on request to stop, just log. + EXPECT_THAT( + response, + IsStatus(RebootStatus_Status::RebootStatus_Status_STATUS_UNKNOWN, "")); +} + +TEST_F(RebootThreadTest, TestWaitForContainerStopDbusReturnsStopped) { + StopContainersResponse response; + response.set_status(ShutdownStatus::DONE); + + std::string json_response; + gpu::MessageToJsonString(response, &json_response); + + DbusInterface::DbusResponse dbus_response{ + DbusInterface::DbusStatus::DBUS_SUCCESS, json_response.c_str()}; + EXPECT_CALL(m_dbus_interface, StopContainerStatus(_)) + .Times(1) + .WillOnce(Return(dbus_response)); + + TestUtils::populate_registration_table(m_db, "docker1|app1", true, false, + false, false); + fetch_registration_info(); + set_start_status(RebootMethod::NSF, "time to reboot"); + + Progress progress = wait_for_container_stop(300); + + EXPECT_EQ(progress, Progress::PROCEED); +} + +} // namespace rebootbackend diff --git a/src/sonic-framework/tests/rebootbe_test.cpp b/src/sonic-framework/tests/rebootbe_test.cpp new file mode 100644 index 000000000000..6effce3029be --- /dev/null +++ b/src/sonic-framework/tests/rebootbe_test.cpp @@ -0,0 +1,1294 @@ +#include "rebootbe.h" + +#include +#include +#include +#include + +#include +#include +#include + +#include "container_stop.pb.h" +#include "mock_reboot_interfaces.h" +#include "reboot_common.h" +#include "select.h" +#include "stateverification.h" +#include "status_code_util.h" +#include "system/system.pb.h" +#include "test_utils_common.h" +#include "timestamp.h" + +namespace rebootbackend { + +#define ONE_SECOND (1) +#define TWO_SECONDS (2) +#define TENTH_SECOND_MS (100) +#define HALF_SECOND_MS (500) +#define ONE_SECOND_MS (1000) +#define FIFTEEN_HUNDRED_MS (1500) +#define TWO_SECONDS_MS (2000) + +namespace gpu = ::google::protobuf::util; +using namespace gnoi::system; +using WarmStartState = ::swss::WarmStart::WarmStartState; +using WarmBootStage = ::swss::WarmStart::WarmBootStage; + +using ::testing::_; +using ::testing::AllOf; +using ::testing::AtLeast; +using ::testing::ExplainMatchResult; +using ::testing::HasSubstr; +using ::testing::InSequence; +using ::testing::Invoke; +using ::testing::NiceMock; +using ::testing::Return; +using ::testing::StrEq; +using ::testing::StrictMock; + +MATCHER_P2(IsStatus, status, message, "") { + return (arg.status().status() == status && + ExplainMatchResult(message, arg.status().message(), result_listener)); +} + +MATCHER_P3(ActiveCountMethod, active, count, method, "") { + return (arg.active() == active && arg.count() == (uint32_t)count && + arg.method() == method); +} + +class RebootBETestWithoutStop : public ::testing::Test { + protected: + RebootBETestWithoutStop() + : m_dbus_interface(), + m_critical_interface(), + m_db("STATE_DB", 0), + m_config_db("CONFIG_DB", 0), + m_rebootbeRequestChannel(&m_db, REBOOT_REQUEST_NOTIFICATION_CHANNEL), + m_rebootbeReponseChannel(&m_db, REBOOT_RESPONSE_NOTIFICATION_CHANNEL), + m_rebootbe(m_dbus_interface, m_critical_interface, m_telemetry) { + sigterm_requested = false; + TestUtils::clear_tables(m_db); + + auto mock_init_thread = std::make_unique>(); + m_init_thread = mock_init_thread.get(); + m_rebootbe.m_init_thread = std::move(mock_init_thread); + + m_s.addSelectable(&m_rebootbeReponseChannel); + + // Make the tests log to stdout, instead of syslog. + swss::Table logging_table(&m_config_db, CFG_LOGGER_TABLE_NAME); + logging_table.hset("rebootbackend", swss::DAEMON_LOGOUTPUT, "STDOUT"); + swss::Logger::restartLogger(); + } + virtual ~RebootBETestWithoutStop() = default; + + void force_warm_start_state(bool enabled) { + swss::Table enable_table(&m_db, STATE_WARM_RESTART_ENABLE_TABLE_NAME); + enable_table.hset("system", "enable", enabled ? "true" : "false"); + enable_table.hset("sonic-framework", "enable", enabled ? "true" : "false"); + + swss::Table restart_table(&m_db, STATE_WARM_RESTART_TABLE_NAME); + restart_table.hset("rebootbackend", "restore_count", enabled ? "0" : ""); + } + + gnoi::system::RebootStatusResponse default_not_started_status() { + InitThreadStatus status; + return status.get_response(); + } + + gnoi::system::RebootStatusResponse default_done_status() { + InitThreadStatus status; + // We can't edit the status without it being active. + status.set_start_status(); + status.set_success(); + status.set_inactive(); + return status.get_response(); + } + + gnoi::system::RebootStatusResponse default_running_status() { + InitThreadStatus status; + status.set_start_status(); + status.set_detailed_thread_status( + InitThreadStatus::ThreadStatus::WAITING_FOR_RECONCILIATION); + return status.get_response(); + } + + gnoi::system::RebootStatusResponse default_error_status() { + InitThreadStatus status; + status.set_start_status(); + status.set_error(InitThreadStatus::ErrorCondition::RECONCILIATION_FAILED, + "Fake reconciliation failed"); + return status.get_response(); + } + + void start_rebootbe() { + m_rebootbe_thread = + std::make_unique(&RebootBE::Start, &m_rebootbe); + } + + void set_mock_defaults() { + ON_CALL(m_dbus_interface, Reboot(_)) + .WillByDefault(Return(DbusInterface::DbusResponse{ + DbusInterface::DbusStatus::DBUS_SUCCESS, ""})); + } + + void overwrite_reboot_timeout(uint32_t timeout_seconds) { + m_rebootbe.m_reboot_thread.m_reboot_timeout = timeout_seconds; + } + + void overwrite_state_verification_timeout(uint32_t timeout_seconds) { + m_rebootbe.m_reboot_thread.m_state_verification_timeout = timeout_seconds; + } + + void overwrite_quiescent_timeout_ms(uint64_t timeout_ms) { + m_rebootbe.m_reboot_thread.m_quiescence_timeout_ms = timeout_ms; + } + + void overwrite_quiescent_hold_time_ms(uint64_t timeout_ms) { + m_rebootbe.m_reboot_thread.m_quiescence_hold_time_ms = timeout_ms; + } + + void overwrite_checkpoint_timeout(uint32_t timeout_seconds) { + m_rebootbe.m_reboot_thread.m_checkpoint_timeout = timeout_seconds; + } + + void send_stop_reboot_thread() { m_rebootbe.m_reboot_thread.Stop(); } + + void SendRebootRequest(const std::string &op, const std::string &data, + const std::string &field, const std::string &value) { + std::vector values; + values.push_back(swss::FieldValueTuple{field, value}); + + m_rebootbeRequestChannel.send(op, data, values); + } + + void SendRebootViaProto(RebootRequest &request) { + std::string json_string; + gpu::MessageToJsonString(request, &json_string); + + SendRebootRequest("Reboot", "StatusCode", DATA_TUPLE_KEY, json_string); + } + + void SendRebootStatusRequest(void) { + SendRebootRequest("RebootStatus", "StatusCode", DATA_TUPLE_KEY, + "json status request"); + } + + void start_reboot_via_rpc( + RebootRequest &request, + swss::StatusCode expected_result = swss::StatusCode::SWSS_RC_SUCCESS) { + SendRebootViaProto(request); + while (true) { + int ret; + swss::Selectable *sel; + ret = m_s.select(&sel, SELECT_TIMEOUT_MS); + if (ret != swss::Select::OBJECT) continue; + if (sel != &m_rebootbeReponseChannel) continue; + break; + } + std::string op, data; + std::vector ret_values; + m_rebootbeReponseChannel.pop(op, data, ret_values); + + EXPECT_THAT(op, StrEq("Reboot")); + EXPECT_THAT(data, StrEq(swss::statusCodeToStr(expected_result))); + } + + gnoi::system::RebootStatusResponse do_reboot_status_rpc() { + SendRebootStatusRequest(); + while (true) { + int ret; + swss::Selectable *sel; + ret = m_s.select(&sel, SELECT_TIMEOUT_MS); + if (ret != swss::Select::OBJECT) continue; + if (sel != &m_rebootbeReponseChannel) continue; + break; + } + std::string op, data; + std::vector ret_values; + m_rebootbeReponseChannel.pop(op, data, ret_values); + + EXPECT_THAT(op, StrEq("RebootStatus")); + EXPECT_EQ(data, swss::statusCodeToStr(swss::StatusCode::SWSS_RC_SUCCESS)); + + std::string json_response; + for (auto &fv : ret_values) { + if (DATA_TUPLE_KEY == fvField(fv)) { + json_response = fvValue(fv); + } + } + gnoi::system::RebootStatusResponse response; + gpu::JsonStringToMessage(json_response, &response); + return response; + } + + void GetNotificationResponse(swss::NotificationConsumer &consumer, + std::string &op, std::string &data, + std::vector &values) { + swss::Select s; + s.addSelectable(&consumer); + swss::Selectable *sel; + s.select(&sel, SELECT_TIMEOUT_MS); + + consumer.pop(op, data, values); + } + + NotificationResponse handle_reboot_request(std::string &json_request) { + return m_rebootbe.handle_reboot_request(json_request); + } + + void set_all_telemetry_expects(bool freeze_status = true, + bool checkpoint_status = true) { + set_telemetry_overall_expects(freeze_status && checkpoint_status); + set_telemetry_stage_expects(WarmBootStage::STAGE_FREEZE, freeze_status); + if (freeze_status) { + set_telemetry_stage_expects(WarmBootStage::STAGE_CHECKPOINT, + checkpoint_status); + } + } + + void set_telemetry_overall_expects(bool success) { + EXPECT_CALL(m_telemetry, record_overall_start()).Times(1); + if (!success) { + EXPECT_CALL(m_telemetry, record_overall_end(success)).Times(1); + } + } + + void set_telemetry_stage_expects(WarmBootStage nsf_stage, bool success) { + EXPECT_CALL(m_telemetry, record_stage_start(nsf_stage)).Times(1); + EXPECT_CALL(m_telemetry, record_stage_end(nsf_stage, success)).Times(1); + } + + swss::SelectableEvent &get_stack_unfrozen_select() { + return m_rebootbe.m_stack_unfrozen; + } + + swss::SelectableEvent &get_init_done_select() { + return m_rebootbe.m_init_thread_done; + } + + // Mock interfaces. + NiceMock m_dbus_interface; + NiceMock m_critical_interface; + StrictMock m_telemetry; + + // DB connectors + swss::DBConnector m_db; + swss::DBConnector m_config_db; + + // Reboot thread signaling. + swss::NotificationProducer m_rebootbeRequestChannel; + swss::Select m_s; + swss::NotificationConsumer m_rebootbeReponseChannel; + + // Module under test. + std::unique_ptr m_rebootbe_thread; + RebootBE m_rebootbe; + + // Not owned by test. + StrictMock *m_init_thread; +}; + +class RebootBETest : public RebootBETestWithoutStop { + protected: + ~RebootBETest() { + m_rebootbe.Stop(); + m_rebootbe_thread->join(); + } +}; + +// Init sequence testing. +TEST_F(RebootBETest, ColdbootInitWorks) { + force_warm_start_state(false); + + EXPECT_CALL(*m_init_thread, GetResponse()) + .Times(2) + .WillRepeatedly(Return(default_not_started_status())); + + start_rebootbe(); + std::this_thread::sleep_for(std::chrono::milliseconds(100)); + EXPECT_EQ(m_rebootbe.GetCurrentStatus(), RebootBE::NsfManagerStatus::IDLE); + + gnoi::system::RebootStatusResponse response = do_reboot_status_rpc(); + EXPECT_THAT(response, ActiveCountMethod(false, 0, RebootMethod::COLD)); + EXPECT_THAT( + response, + IsStatus(RebootStatus_Status::RebootStatus_Status_STATUS_SUCCESS, "")); +} + +TEST_F(RebootBETest, WarmbootInitWorks) { + force_warm_start_state(true); + + { + InSequence seq; + EXPECT_CALL(*m_init_thread, Start()) + .WillOnce(Return(swss::StatusCode::SWSS_RC_SUCCESS)); + + // Status request during warmboot init, then during Join sequence. + EXPECT_CALL(*m_init_thread, GetResponse()) + .Times(2) + .WillRepeatedly(Return(default_running_status())) + .RetiresOnSaturation(); + + // Normal Join sequence when reaching COMPLETED. + EXPECT_CALL(*m_init_thread, Join()).WillOnce(Return(true)); + + // Status request after warmboot init, then cleanup sequence. + EXPECT_CALL(*m_init_thread, GetResponse()) + .Times(2) + .WillRepeatedly(Return(default_done_status())); + } + + start_rebootbe(); + std::this_thread::sleep_for(std::chrono::milliseconds(100)); + EXPECT_EQ(m_rebootbe.GetCurrentStatus(), + RebootBE::NsfManagerStatus::NSF_INIT_WAIT); + + // Check status during init. + EXPECT_THAT( + do_reboot_status_rpc(), + AllOf(ActiveCountMethod(true, 0, RebootMethod::NSF), + IsStatus(RebootStatus_Status::RebootStatus_Status_STATUS_UNKNOWN, + ""))); + + get_stack_unfrozen_select().notify(); + std::this_thread::sleep_for(std::chrono::milliseconds(100)); + EXPECT_EQ(m_rebootbe.GetCurrentStatus(), + RebootBE::NsfManagerStatus::NSF_INIT_WAIT); + + get_init_done_select().notify(); + std::this_thread::sleep_for(std::chrono::milliseconds(100)); + EXPECT_EQ(m_rebootbe.GetCurrentStatus(), RebootBE::NsfManagerStatus::IDLE); + + // Check that NSF status is sticky after init, before a new coldboot starts. + EXPECT_THAT( + do_reboot_status_rpc(), + AllOf(ActiveCountMethod(false, 0, RebootMethod::NSF), + IsStatus(RebootStatus_Status::RebootStatus_Status_STATUS_SUCCESS, + ""))); +} + +TEST_F(RebootBETest, InitThreadFailsToStart) { + force_warm_start_state(true); + + { + InSequence seq; + EXPECT_CALL(*m_init_thread, Start()) + .WillOnce(Return(swss::StatusCode::SWSS_RC_INTERNAL)); + + // Cleanup sequence. + EXPECT_CALL(*m_init_thread, GetResponse()) + .WillOnce(Return(default_not_started_status())); + } + + start_rebootbe(); + std::this_thread::sleep_for(std::chrono::milliseconds(100)); + EXPECT_EQ(m_rebootbe.GetCurrentStatus(), RebootBE::NsfManagerStatus::IDLE); +} + +TEST_F(RebootBETest, WarmbootInProgressBlocksNewWarmboot) { + force_warm_start_state(true); + + // Start InitThread, but do not run to completion. + { + InSequence seq; + EXPECT_CALL(*m_init_thread, Start()) + .WillOnce(Return(swss::StatusCode::SWSS_RC_SUCCESS)); + + // Cleanup sequence. + EXPECT_CALL(*m_init_thread, GetResponse()) + .WillOnce(Return(default_done_status())); + } + + start_rebootbe(); + std::this_thread::sleep_for(std::chrono::milliseconds(100)); + EXPECT_EQ(m_rebootbe.GetCurrentStatus(), + RebootBE::NsfManagerStatus::NSF_INIT_WAIT); + + // Send a warmboot request, confirm it fails. + RebootRequest request; + request.set_method(RebootMethod::NSF); + start_reboot_via_rpc(request, swss::StatusCode::SWSS_RC_IN_USE); + + std::this_thread::sleep_for(std::chrono::milliseconds(TENTH_SECOND_MS)); + EXPECT_EQ(m_rebootbe.GetCurrentStatus(), + RebootBE::NsfManagerStatus::NSF_INIT_WAIT); +} + +TEST_F(RebootBETest, ColdbootWhileWarmbootInProgress) { + force_warm_start_state(true); + set_mock_defaults(); + + // Start InitThread, but do not run to completion. + { + InSequence seq; + EXPECT_CALL(*m_init_thread, Start()) + .WillOnce(Return(swss::StatusCode::SWSS_RC_SUCCESS)); + + // Cleanup sequence. + EXPECT_CALL(*m_init_thread, GetResponse()) + .WillOnce(Return(default_done_status())); + } + + start_rebootbe(); + std::this_thread::sleep_for(std::chrono::milliseconds(100)); + EXPECT_EQ(m_rebootbe.GetCurrentStatus(), + RebootBE::NsfManagerStatus::NSF_INIT_WAIT); + + // Send a coldboot request, confirm it starts. + RebootRequest request; + request.set_method(RebootMethod::COLD); + start_reboot_via_rpc(request); + + std::this_thread::sleep_for(std::chrono::milliseconds(TENTH_SECOND_MS)); + EXPECT_EQ(m_rebootbe.GetCurrentStatus(), + RebootBE::NsfManagerStatus::COLD_REBOOT_IN_PROGRESS); + + // Cleanup without going through the whole reboot. + send_stop_reboot_thread(); +} + +TEST_F(RebootBETestWithoutStop, WarmbootStopDuringInit) { + force_warm_start_state(true); + + { + InSequence seq; + EXPECT_CALL(*m_init_thread, Start()) + .WillOnce(Return(swss::StatusCode::SWSS_RC_SUCCESS)); + + // Stop triggers the cleanup sequnce without either of the SelectableEvent's + // being triggered. + EXPECT_CALL(*m_init_thread, GetResponse()) + .WillOnce(Return(default_running_status())); + EXPECT_CALL(*m_init_thread, Stop()).Times(1); + EXPECT_CALL(*m_init_thread, Join()).WillOnce(Return(true)); + } + + start_rebootbe(); + std::this_thread::sleep_for(std::chrono::milliseconds(100)); + EXPECT_EQ(m_rebootbe.GetCurrentStatus(), + RebootBE::NsfManagerStatus::NSF_INIT_WAIT); + + // Manually join and verify state. + m_rebootbe.Stop(); + m_rebootbe_thread->join(); + EXPECT_EQ(m_rebootbe.GetCurrentStatus(), + RebootBE::NsfManagerStatus::NSF_INIT_WAIT); +} + +TEST_F(RebootBETestWithoutStop, WarmbootErrorBeforeUnfreeze) { + force_warm_start_state(true); + + { + InSequence seq; + // Immediately report an error from the InitThread after starting. + auto done_lambda = [&] { + get_init_done_select().notify(); + return swss::StatusCode::SWSS_RC_SUCCESS; + }; + EXPECT_CALL(*m_init_thread, Start()).WillOnce(Invoke(done_lambda)); + + // Normal Join sequence when reaching COMPLETED. + EXPECT_CALL(*m_init_thread, GetResponse()) + .WillOnce(Return(default_error_status())) + .RetiresOnSaturation(); + EXPECT_CALL(*m_init_thread, Join()).WillOnce(Return(false)); + + // Cleanup sequence. + EXPECT_CALL(*m_init_thread, GetResponse()) + .WillOnce(Return(default_done_status())); + } + + start_rebootbe(); + + // Immediately handle InitThread error and become IDLE. + std::this_thread::sleep_for(std::chrono::milliseconds(100)); + EXPECT_EQ(m_rebootbe.GetCurrentStatus(), RebootBE::NsfManagerStatus::IDLE); + + // Manually join and verify state. + m_rebootbe.Stop(); + m_rebootbe_thread->join(); + EXPECT_EQ(m_rebootbe.GetCurrentStatus(), RebootBE::NsfManagerStatus::IDLE); +} + +TEST_F(RebootBETestWithoutStop, WarmbootErrorBeforeComplete) { + force_warm_start_state(true); + + { + InSequence seq; + EXPECT_CALL(*m_init_thread, Start()) + .WillOnce(Return(swss::StatusCode::SWSS_RC_SUCCESS)); + + // Normal Join sequence when reaching COMPLETED. + EXPECT_CALL(*m_init_thread, GetResponse()) + .WillOnce(Return(default_error_status())) + .RetiresOnSaturation(); + EXPECT_CALL(*m_init_thread, Join()).WillOnce(Return(false)); + + // Cleanup sequnce. + EXPECT_CALL(*m_init_thread, GetResponse()) + .WillOnce(Return(default_error_status())); + EXPECT_CALL(*m_init_thread, Stop()).Times(1); + EXPECT_CALL(*m_init_thread, Join()).WillOnce(Return(false)); + } + + start_rebootbe(); + std::this_thread::sleep_for(std::chrono::milliseconds(100)); + EXPECT_EQ(m_rebootbe.GetCurrentStatus(), + RebootBE::NsfManagerStatus::NSF_INIT_WAIT); + + // Advance to waiting for unfreeze. + get_stack_unfrozen_select().notify(); + std::this_thread::sleep_for(std::chrono::milliseconds(100)); + EXPECT_EQ(m_rebootbe.GetCurrentStatus(), + RebootBE::NsfManagerStatus::NSF_INIT_WAIT); + + // Triggered as part of InitThread error reporting. + get_init_done_select().notify(); + std::this_thread::sleep_for(std::chrono::milliseconds(100)); + EXPECT_EQ(m_rebootbe.GetCurrentStatus(), RebootBE::NsfManagerStatus::IDLE); + + // Manually join and verify state. + m_rebootbe.Stop(); + m_rebootbe_thread->join(); + EXPECT_EQ(m_rebootbe.GetCurrentStatus(), RebootBE::NsfManagerStatus::IDLE); +} + +// Test fixture to skip through the startup sequence into the main loop. +// Param indicates if RebootBE should be initialized into a state where the +// system came up in warmboot. +class RebootBEAutoStartTest : public RebootBETest, + public ::testing::WithParamInterface { + protected: + RebootBEAutoStartTest() { + force_warm_start_state(GetParam()); + + if (GetParam()) { + EXPECT_CALL(*m_init_thread, Start()) + .WillOnce(Return(swss::StatusCode::SWSS_RC_SUCCESS)); + EXPECT_CALL(*m_init_thread, Join()).WillOnce(Return(true)); + EXPECT_CALL(*m_init_thread, GetResponse()) + .WillOnce(Return(default_running_status())) + .WillRepeatedly(Return(default_done_status())); + } else { + EXPECT_CALL(*m_init_thread, GetResponse()) + .WillRepeatedly(Return(default_not_started_status())); + } + + start_rebootbe(); + + if (GetParam()) { + get_stack_unfrozen_select().notify(); + std::this_thread::sleep_for(std::chrono::milliseconds(50)); + get_init_done_select().notify(); + } + + std::this_thread::sleep_for(std::chrono::milliseconds(50)); + EXPECT_EQ(m_rebootbe.GetCurrentStatus(), RebootBE::NsfManagerStatus::IDLE); + } +}; + +// Normal operation testing. +TEST_P(RebootBEAutoStartTest, NonExistentMessage) { + swss::NotificationConsumer consumer(&m_db, + REBOOT_RESPONSE_NOTIFICATION_CHANNEL); + + // No "MESSAGE" in field/values + SendRebootRequest("Reboot", "StatusCode", "field1", "field1_value"); + EXPECT_EQ(m_rebootbe.GetCurrentStatus(), RebootBE::NsfManagerStatus::IDLE); + + std::string op, data; + std::vector ret_values; + GetNotificationResponse(consumer, op, data, ret_values); + + EXPECT_THAT(op, StrEq("Reboot")); + EXPECT_THAT( + data, + StrEq(swss::statusCodeToStr(swss::StatusCode::SWSS_RC_INVALID_PARAM))); +} + +TEST_P(RebootBEAutoStartTest, TestCancelReboot) { + swss::NotificationConsumer consumer(&m_db, + REBOOT_RESPONSE_NOTIFICATION_CHANNEL); + + SendRebootRequest("CancelReboot", "StatusCode", DATA_TUPLE_KEY, + "json cancelreboot request"); + EXPECT_EQ(m_rebootbe.GetCurrentStatus(), RebootBE::NsfManagerStatus::IDLE); + + std::string op, data; + std::vector ret_values; + GetNotificationResponse(consumer, op, data, ret_values); + + EXPECT_THAT(op, StrEq("CancelReboot")); + EXPECT_THAT( + data, + StrEq(swss::statusCodeToStr(swss::StatusCode::SWSS_RC_UNIMPLEMENTED))); +} + +TEST_P(RebootBEAutoStartTest, TestUnrecognizedOP) { + swss::NotificationConsumer consumer(&m_db, + REBOOT_RESPONSE_NOTIFICATION_CHANNEL); + + SendRebootRequest("NonOp", "StatusCode", DATA_TUPLE_KEY, "invalid op code"); + EXPECT_EQ(m_rebootbe.GetCurrentStatus(), RebootBE::NsfManagerStatus::IDLE); + + std::string op, data; + std::vector ret_values; + GetNotificationResponse(consumer, op, data, ret_values); + + EXPECT_THAT(op, StrEq("NonOp")); + EXPECT_THAT( + data, + StrEq(swss::statusCodeToStr(swss::StatusCode::SWSS_RC_INVALID_PARAM))); +} + +TEST_P(RebootBEAutoStartTest, TestColdRebootDbusToCompletion) { + DbusInterface::DbusResponse dbus_response{ + DbusInterface::DbusStatus::DBUS_SUCCESS, ""}; + EXPECT_CALL(m_dbus_interface, Reboot(_)) + .Times(3) + .WillRepeatedly(Return(dbus_response)); + + EXPECT_CALL(m_critical_interface, + report_critical_state("platform failed to reboot")) + .Times(3); + overwrite_reboot_timeout(1); + + RebootRequest request; + request.set_method(RebootMethod::COLD); + start_reboot_via_rpc(request); + + std::this_thread::sleep_for(std::chrono::milliseconds(TENTH_SECOND_MS)); + EXPECT_EQ(m_rebootbe.GetCurrentStatus(), + RebootBE::NsfManagerStatus::COLD_REBOOT_IN_PROGRESS); + sleep(TWO_SECONDS); + + EXPECT_EQ(m_rebootbe.GetCurrentStatus(), RebootBE::NsfManagerStatus::IDLE); + gnoi::system::RebootStatusResponse response = do_reboot_status_rpc(); + EXPECT_THAT(response, ActiveCountMethod(false, 1, RebootMethod::COLD)); + EXPECT_THAT(response, + IsStatus(RebootStatus_Status::RebootStatus_Status_STATUS_FAILURE, + "platform failed to reboot")); + + start_reboot_via_rpc(request); + sleep(TWO_SECONDS); + + start_reboot_via_rpc(request); + sleep(TWO_SECONDS); + + response = do_reboot_status_rpc(); + // Verifiy count is 3 after three reboot attempts. + EXPECT_THAT(response, ActiveCountMethod(false, 3, RebootMethod::COLD)); + EXPECT_THAT(response, + IsStatus(RebootStatus_Status::RebootStatus_Status_STATUS_FAILURE, + "platform failed to reboot")); +} + +TEST_P(RebootBEAutoStartTest, TestColdBootSigterm) { + sigterm_requested = true; + set_mock_defaults(); + overwrite_reboot_timeout(1); + + RebootRequest request; + request.set_method(RebootMethod::COLD); + start_reboot_via_rpc(request); + + sleep(ONE_SECOND); + + EXPECT_EQ(m_rebootbe.GetCurrentStatus(), RebootBE::NsfManagerStatus::IDLE); + gnoi::system::RebootStatusResponse second_resp = do_reboot_status_rpc(); + EXPECT_THAT(second_resp, ActiveCountMethod(false, 1, RebootMethod::COLD)); + EXPECT_THAT( + second_resp, + IsStatus(RebootStatus_Status::RebootStatus_Status_STATUS_UNKNOWN, "")); +} + +TEST_P(RebootBEAutoStartTest, TestColdBootDbusError) { + // Return FAIL from dbus reboot call. + DbusInterface::DbusResponse dbus_response{ + DbusInterface::DbusStatus::DBUS_FAIL, "dbus reboot failed"}; + EXPECT_CALL(m_dbus_interface, Reboot(_)) + .Times(1) + .WillOnce(Return(dbus_response)); + + RebootRequest request; + request.set_method(RebootMethod::COLD); + start_reboot_via_rpc(request); + + sleep(TWO_SECONDS); + + EXPECT_EQ(m_rebootbe.GetCurrentStatus(), RebootBE::NsfManagerStatus::IDLE); + gnoi::system::RebootStatusResponse second_resp = do_reboot_status_rpc(); + EXPECT_THAT(second_resp, ActiveCountMethod(false, 1, RebootMethod::COLD)); + EXPECT_THAT(second_resp, + IsStatus(RebootStatus_Status::RebootStatus_Status_STATUS_FAILURE, + "dbus reboot failed")); +} + +TEST_P(RebootBEAutoStartTest, TestStopDuringColdBoot) { + set_mock_defaults(); + + RebootRequest request; + request.set_method(RebootMethod::COLD); + start_reboot_via_rpc(request); + std::this_thread::sleep_for(std::chrono::milliseconds(TENTH_SECOND_MS)); + EXPECT_EQ(m_rebootbe.GetCurrentStatus(), + RebootBE::NsfManagerStatus::COLD_REBOOT_IN_PROGRESS); + + send_stop_reboot_thread(); + std::this_thread::sleep_for(std::chrono::milliseconds(TENTH_SECOND_MS)); + EXPECT_EQ(m_rebootbe.GetCurrentStatus(), RebootBE::NsfManagerStatus::IDLE); + + gnoi::system::RebootStatusResponse response = do_reboot_status_rpc(); + EXPECT_THAT(response, ActiveCountMethod(false, 1, RebootMethod::COLD)); + EXPECT_THAT( + response, + IsStatus(RebootStatus_Status::RebootStatus_Status_STATUS_UNKNOWN, "")); +} + +TEST_P(RebootBEAutoStartTest, TestNSFToCompletion) { + set_mock_defaults(); + + EXPECT_CALL(m_critical_interface, + report_critical_state("platform failed to reboot")) + .Times(1); + + set_telemetry_overall_expects(false); + set_telemetry_stage_expects(WarmBootStage::STAGE_FREEZE, true); + set_telemetry_stage_expects(WarmBootStage::STAGE_CHECKPOINT, true); + + overwrite_reboot_timeout(1); + overwrite_quiescent_hold_time_ms(100); + + // skip state verification + TestUtils::set_state_verification_enable(m_config_db, false, false); + + TestUtils::populate_registration_table(m_db, "docker1|app1", false, true, + true, false); + + auto test_sequence = [&] { + std::this_thread::sleep_for(std::chrono::milliseconds(TENTH_SECOND_MS)); + EXPECT_EQ(m_rebootbe.GetCurrentStatus(), + RebootBE::NsfManagerStatus::NSF_REBOOT_IN_PROGRESS); + TestUtils::populate_restart_table_state( + m_db, "app1", get_warm_start_state_name(WarmStartState::CHECKPOINTED)); + }; + + RebootRequest request; + request.set_method(RebootMethod::NSF); + start_reboot_via_rpc(request); + + // Warm start states are cleared at beginning of NSF boot. + std::thread test_thread = std::thread(test_sequence); + + // 1 second reboot timeout + // 1/10 second delay before warm state is written in test + // 1/10 second delay for quiescent hold time + std::this_thread::sleep_for(std::chrono::milliseconds(TWO_SECONDS_MS)); + + gnoi::system::RebootStatusResponse response = do_reboot_status_rpc(); + test_thread.join(); + + EXPECT_EQ(m_rebootbe.GetCurrentStatus(), RebootBE::NsfManagerStatus::IDLE); + EXPECT_THAT(response, ActiveCountMethod(false, 1, RebootMethod::NSF)); + EXPECT_THAT(response, + IsStatus(RebootStatus_Status::RebootStatus_Status_STATUS_FAILURE, + "platform failed to reboot")); + TestUtils::check_warmboot_enabled(m_db, /*expected_state=*/false); +} + +TEST_P(RebootBEAutoStartTest, TestStateVerificationFailedTimeout) { + set_mock_defaults(); + + overwrite_state_verification_timeout(1); + set_telemetry_overall_expects(/*success=*/false); + + TestUtils::set_state_verification_enable(m_config_db, false, true); + + // Empty registration: if we fail, it should be because of + // state verification + TestUtils::populate_registration_table(m_db, "docker1|app1", false, false, + false, false); + + RebootRequest request; + request.set_method(RebootMethod::NSF); + start_reboot_via_rpc(request); + + std::this_thread::sleep_for(std::chrono::milliseconds(TENTH_SECOND_MS)); + EXPECT_EQ(m_rebootbe.GetCurrentStatus(), + RebootBE::NsfManagerStatus::NSF_REBOOT_IN_PROGRESS); + + // We have to wait for the 1 second state verification timeout + std::this_thread::sleep_for(std::chrono::milliseconds(TWO_SECONDS_MS)); + + EXPECT_EQ(m_rebootbe.GetCurrentStatus(), RebootBE::NsfManagerStatus::IDLE); + gnoi::system::RebootStatusResponse response = do_reboot_status_rpc(); + EXPECT_THAT(response, ActiveCountMethod(false, 1, RebootMethod::NSF)); + EXPECT_THAT( + response, + IsStatus( + RebootStatus_Status::RebootStatus_Status_STATUS_RETRIABLE_FAILURE, + "timeout occurred during reboot state verification: retriable " + "error")); + TestUtils::check_warmboot_enabled(m_db, /*expected_state=*/false); +} + +TEST_P(RebootBEAutoStartTest, TestQuiescenceFailedTimeout) { + set_mock_defaults(); + + overwrite_quiescent_timeout_ms(400); + set_all_telemetry_expects(/*freeze_status=*/false, + /*checkpoint_status=*/false); + + TestUtils::set_state_verification_enable(m_config_db, false, false); + + TestUtils::populate_registration_table(m_db, "docker1|app1", false, true, + false, false); + + RebootRequest request; + request.set_method(RebootMethod::NSF); + start_reboot_via_rpc(request); + + std::this_thread::sleep_for(std::chrono::milliseconds(TENTH_SECOND_MS)); + EXPECT_EQ(m_rebootbe.GetCurrentStatus(), + RebootBE::NsfManagerStatus::NSF_REBOOT_IN_PROGRESS); + + // We have to wait for the 1 second quiescence + std::this_thread::sleep_for(std::chrono::milliseconds(ONE_SECOND_MS)); + + EXPECT_EQ(m_rebootbe.GetCurrentStatus(), RebootBE::NsfManagerStatus::IDLE); + gnoi::system::RebootStatusResponse response = do_reboot_status_rpc(); + EXPECT_THAT(response, ActiveCountMethod(false, 1, RebootMethod::NSF)); + EXPECT_THAT(response, + IsStatus(RebootStatus_Status::RebootStatus_Status_STATUS_FAILURE, + "timeout occurred during reboot stage freeze")); + TestUtils::check_warmboot_enabled(m_db, /*expected_state=*/false); +} + +TEST_P(RebootBEAutoStartTest, TestCheckpointFailedTimeout) { + set_mock_defaults(); + + overwrite_checkpoint_timeout(1); + overwrite_quiescent_hold_time_ms(100); + set_all_telemetry_expects(/*freeze_status=*/true, + /*checkpoint_status=*/false); + + TestUtils::set_state_verification_enable(m_config_db, false, false); + + TestUtils::populate_registration_table(m_db, "docker1|app1", false, false, + true, false); + + RebootRequest request; + request.set_method(RebootMethod::NSF); + start_reboot_via_rpc(request); + + std::this_thread::sleep_for(std::chrono::milliseconds(TENTH_SECOND_MS)); + EXPECT_EQ(m_rebootbe.GetCurrentStatus(), + RebootBE::NsfManagerStatus::NSF_REBOOT_IN_PROGRESS); + + // 1/10 second for quiescence hold time + // 1 second for checkpoint timeout + std::this_thread::sleep_for(std::chrono::milliseconds(TWO_SECONDS_MS)); + + EXPECT_EQ(m_rebootbe.GetCurrentStatus(), RebootBE::NsfManagerStatus::IDLE); + gnoi::system::RebootStatusResponse response = do_reboot_status_rpc(); + EXPECT_THAT(response, ActiveCountMethod(false, 1, RebootMethod::NSF)); + EXPECT_THAT( + response, + IsStatus(RebootStatus_Status::RebootStatus_Status_STATUS_FAILURE, + HasSubstr("timeout occurred during reboot stage checkpoint"))); + TestUtils::check_warmboot_enabled(m_db, /*expected_state=*/false); +} + +TEST_P(RebootBEAutoStartTest, TestNSFDbusRebootError) { + // Return FAIL from dbus reboot call. + DbusInterface::DbusResponse dbus_response{ + DbusInterface::DbusStatus::DBUS_FAIL, "dbus reboot failed"}; + EXPECT_CALL(m_dbus_interface, Reboot(_)) + .Times(1) + .WillOnce(Return(dbus_response)); + set_telemetry_overall_expects(/*status=*/false); + set_telemetry_stage_expects(WarmBootStage::STAGE_FREEZE, /*status=*/true); + set_telemetry_stage_expects(WarmBootStage::STAGE_CHECKPOINT, + /*status=*/true); + + overwrite_quiescent_hold_time_ms(100); + + TestUtils::set_state_verification_enable(m_config_db, false, false); + + // Empty registration. + TestUtils::populate_registration_table(m_db, "docker1|app1", false, false, + false, false); + + RebootRequest request; + request.set_method(RebootMethod::NSF); + start_reboot_via_rpc(request); + + // Short wait: there should be no state verification, checkpoint or + // or platform reboot delays + // 1/10 second for quiescent hold time + // the quiescent select timeout is 250ms + std::this_thread::sleep_for(std::chrono::milliseconds(HALF_SECOND_MS)); + + EXPECT_EQ(m_rebootbe.GetCurrentStatus(), RebootBE::NsfManagerStatus::IDLE); + gnoi::system::RebootStatusResponse response = do_reboot_status_rpc(); + EXPECT_THAT(response, ActiveCountMethod(false, 1, RebootMethod::NSF)); + EXPECT_THAT(response, + IsStatus(RebootStatus_Status::RebootStatus_Status_STATUS_FAILURE, + "dbus reboot failed")); + TestUtils::check_warmboot_enabled(m_db, /*expected_state=*/false); +} + +// Test redis tables are cleared. +// - warm boot states should be cleared +// - existing apps in init table should be cleared +TEST_P(RebootBEAutoStartTest, TestRedisNSFSetup) { + set_mock_defaults(); + set_telemetry_overall_expects(/*success=*/false); + + TestUtils::populate_restart_table_state( + m_db, "app1", get_warm_start_state_name(WarmStartState::CHECKPOINTED)); + + swss::Table warmRestartTable(&m_db, STATE_WARM_RESTART_TABLE_NAME); + std::string state = ""; + warmRestartTable.hget("app1", "state", state); + EXPECT_EQ(state, get_warm_start_state_name(WarmStartState::CHECKPOINTED)); + + swss::Table initTable(&m_db, STATE_WARM_RESTART_INIT_TABLE_NAME); + initTable.hset("docker2|app2", "timestamp", "fake-timestamp"); + std::string timestamp = ""; + initTable.hget("docker2|app2", "timestamp", timestamp); + EXPECT_THAT(timestamp, StrEq("fake-timestamp")); + + overwrite_state_verification_timeout(1); + + TestUtils::set_state_verification_enable(m_config_db, false, true); + + // Empty registration: if we fail, it should be because of + // state verification + TestUtils::populate_registration_table(m_db, "docker1|app1", false, false, + false, false); + + RebootRequest request; + request.set_method(RebootMethod::NSF); + start_reboot_via_rpc(request); + + std::this_thread::sleep_for(std::chrono::milliseconds(TENTH_SECOND_MS)); + EXPECT_EQ(m_rebootbe.GetCurrentStatus(), + RebootBE::NsfManagerStatus::NSF_REBOOT_IN_PROGRESS); + + // We have to wait for the 1 second state verification timeout + std::this_thread::sleep_for(std::chrono::milliseconds(TWO_SECONDS_MS)); + + state = ""; + warmRestartTable.hget("app1", "state", state); + EXPECT_NE(state, get_warm_start_state_name(WarmStartState::CHECKPOINTED)); + + timestamp = ""; + initTable.hget("docker2|app2", "timestamp", timestamp); + EXPECT_NE(timestamp, "fake-timestamp"); + + EXPECT_EQ(m_rebootbe.GetCurrentStatus(), RebootBE::NsfManagerStatus::IDLE); + gnoi::system::RebootStatusResponse response = do_reboot_status_rpc(); + EXPECT_THAT(response, ActiveCountMethod(false, 1, RebootMethod::NSF)); + EXPECT_THAT( + response, + IsStatus( + RebootStatus_Status::RebootStatus_Status_STATUS_RETRIABLE_FAILURE, + HasSubstr("timeout occurred during reboot state verification: " + "retriable error"))); + TestUtils::check_warmboot_enabled(m_db, /*expected_state=*/false); +} + +TEST_P(RebootBEAutoStartTest, TestNSFFailureFollowedByColdBoot) { + DbusInterface::DbusResponse dbus_response{ + DbusInterface::DbusStatus::DBUS_SUCCESS, ""}; + EXPECT_CALL(m_dbus_interface, Reboot(_)) + .Times(1) + .WillRepeatedly(Return(dbus_response)); + + EXPECT_CALL(m_critical_interface, + report_critical_state("platform failed to reboot")) + .Times(1); + overwrite_reboot_timeout(1); + overwrite_checkpoint_timeout(1); + overwrite_quiescent_hold_time_ms(100); + + set_all_telemetry_expects(/*freeze_status=*/true, + /*checkpoint_status=*/false); + + TestUtils::set_state_verification_enable(m_config_db, false, false); + + TestUtils::populate_registration_table(m_db, "docker1|app1", false, false, + true, false); + + RebootRequest request; + request.set_method(RebootMethod::NSF); + start_reboot_via_rpc(request); + + std::this_thread::sleep_for(std::chrono::milliseconds(TENTH_SECOND_MS)); + EXPECT_EQ(m_rebootbe.GetCurrentStatus(), + RebootBE::NsfManagerStatus::NSF_REBOOT_IN_PROGRESS); + + // 1/10 second quiescence hold time + // 1 second checkpoint timeout + std::this_thread::sleep_for(std::chrono::milliseconds(TWO_SECONDS_MS)); + + gnoi::system::RebootStatusResponse response = do_reboot_status_rpc(); + + EXPECT_THAT(response, ActiveCountMethod(false, 1, RebootMethod::NSF)); + EXPECT_THAT( + response, + IsStatus(RebootStatus_Status::RebootStatus_Status_STATUS_FAILURE, + HasSubstr("timeout occurred during reboot stage checkpoint"))); + + request.set_method(RebootMethod::COLD); + start_reboot_via_rpc(request); + + // We have to wait for the 1 second reboot Timeout + std::this_thread::sleep_for(std::chrono::milliseconds(TWO_SECONDS_MS)); + + EXPECT_EQ(m_rebootbe.GetCurrentStatus(), RebootBE::NsfManagerStatus::IDLE); + response = do_reboot_status_rpc(); + EXPECT_THAT(response, ActiveCountMethod(false, 2, RebootMethod::COLD)); + EXPECT_THAT(response, + IsStatus(RebootStatus_Status::RebootStatus_Status_STATUS_FAILURE, + "platform failed to reboot")); + TestUtils::check_warmboot_enabled(m_db, /*expected_state=*/false); +} + +TEST_P(RebootBEAutoStartTest, TestInvalidJsonRebootRequest) { + std::string json_request = "abcd"; + NotificationResponse response = handle_reboot_request(json_request); + EXPECT_EQ(swss::StatusCode::SWSS_RC_INTERNAL, response.status); +} + +TEST_P(RebootBEAutoStartTest, TestStopDuringRebootStateVerification) { + set_telemetry_overall_expects(/*success=*/false); + + // Enable state verification with default 260 sec timeout) + TestUtils::set_state_verification_enable(m_config_db, false, true); + + // Empty registration. + TestUtils::populate_registration_table(m_db, "docker1|app1", false, false, + false, false); + + RebootRequest request; + request.set_method(RebootMethod::NSF); + start_reboot_via_rpc(request); + + std::this_thread::sleep_for(std::chrono::milliseconds(TENTH_SECOND_MS)); + + EXPECT_EQ(m_rebootbe.GetCurrentStatus(), + RebootBE::NsfManagerStatus::NSF_REBOOT_IN_PROGRESS); + gnoi::system::RebootStatusResponse response = do_reboot_status_rpc(); + EXPECT_THAT(response, ActiveCountMethod(true, 1, RebootMethod::NSF)); + TestUtils::check_warmboot_enabled(m_db, /*expected_state=*/true); + + // Reboot thread is active: its waiting for state verification to complete + // TearDown will call rebootbe.Stop() which will Stop and Join the + // reboot thread +} + +TEST_P(RebootBEAutoStartTest, TestStopDuringRebootFreezeStage) { + set_all_telemetry_expects(/*freeze_status=*/false, + /*checkpoint_status=*/false); + + // Disable state verification + TestUtils::set_state_verification_enable(m_config_db, false, false); + + // Register for checkpoint monitoring + TestUtils::populate_registration_table(m_db, "docker1|app1", false, true, + false, false); + + RebootRequest request; + request.set_method(RebootMethod::NSF); + start_reboot_via_rpc(request); + + std::this_thread::sleep_for(std::chrono::milliseconds(TENTH_SECOND_MS)); + + EXPECT_EQ(m_rebootbe.GetCurrentStatus(), + RebootBE::NsfManagerStatus::NSF_REBOOT_IN_PROGRESS); + gnoi::system::RebootStatusResponse response = do_reboot_status_rpc(); + EXPECT_THAT(response, ActiveCountMethod(true, 1, RebootMethod::NSF)); + TestUtils::check_warmboot_enabled(m_db, /*expected_state=*/true); + + // Reboot thread is active: its waiting for app1 to quiesce. + // TearDown will call rebootbe.Stop() which will Stop and Join the + // reboot thread +} + +TEST_P(RebootBEAutoStartTest, TestStopDuringRebootCheckpointStage) { + set_all_telemetry_expects(/*freeze_status=*/true, + /*checkpoint_status=*/false); + + // Disable state verification. + overwrite_quiescent_hold_time_ms(10); + TestUtils::set_state_verification_enable(m_config_db, false, false); + + // Register app1 for checkpointing. + TestUtils::populate_registration_table(m_db, "docker1|app1", false, false, + true, false); + + RebootRequest request; + request.set_method(RebootMethod::NSF); + start_reboot_via_rpc(request); + + // With the short hold time we need 250+ms to allow the quiescence hold + // time select timeout to fire. + std::this_thread::sleep_for(std::chrono::milliseconds(HALF_SECOND_MS)); + + EXPECT_EQ(m_rebootbe.GetCurrentStatus(), + RebootBE::NsfManagerStatus::NSF_REBOOT_IN_PROGRESS); + gnoi::system::RebootStatusResponse response = do_reboot_status_rpc(); + EXPECT_THAT(response, ActiveCountMethod(true, 1, RebootMethod::NSF)); + TestUtils::check_warmboot_enabled(m_db, /*expected_state=*/true); + + // Reboot thread is active: its waiting for app1 to checkpoint. + // TearDown will call rebootbe.Stop() which will Stop and Join the + // reboot thread +} + +TEST_P(RebootBEAutoStartTest, TestStopDuringWaitPlatformReboot) { + set_telemetry_overall_expects(/*status=*/false); + set_telemetry_stage_expects(WarmBootStage::STAGE_FREEZE, /*status=*/true); + set_telemetry_stage_expects(WarmBootStage::STAGE_CHECKPOINT, + /*status=*/true); + + // Disable state verification. + overwrite_quiescent_hold_time_ms(10); + TestUtils::set_state_verification_enable(m_config_db, false, false); + + // Empty registration. + TestUtils::populate_registration_table(m_db, "docker1|app1", false, false, + false, false); + + RebootRequest request; + request.set_method(RebootMethod::NSF); + start_reboot_via_rpc(request); + + // With the short hold time we need 250+ms to allow the quiescence hold + // time select timeout to fire. + std::this_thread::sleep_for(std::chrono::milliseconds(HALF_SECOND_MS)); + + EXPECT_EQ(m_rebootbe.GetCurrentStatus(), + RebootBE::NsfManagerStatus::NSF_REBOOT_IN_PROGRESS); + gnoi::system::RebootStatusResponse response = do_reboot_status_rpc(); + EXPECT_THAT(response, ActiveCountMethod(true, 1, RebootMethod::NSF)); + TestUtils::check_warmboot_enabled(m_db, /*expected_state=*/true); + + // Reboot thread is active: its waiting for the platform to reboot. + // TearDown will call rebootbe.Stop() which will Stop and Join the + // reboot thread +} + +// +// Stop On Freeze Tests +// +TEST_P(RebootBEAutoStartTest, TestStopDuringWaitForStopOnFreeze) { + set_all_telemetry_expects(false); + + overwrite_quiescent_hold_time_ms(50); + overwrite_quiescent_timeout_ms(1000); + + DbusInterface::DbusResponse dbus_response{ + DbusInterface::DbusStatus::DBUS_SUCCESS, ""}; + EXPECT_CALL(m_dbus_interface, StopContainerStatus(_)) + .Times(AtLeast(1)) + .WillRepeatedly(Return(dbus_response)); + + // Disable state verification. + TestUtils::set_state_verification_enable(m_config_db, false, false); + + // Register app1 for checkpointing. + TestUtils::populate_registration_table(m_db, "docker1|app1", true, false, + false, false); + + RebootRequest request; + request.set_method(RebootMethod::NSF); + start_reboot_via_rpc(request); + + std::this_thread::sleep_for(std::chrono::milliseconds(TENTH_SECOND_MS)); + + EXPECT_EQ(m_rebootbe.GetCurrentStatus(), + RebootBE::NsfManagerStatus::NSF_REBOOT_IN_PROGRESS); + gnoi::system::RebootStatusResponse response = do_reboot_status_rpc(); + EXPECT_THAT(response, ActiveCountMethod(true, 1, RebootMethod::NSF)); + TestUtils::check_warmboot_enabled(m_db, /*expected_state=*/true); + + // Reboot thread is active: its waiting for docker1 to exit/stop + // TearDown will call rebootbe.Stop() which will Stop and Join the + // reboot thread +} + +TEST_P(RebootBEAutoStartTest, TestStopOnFreezeTimeout) { + set_all_telemetry_expects(false); + + overwrite_quiescent_hold_time_ms(50); + overwrite_quiescent_timeout_ms(1000); + + // An empty string is not a valid json stop container status response + DbusInterface::DbusResponse dbus_response{ + DbusInterface::DbusStatus::DBUS_SUCCESS, ""}; + EXPECT_CALL(m_dbus_interface, StopContainerStatus(_)) + .Times(AtLeast(1)) + .WillRepeatedly(Return(dbus_response)); + + TestUtils::set_state_verification_enable(m_config_db, false, false); + + TestUtils::populate_registration_table(m_db, "docker1|app1", true, false, + false, false); + + RebootRequest request; + request.set_method(RebootMethod::NSF); + start_reboot_via_rpc(request); + + // Container stop status is checked every half second. + std::this_thread::sleep_for(std::chrono::milliseconds(FIFTEEN_HUNDRED_MS)); + + EXPECT_EQ(m_rebootbe.GetCurrentStatus(), RebootBE::NsfManagerStatus::IDLE); + gnoi::system::RebootStatusResponse response = do_reboot_status_rpc(); + EXPECT_THAT(response, ActiveCountMethod(false, 1, RebootMethod::NSF)); + EXPECT_THAT(response, + IsStatus(RebootStatus_Status::RebootStatus_Status_STATUS_FAILURE, + "timeout occurred waiting for containers to stop")); + TestUtils::check_warmboot_enabled(m_db, /*expected_state=*/false); +} + +TEST_P(RebootBEAutoStartTest, TestDbusErrorRequestingContainerStop) { + set_all_telemetry_expects(false); + + // Return FAIL from dbus reboot call. + DbusInterface::DbusResponse dbus_response{ + DbusInterface::DbusStatus::DBUS_FAIL, + "dbus error calling StopContainers"}; + EXPECT_CALL(m_dbus_interface, StopContainers(_)) + .Times(1) + .WillOnce(Return(dbus_response)); + + TestUtils::set_state_verification_enable(m_config_db, false, false); + + TestUtils::populate_registration_table(m_db, "docker1|app1", true, false, + false, false); + + RebootRequest request; + request.set_method(RebootMethod::NSF); + start_reboot_via_rpc(request); + + // Container stop status is checked every half second. + std::this_thread::sleep_for(std::chrono::milliseconds(ONE_SECOND_MS)); + + EXPECT_EQ(m_rebootbe.GetCurrentStatus(), RebootBE::NsfManagerStatus::IDLE); + + gnoi::system::RebootStatusResponse response = do_reboot_status_rpc(); + EXPECT_THAT(response, ActiveCountMethod(false, 1, RebootMethod::NSF)); + EXPECT_THAT(response, + IsStatus(RebootStatus_Status::RebootStatus_Status_STATUS_FAILURE, + "dbus error calling StopContainers")); + TestUtils::check_warmboot_enabled(m_db, /*expected_state=*/false); +} + +INSTANTIATE_TEST_SUITE_P(TestWithStartupWarmbootEnabledState, + RebootBEAutoStartTest, testing::Values(true, false)); + +} // namespace rebootbackend diff --git a/src/sonic-framework/tests/redis_utils_test.cpp b/src/sonic-framework/tests/redis_utils_test.cpp new file mode 100644 index 000000000000..c42161691a22 --- /dev/null +++ b/src/sonic-framework/tests/redis_utils_test.cpp @@ -0,0 +1,785 @@ +#include "redis_utils.h" + +#include +#include +#include + +#include +#include +#include + +#include "select.h" +#include "stateverification.h" +#include "table.h" +#include "test_utils_common.h" +#include "timestamp.h" +#include "warm_restart.h" + +namespace rebootbackend { + +using WarmStartState = ::swss::WarmStart::WarmStartState; +using WarmBootStage = ::swss::WarmStart::WarmBootStage; +using WarmBootNotification = ::swss::WarmStart::WarmBootNotification; + +using ::testing::AllOf; +using ::testing::HasSubstr; +using ::testing::StrEq; + +class RedisTest : public ::testing::Test { + protected: + RedisTest() : m_db("STATE_DB", 0), m_reg(), m_init_reg() { + TestUtils::clear_tables(m_db); + } + + swss::DBConnector m_db; + Registration m_reg; + InitRegistration m_init_reg; + + void clear_contents() { return m_reg.clear_contents(); } + + size_t get_state_set_size(WarmBootStage nsf_stage) { + return m_reg.m_remaining_apps.at(nsf_stage).size(); + } + + size_t get_reregistration_set_size() { + return m_init_reg.m_missing_registrations.size(); + } + + // Special version of name mapping that is compatible with the DB values. + std::string warm_boot_stage_name(WarmBootStage stage) { + switch (stage) { + case (WarmBootStage::STAGE_FREEZE): { + return "quiescent"; + } + case (WarmBootStage::STAGE_CHECKPOINT): { + return "checkpointed"; + } + case (WarmBootStage::STAGE_RECONCILIATION): { + return "reconciled"; + } + case (WarmBootStage::STAGE_UNFREEZE): { + return "completed"; + } + default: { + return ""; + } + } + } + + void populate_default_init_table() { + swss::Table initTable(&m_db, STATE_WARM_RESTART_INIT_TABLE_NAME); + initTable.hset("docker1|app1", "timestamp", ""); + initTable.hset("docker2|app2", "timestamp", ""); + initTable.hset("docker3|app3", "timestamp", ""); + initTable.hset("docker4|app1", "timestamp", ""); + // The invalid entry should not end up in the list of apps. + initTable.hset("invalid", "timestamp", ""); + } + + friend class Registration; +}; + +TEST_F(RedisTest, testSendNsfManagerNotification) { + swss::NotificationConsumer nc( + &m_db, swss::WarmStart::kNsfManagerNotificationChannel); + swss::Select s; + s.addSelectable(&nc); + + send_nsf_manager_notification(m_db, WarmBootNotification::kFreeze); + + swss::Selectable *sel; + bool ret = s.select(&sel, 1); + EXPECT_EQ(ret, swss::Select::OBJECT); + + std::string op, data; + std::vector values; + nc.pop(op, data, values); + auto fv = values[0]; + + EXPECT_EQ(op, swss::WarmStart::warmBootNotificationNameMap()->at( + WarmBootNotification::kFreeze)); + + send_nsf_manager_notification(m_db, WarmBootNotification::kUnfreeze); + + ret = s.select(&sel, 1); + EXPECT_EQ(ret, swss::Select::OBJECT); + + nc.pop(op, data, values); + fv = values[0]; + + EXPECT_EQ(op, swss::WarmStart::warmBootNotificationNameMap()->at( + WarmBootNotification::kUnfreeze)); + + send_nsf_manager_notification(m_db, WarmBootNotification::kCheckpoint); + + ret = s.select(&sel, 1); + EXPECT_EQ(ret, swss::Select::OBJECT); + + nc.pop(op, data, values); + fv = values[0]; + + EXPECT_EQ(op, swss::WarmStart::warmBootNotificationNameMap()->at( + WarmBootNotification::kCheckpoint)); +} + +TEST_F(RedisTest, testSendStateVerification) { + swss::NotificationConsumer nc(&m_db, STATE_VERIFICATION_REQ_CHANNEL); + swss::Select s; + s.addSelectable(&nc); + + std::string timestamp = send_state_verification_notification(m_db, true); + + swss::Selectable *sel; + bool ret = s.select(&sel, 1); + EXPECT_EQ(ret, swss::Select::OBJECT); + + std::string op, data; + std::vector values; + nc.pop(op, data, values); + auto fv = values[0]; + + EXPECT_EQ(op, ALL_COMPONENT); + EXPECT_EQ(data, timestamp); + EXPECT_EQ(FREEZE_FIELD, fvField(fv)); + EXPECT_EQ("true", fvValue(fv)); + + std::string second_timestamp = + send_state_verification_notification(m_db, false); + + ret = s.select(&sel, 1); + EXPECT_EQ(ret, swss::Select::OBJECT); + + nc.pop(op, data, values); + fv = values[0]; + + EXPECT_EQ(op, ALL_COMPONENT); + EXPECT_EQ(data, second_timestamp); + EXPECT_EQ(FREEZE_FIELD, fvField(fv)); + EXPECT_EQ("false", fvValue(fv)); + EXPECT_NE(timestamp, second_timestamp); +} + +TEST_F(RedisTest, testInitWarmRebootStates) { + swss::Table warmRestartTable(&m_db, STATE_WARM_RESTART_TABLE_NAME); + + warmRestartTable.hset("app1", "state", "disabled"); + warmRestartTable.hset("app1", "timestamp", "abcdefg"); + warmRestartTable.hset("app2", "state", "reconciled"); + warmRestartTable.hset("app2", "timestamp", "zyxwvu"); + + std::string value; + bool ret = warmRestartTable.hget("app1", "state", value); + EXPECT_TRUE(ret); + + ret = warmRestartTable.hget("app1", "timestamp", value); + EXPECT_TRUE(ret); + + init_warm_reboot_states(m_db); + + ret = warmRestartTable.hget("app1", "state", value); + EXPECT_FALSE(ret); + + ret = warmRestartTable.hget("app1", "timestamp", value); + EXPECT_FALSE(ret); + + ret = warmRestartTable.hget("app2", "state", value); + EXPECT_FALSE(ret); + + ret = warmRestartTable.hget("app2", "timestamp", value); + EXPECT_FALSE(ret); +} + +TEST_F(RedisTest, testSetWarmRestartEnable) { + swss::Table warmRestartTable(&m_db, STATE_WARM_RESTART_ENABLE_TABLE_NAME); + + for (const auto &enabled : {true, false}) { + warmRestartTable.del("system"); + + set_warm_restart_enable(m_db, enabled); + + std::string value; + bool ret = warmRestartTable.hget("system", "enable", value); + EXPECT_TRUE(ret); + EXPECT_EQ(value, enabled ? "true" : "false"); + } +} + +TEST_F(RedisTest, TestIsValidKeyAndGetDockerAppFromKey) { + std::string key = "abc|def"; + std::string separator = "|"; + std::string docker, app; + + EXPECT_TRUE(is_valid_key(key, separator)); + EXPECT_TRUE(get_docker_app_from_key(key, separator, docker, app)); + EXPECT_EQ(docker, "abc"); + EXPECT_EQ(app, "def"); + + key = "abcd|"; + EXPECT_FALSE(is_valid_key(key, separator)); + EXPECT_FALSE(get_docker_app_from_key(key, separator, docker, app)); + + key = "|abcd"; + EXPECT_FALSE(is_valid_key(key, separator)); + EXPECT_FALSE(get_docker_app_from_key(key, separator, docker, app)); + + key = "abcd"; + EXPECT_FALSE(is_valid_key(key, separator)); + EXPECT_FALSE(get_docker_app_from_key(key, separator, docker, app)); + + separator = ""; + key = "abc|def"; + EXPECT_FALSE(is_valid_key(key, separator)); + EXPECT_FALSE(get_docker_app_from_key(key, separator, docker, app)); +} + +TEST_F(RedisTest, GetWarmRestartCounter) { + EXPECT_THAT(get_warm_restart_counter(m_db), StrEq("")); + for (int i = 0; i < 5; i++) { + set_warm_restart_counter(m_db, i); + EXPECT_THAT(get_warm_restart_counter(m_db), StrEq(std::to_string(i))); + } +} + +TEST_F(RedisTest, TestFetchRegistrationInfo) { + TestUtils::populate_registration_table(m_db, "invalid", false, false, false, + true); + TestUtils::populate_registration_table(m_db, "docker1|app1", false, false, + false, true); + TestUtils::populate_registration_table(m_db, "docker2|app2", true, true, true, + false); + TestUtils::populate_registration_table(m_db, "docker3|app3", false, false, + true, false); + + m_reg.fetch_registration_info(); + + Registration::RegistrationSet set = m_reg.get_registered_app_set(); + + EXPECT_TRUE(set.count("docker1|app1")); + EXPECT_TRUE(set.count("docker2|app2")); + EXPECT_TRUE(set.count("docker2|app2")); + EXPECT_EQ(set.size(), 3); +} + +TEST_F(RedisTest, TestStopOnFreezeList) { + TestUtils::populate_registration_table(m_db, "docker1|app1", true, false, + false, true); + TestUtils::populate_registration_table(m_db, "docker2|app2", true, false, + false, false); + TestUtils::populate_registration_table(m_db, "docker3|app3", false, false, + true, false); + + m_reg.fetch_registration_info(); + Registration::RegistrationSet set = m_reg.get_stop_on_freeze_set(); + EXPECT_EQ(2, set.size()); + EXPECT_EQ(1, set.count("docker1")); + EXPECT_EQ(1, set.count("docker2")); +} + +TEST_F(RedisTest, TestCheckQuiesced) { + // No apps registered. + m_reg.fetch_registration_info(); + Registration::Response response = m_reg.check_quiesced(); + EXPECT_EQ(response.status, Registration::Status::COMPLETED); + + // Apps registered, but have not reached the correct state. + TestUtils::populate_registration_table(m_db, "docker1|app1", false, true, + false, false); + TestUtils::populate_registration_table(m_db, "docker2|app2", false, true, + false, false); + TestUtils::populate_registration_table(m_db, "docker3|app3", false, true, + false, false); + TestUtils::populate_registration_table(m_db, "docker4|app4", true, false, + false, false); + + m_reg.fetch_registration_info(); + EXPECT_EQ(3, get_state_set_size(WarmBootStage::STAGE_FREEZE)); + + // app1 and app2 reach the correct state. + TestUtils::populate_restart_table_state( + m_db, "app1", get_warm_start_state_name(WarmStartState::QUIESCENT)); + TestUtils::populate_restart_table_state( + m_db, "app2", get_warm_start_state_name(WarmStartState::CHECKPOINTED)); + + response = m_reg.check_quiesced(); + EXPECT_EQ(response.status, Registration::Status::IN_PROCESS); + EXPECT_EQ(1, get_state_set_size(WarmBootStage::STAGE_FREEZE)); + + // app3 reaches the correct state. + TestUtils::populate_restart_table_state( + m_db, "app3", get_warm_start_state_name(WarmStartState::CHECKPOINTED)); + + response = m_reg.check_quiesced(); + EXPECT_EQ(response.status, Registration::Status::COMPLETED); + EXPECT_EQ(0, get_state_set_size(WarmBootStage::STAGE_FREEZE)); + + // app3 reports an error. + m_reg.fetch_registration_info(); + TestUtils::populate_restart_table_state( + m_db, "app3", get_warm_start_state_name(WarmStartState::FAILED)); + + response = m_reg.check_quiesced(); + EXPECT_EQ(response.status, Registration::Status::FAILURE); + EXPECT_FALSE(response.error_string.empty()); +} + +TEST_F(RedisTest, TestCheckCheckpointed) { + // No apps registered. + m_reg.fetch_registration_info(); + Registration::Response response = m_reg.check_checkpointed(); + EXPECT_EQ(response.status, Registration::Status::COMPLETED); + + // Apps registered, but have not reached the correct state. + TestUtils::populate_registration_table(m_db, "docker1|app1", false, false, + true, false); + TestUtils::populate_registration_table(m_db, "docker2|app2", false, false, + true, false); + TestUtils::populate_registration_table(m_db, "docker3|app3", false, false, + true, false); + TestUtils::populate_registration_table(m_db, "docker4|app4", true, false, + false, false); + + m_reg.fetch_registration_info(); + EXPECT_EQ(3, get_state_set_size(WarmBootStage::STAGE_CHECKPOINT)); + + // app2 reaches the correct state. app1 has changed state, but is not yet + // checkpointed. + TestUtils::populate_restart_table_state( + m_db, "app1", get_warm_start_state_name(WarmStartState::QUIESCENT)); + TestUtils::populate_restart_table_state( + m_db, "app2", get_warm_start_state_name(WarmStartState::CHECKPOINTED)); + + response = m_reg.check_checkpointed(); + EXPECT_EQ(response.status, Registration::Status::IN_PROCESS); + EXPECT_EQ(2, get_state_set_size(WarmBootStage::STAGE_CHECKPOINT)); + + // app1 and app3 reach the correct state. + TestUtils::populate_restart_table_state( + m_db, "app1", get_warm_start_state_name(WarmStartState::CHECKPOINTED)); + TestUtils::populate_restart_table_state( + m_db, "app3", get_warm_start_state_name(WarmStartState::CHECKPOINTED)); + + response = m_reg.check_checkpointed(); + EXPECT_EQ(response.status, Registration::Status::COMPLETED); + EXPECT_EQ(0, get_state_set_size(WarmBootStage::STAGE_CHECKPOINT)); + + // app3 reports an error. + m_reg.fetch_registration_info(); + TestUtils::populate_restart_table_state( + m_db, "app3", get_warm_start_state_name(WarmStartState::FAILED)); + + response = m_reg.check_checkpointed(); + EXPECT_EQ(response.status, Registration::Status::FAILURE); + EXPECT_FALSE(response.error_string.empty()); +} + +TEST_F(RedisTest, TestCheckReconciled) { + // No apps registered. + m_reg.fetch_registration_info(); + Registration::Response response = m_reg.check_reconciled(); + EXPECT_EQ(response.status, Registration::Status::COMPLETED); + + // Apps registered, but have not reached the correct state. + TestUtils::populate_registration_table(m_db, "docker1|app1", false, false, + false, true); + TestUtils::populate_registration_table(m_db, "docker2|app2", false, false, + false, true); + TestUtils::populate_registration_table(m_db, "docker3|app3", false, false, + false, true); + TestUtils::populate_registration_table(m_db, "docker4|app4", true, false, + false, false); + + m_reg.fetch_registration_info(); + EXPECT_EQ(3, get_state_set_size(WarmBootStage::STAGE_RECONCILIATION)); + EXPECT_THAT(m_reg.join_pending_apps(WarmBootStage::STAGE_RECONCILIATION), + AllOf(HasSubstr("app1"), HasSubstr("app2"), HasSubstr("app3"))); + + // app1 and app2 reach the correct state. + TestUtils::populate_restart_table_state( + m_db, "app1", get_warm_start_state_name(WarmStartState::RECONCILED)); + TestUtils::populate_restart_table_state( + m_db, "app2", get_warm_start_state_name(WarmStartState::RECONCILED)); + + response = m_reg.check_reconciled(); + EXPECT_EQ(response.status, Registration::Status::IN_PROCESS); + EXPECT_EQ(1, get_state_set_size(WarmBootStage::STAGE_RECONCILIATION)); + EXPECT_THAT(m_reg.join_pending_apps(WarmBootStage::STAGE_RECONCILIATION), + HasSubstr("app3")); + + // app3 reaches the correct state. + TestUtils::populate_restart_table_state( + m_db, "app3", get_warm_start_state_name(WarmStartState::RECONCILED)); + + response = m_reg.check_reconciled(); + EXPECT_EQ(response.status, Registration::Status::COMPLETED); + EXPECT_EQ(0, get_state_set_size(WarmBootStage::STAGE_RECONCILIATION)); + EXPECT_THAT(m_init_reg.join_pending_apps(), StrEq("")); + + // app3 reports an error. + m_reg.fetch_registration_info(); + TestUtils::populate_restart_table_state( + m_db, "app3", get_warm_start_state_name(WarmStartState::FAILED)); + + response = m_reg.check_reconciled(); + EXPECT_EQ(response.status, Registration::Status::FAILURE); + EXPECT_FALSE(response.error_string.empty()); + EXPECT_THAT(m_reg.join_pending_apps(WarmBootStage::STAGE_RECONCILIATION), + HasSubstr("app3")); +} + +TEST_F(RedisTest, TestCheckUnfrozen) { + // No apps registered. + m_reg.fetch_registration_info(); + Registration::Response response = m_reg.check_unfrozen(); + EXPECT_EQ(response.status, Registration::Status::COMPLETED); + + // Apps registered. app4 reaches the correct state, but the others have not. + TestUtils::populate_registration_table(m_db, "docker1|app1", false, true, + false, false); + TestUtils::populate_registration_table(m_db, "docker2|app2", false, true, + false, false); + TestUtils::populate_registration_table(m_db, "docker3|app3", false, false, + false, true); + TestUtils::populate_registration_table(m_db, "docker4|app4", true, false, + false, false); + TestUtils::populate_restart_table_state( + m_db, "app4", get_warm_start_state_name(WarmStartState::COMPLETED)); + + m_reg.fetch_registration_info(); + response = m_reg.check_unfrozen(); + EXPECT_EQ(response.status, Registration::Status::IN_PROCESS); + EXPECT_EQ(2, get_state_set_size(WarmBootStage::STAGE_UNFREEZE)); + EXPECT_THAT(m_reg.join_pending_apps(WarmBootStage::STAGE_UNFREEZE), + AllOf(HasSubstr("app1"), HasSubstr("app2"))); + + // app1 reaches the correct state. + TestUtils::populate_restart_table_state( + m_db, "app1", get_warm_start_state_name(WarmStartState::COMPLETED)); + + response = m_reg.check_unfrozen(); + EXPECT_EQ(response.status, Registration::Status::IN_PROCESS); + EXPECT_EQ(1, get_state_set_size(WarmBootStage::STAGE_UNFREEZE)); + EXPECT_THAT(m_reg.join_pending_apps(WarmBootStage::STAGE_UNFREEZE), + HasSubstr("app2")); + + // app 2 reaches the correct state. We do not monitor app 3. + TestUtils::populate_restart_table_state( + m_db, "app2", get_warm_start_state_name(WarmStartState::COMPLETED)); + + response = m_reg.check_unfrozen(); + EXPECT_EQ(response.status, Registration::Status::COMPLETED); + EXPECT_EQ(0, get_state_set_size(WarmBootStage::STAGE_UNFREEZE)); + EXPECT_THAT(m_reg.join_pending_apps(WarmBootStage::STAGE_UNFREEZE), + StrEq("")); + + // app1 reports an error. + m_reg.fetch_registration_info(); + TestUtils::populate_restart_table_state( + m_db, "app1", get_warm_start_state_name(WarmStartState::FAILED)); + + response = m_reg.check_unfrozen(); + EXPECT_EQ(response.status, Registration::Status::FAILURE); + EXPECT_FALSE(response.error_string.empty()); + EXPECT_THAT(m_reg.join_pending_apps(WarmBootStage::STAGE_UNFREEZE), + AllOf(HasSubstr("app1"))); +} + +class RedisTestWithWarmStartState + : public RedisTest, + public ::testing::WithParamInterface {}; + +TEST_P(RedisTestWithWarmStartState, TestEventHandling) { + // Apps registered. No app has reported state. + const std::vector test_keys( + {"docker1|app1", "docker2|app2", "docker3|app3"}); + for (const auto &key : test_keys) { + TestUtils::populate_registration_table( + m_db, key, false, + GetParam() == WarmBootStage::STAGE_FREEZE || + GetParam() == WarmBootStage::STAGE_UNFREEZE, + GetParam() == WarmBootStage::STAGE_CHECKPOINT, + GetParam() == WarmBootStage::STAGE_RECONCILIATION); + } + TestUtils::populate_registration_table(m_db, "docker4|app4", true, false, + false, false); + m_reg.fetch_registration_info(); + + // Ignore invalid operation + swss::KeyOpFieldsValuesTuple state_event = {"app1", "DEL", {{"state", ""}}}; + Registration::Response response = + m_reg.handle_state_event(GetParam(), state_event); + EXPECT_EQ(response.status, Registration::Status::IN_PROCESS); + EXPECT_EQ(3, get_state_set_size(GetParam())); + + // app1 reaches its final state, but the others have not reported state. + state_event = {"app1", "SET", {{"state", warm_boot_stage_name(GetParam())}}}; + response = m_reg.handle_state_event(GetParam(), state_event); + EXPECT_EQ(response.status, Registration::Status::IN_PROCESS); + EXPECT_EQ(2, get_state_set_size(GetParam())); + + // All apps report final state one-by-one. + for (size_t i = 1; i < test_keys.size(); i++) { + std::string docker, app; + bool ret = get_docker_app_from_key(test_keys[i], "|", docker, app); + EXPECT_TRUE(ret); + + state_event = {app, "SET", {{"state", warm_boot_stage_name(GetParam())}}}; + response = m_reg.handle_state_event(GetParam(), state_event); + + if (i < test_keys.size() - 1) { + EXPECT_EQ(response.status, Registration::Status::IN_PROCESS); + } else { + EXPECT_EQ(response.status, Registration::Status::COMPLETED); + } + EXPECT_EQ(get_state_set_size(GetParam()), test_keys.size() - (i + 1)); + } + + // app3 reports an error. + m_reg.fetch_registration_info(); + state_event = {"app3", "SET", {{"state", "failed"}}}; + + response = m_reg.handle_state_event(GetParam(), state_event); + EXPECT_EQ(response.status, Registration::Status::FAILURE); + EXPECT_FALSE(response.error_string.empty()); +} + +TEST_P(RedisTestWithWarmStartState, HandleEventSkipInvalidKey) { + TestUtils::populate_registration_table( + m_db, "docker1|app1", false, + GetParam() == WarmBootStage::STAGE_FREEZE || + GetParam() == WarmBootStage::STAGE_UNFREEZE, + GetParam() == WarmBootStage::STAGE_CHECKPOINT, + GetParam() == WarmBootStage::STAGE_RECONCILIATION); + m_reg.fetch_registration_info(); + + swss::KeyOpFieldsValuesTuple state_event = { + "invalid", "SET", {{"state", "completed"}}}; + + Registration::Response response = + m_reg.handle_state_event(GetParam(), state_event); + EXPECT_EQ(response.status, Registration::Status::IN_PROCESS); + EXPECT_EQ(get_state_set_size(GetParam()), 1); +} + +INSTANTIATE_TEST_SUITE_P(TestOverWarmStateStates, RedisTestWithWarmStartState, + testing::Values(WarmBootStage::STAGE_FREEZE, + WarmBootStage::STAGE_CHECKPOINT, + WarmBootStage::STAGE_RECONCILIATION, + WarmBootStage::STAGE_UNFREEZE)); + +TEST_F(RedisTest, TestHandleQuiescenceEvent) { + TestUtils::populate_registration_table(m_db, "docker1|app1", false, true, + false, false); + m_reg.fetch_registration_info(); + + swss::KeyOpFieldsValuesTuple state_event = { + "app1", "DEL", {{"state", "checkpointed"}}}; + Registration::Response response = + m_reg.handle_state_event(WarmBootStage::STAGE_FREEZE, state_event); + EXPECT_EQ(response.status, Registration::Status::IN_PROCESS); + + state_event = {"app1", "SET", {{"state", "checkpointed"}}}; + response = m_reg.handle_state_event(WarmBootStage::STAGE_FREEZE, state_event); + EXPECT_EQ(response.status, Registration::Status::COMPLETED); + + state_event = {"app1", "DEL", {{"state", "completed"}}}; + response = m_reg.handle_state_event(WarmBootStage::STAGE_FREEZE, state_event); + EXPECT_EQ(response.status, Registration::Status::COMPLETED); + + state_event = {"app1", "SET", {{"state", "failed"}}}; + response = m_reg.handle_state_event(WarmBootStage::STAGE_FREEZE, state_event); + EXPECT_EQ(response.status, Registration::Status::FAILURE); +} + +TEST_F(RedisTest, TestHandleQuiescenceEnterExitCompleteState) { + TestUtils::populate_registration_table(m_db, "docker1|app1", false, true, + false, false); + TestUtils::populate_registration_table(m_db, "docker2|app2", false, true, + false, false); + m_reg.fetch_registration_info(); + + swss::KeyOpFieldsValuesTuple state_event = { + "app1", "SET", {{"state", "quiescent"}}}; + Registration::Response response = + m_reg.handle_state_event(WarmBootStage::STAGE_FREEZE, state_event); + EXPECT_EQ(response.status, Registration::Status::IN_PROCESS); + + state_event = {"app2", "SET", {{"state", "checkpointed"}}}; + response = m_reg.handle_state_event(WarmBootStage::STAGE_FREEZE, state_event); + EXPECT_EQ(response.status, Registration::Status::COMPLETED); + + state_event = {"app1", "SET", {{"state", "replayed"}}}; + response = m_reg.handle_state_event(WarmBootStage::STAGE_FREEZE, state_event); + EXPECT_EQ(response.status, Registration::Status::IN_PROCESS); + + state_event = {"app1", "SET", {{"state", "quiescent"}}}; + response = m_reg.handle_state_event(WarmBootStage::STAGE_FREEZE, state_event); + EXPECT_EQ(response.status, Registration::Status::COMPLETED); + + state_event = {"app2", "SET", {{"state", "restored"}}}; + response = m_reg.handle_state_event(WarmBootStage::STAGE_FREEZE, state_event); + EXPECT_EQ(response.status, Registration::Status::IN_PROCESS); + + state_event = {"app2", "SET", {{"state", "checkpointed"}}}; + response = m_reg.handle_state_event(WarmBootStage::STAGE_FREEZE, state_event); + EXPECT_EQ(response.status, Registration::Status::COMPLETED); +} + +TEST_F(RedisTest, TestClearContents) { + TestUtils::populate_registration_table(m_db, "docker1|app1", true, false, + false, true); + TestUtils::populate_registration_table(m_db, "docker2|app2", true, false, + false, false); + TestUtils::populate_registration_table(m_db, "docker3|app3", false, true, + true, false); + m_reg.fetch_registration_info(); + Registration::RegistrationSet set = m_reg.get_stop_on_freeze_set(); + EXPECT_EQ(2, set.size()); + EXPECT_EQ(1, get_state_set_size(WarmBootStage::STAGE_FREEZE)); + EXPECT_EQ(1, get_state_set_size(WarmBootStage::STAGE_CHECKPOINT)); + EXPECT_EQ(1, get_state_set_size(WarmBootStage::STAGE_RECONCILIATION)); + EXPECT_EQ(1, get_state_set_size(WarmBootStage::STAGE_UNFREEZE)); + + clear_contents(); + + set = m_reg.get_stop_on_freeze_set(); + EXPECT_TRUE(set.empty()); + + set = m_reg.get_registered_app_set(); + EXPECT_TRUE(set.empty()); + + EXPECT_EQ(0, get_state_set_size(WarmBootStage::STAGE_FREEZE)); + EXPECT_EQ(0, get_state_set_size(WarmBootStage::STAGE_CHECKPOINT)); + EXPECT_EQ(0, get_state_set_size(WarmBootStage::STAGE_RECONCILIATION)); + EXPECT_EQ(0, get_state_set_size(WarmBootStage::STAGE_UNFREEZE)); +} + +TEST_F(RedisTest, TestClearAllInitApps) { + const std::vector kTestKeys( + {"docker1|app1", "docker2|app2", "docker3|app3", "docker4|app1"}); + for (const auto &key : kTestKeys) { + TestUtils::populate_registration_table(m_db, key, false, false, false, + true); + } + + m_reg.fetch_registration_info(); + m_reg.save_all_init_apps(); + + swss::Table initTable(&m_db, STATE_WARM_RESTART_INIT_TABLE_NAME); + std::string value; + for (const auto &key : kTestKeys) { + EXPECT_TRUE(initTable.hget(key, "timestamp", value)); + } + + m_reg.clear_all_init_apps(); + + for (const auto &key : kTestKeys) { + EXPECT_FALSE(initTable.hget(key, "timestamp", value)); + } +} + +TEST_F(RedisTest, TestSaveInitApps) { + const std::vector kTestKeys( + {"docker1|app1", "docker2|app2", "docker3|app3", "docker4|app1"}); + for (const auto &key : kTestKeys) { + TestUtils::populate_registration_table(m_db, key, false, false, false, + true); + } + // The invalid entry should not end up in the table. + TestUtils::populate_registration_table(m_db, "invalid", false, false, false, + true); + + m_reg.fetch_registration_info(); + m_reg.save_all_init_apps(); + + swss::Table initTable(&m_db, STATE_WARM_RESTART_INIT_TABLE_NAME); + std::string value; + + for (const auto &key : kTestKeys) { + EXPECT_TRUE(initTable.hget(key, "timestamp", value)); + } +} + +TEST_F(RedisTest, TestInitTargetApps) { + // Contains 4 valid apps and 1 invalid app. + populate_default_init_table(); + + m_init_reg.fetch_init_app_info(); + + EXPECT_EQ(get_reregistration_set_size(), 4); +} + +TEST_F(RedisTest, TestCheckReregistration) { + populate_default_init_table(); + + // Before reading the init table, we do not know apps need to re-register. + EXPECT_EQ(m_init_reg.check_reregistration_status(), + InitRegistration::Status::COMPLETED); + EXPECT_EQ(get_reregistration_set_size(), 0); + EXPECT_THAT(m_init_reg.join_pending_apps(), StrEq("")); + + // No apps have re-registered. All valid apps are still pending. + m_init_reg.fetch_init_app_info(); + + EXPECT_EQ(m_init_reg.check_reregistration_status(), + InitRegistration::Status::IN_PROGRESS); + EXPECT_EQ(get_reregistration_set_size(), 4); + EXPECT_THAT(m_init_reg.join_pending_apps(), + AllOf(HasSubstr("docker1|app1"), HasSubstr("docker2|app2"), + HasSubstr("docker3|app3"), HasSubstr("docker4|app1"))); + + // app1 re-registers. Other apps remain outstanding. + TestUtils::populate_registration_table(m_db, "docker1|app1", true, false, + false, true); + + EXPECT_EQ(m_init_reg.check_reregistration_status(), + InitRegistration::Status::IN_PROGRESS); + EXPECT_EQ(get_reregistration_set_size(), 3); + EXPECT_THAT(m_init_reg.join_pending_apps(), + AllOf(HasSubstr("docker2|app2"), HasSubstr("docker3|app3"), + HasSubstr("docker4|app1"))); + + // Other outstanding apps re-register + TestUtils::populate_registration_table(m_db, "docker2|app2", true, false, + false, true); + TestUtils::populate_registration_table(m_db, "docker3|app3", true, false, + false, true); + TestUtils::populate_registration_table(m_db, "docker4|app1", true, false, + false, true); + + EXPECT_EQ(m_init_reg.check_reregistration_status(), + InitRegistration::Status::COMPLETED); + EXPECT_EQ(get_reregistration_set_size(), 0); + EXPECT_THAT(m_init_reg.join_pending_apps(), StrEq("")); +} + +TEST_F(RedisTest, TestHandleRegistrationEvent) { + populate_default_init_table(); + + // No apps have re-registered. All valid apps are still pending. + m_init_reg.fetch_init_app_info(); + + EXPECT_EQ(m_init_reg.check_reregistration_status(), + InitRegistration::Status::IN_PROGRESS); + EXPECT_EQ(get_reregistration_set_size(), 4); + + // Trigger re-registration events for apps one-by-one. + const std::vector event_keys( + {"docker1|app1", "docker2|app2", "docker3|app3", "docker4|app1"}); + for (size_t i = 0; i < event_keys.size(); i++) { + const swss::KeyOpFieldsValuesTuple event = { + event_keys[i], "HSET", {{"timestamp", ""}}}; + + m_init_reg.handle_registration_event(event); + + if (i < event_keys.size() - 1) { + EXPECT_EQ(m_init_reg.check_reregistration_status(), + InitRegistration::Status::IN_PROGRESS); + } else { + EXPECT_EQ(m_init_reg.check_reregistration_status(), + InitRegistration::Status::COMPLETED); + } + EXPECT_EQ(get_reregistration_set_size(), event_keys.size() - (i + 1)); + } +} + +} // namespace rebootbackend diff --git a/src/sonic-framework/tests/telemetry_helper_test.cpp b/src/sonic-framework/tests/telemetry_helper_test.cpp new file mode 100644 index 000000000000..d4b14077d136 --- /dev/null +++ b/src/sonic-framework/tests/telemetry_helper_test.cpp @@ -0,0 +1,394 @@ +#include "telemetry_helper.h" + +#include +#include + +#include +#include +#include + +#include "init_thread.h" +#include "reboot_interfaces.h" +#include "redis_utils.h" +#include "table.h" +#include "test_utils_common.h" +#include "warm_restart.h" + +namespace rebootbackend { + +using swss::WarmStart; +using ::testing::_; +using ::testing::Contains; +using ::testing::ExplainMatchResult; +using ::testing::IsEmpty; +using ::testing::StrEq; + +// A fake app class that has methods to trigger telemetry writes. Used to +// abstract some test logic out of the tests themselves. +class FakeApp { + public: + FakeApp(const std::string &app_name) : m_app_name(app_name) {} + + void record_start(WarmStart::WarmBootStage nsf_stage) const { + swss::WarmStart::updateAppWarmBootStageStart(nsf_stage, m_app_name); + } + + // There are two different API calls in warm_restart.cpp to report final + // status. + void record_end(WarmStart::WarmBootStage nsf_stage, bool success) const { + if (success) { + swss::WarmStart::updateAppWarmBootStageEnd(nsf_stage_to_state(nsf_stage), + m_app_name); + } else { + swss::WarmStart::updateAppWarmBootStageEndOnFailure(nsf_stage, + m_app_name); + } + } + + const std::string &get_name() const { return m_app_name; } + + private: + static WarmStart::WarmStartState nsf_stage_to_state( + WarmStart::WarmBootStage nsf_stage) { + switch (nsf_stage) { + case WarmStart::WarmBootStage::STAGE_FREEZE: { + return WarmStart::WarmStartState::QUIESCENT; + } + case WarmStart::WarmBootStage::STAGE_CHECKPOINT: { + return WarmStart::WarmStartState::CHECKPOINTED; + } + case WarmStart::WarmBootStage::STAGE_RECONCILIATION: { + return WarmStart::WarmStartState::RECONCILED; + } + case WarmStart::WarmBootStage::STAGE_UNFREEZE: { + return WarmStart::WarmStartState::COMPLETED; + } + default: { + return WarmStart::WarmStartState::COMPLETED; + } + } + } + + std::string m_app_name; +}; + +class TelemetryHelperTest : public ::testing::Test { + public: + TelemetryHelperTest() + : m_db("STATE_DB", 0), + m_separator(swss::TableBase::getTableSeparator(m_db.getDbId())), + m_telemetry_helper() { + swss::WarmStart::initialize("fake_app", "fake_docker"); + TestUtils::clear_tables(m_db); + + for (const auto &app : kFakeApps) { + TestUtils::populate_registration_table( + m_db, concat_key("docker1", app.get_name()), false, true, true, true); + } + } + + // Checks for DB entries in the form: + // WARM_RESTART_PERFORMANCE_TABLE|system + // WARM_RESTART_PERFORMANCE_HISTORY||system + void check_overall_entries(int count, const std::string &expected_status) { + check_overall_entries(count, expected_status, + default_fields_for_status(expected_status)); + } + + void check_overall_entries( + int count, const std::string &expected_status, + const std::unordered_set &expected_fields) { + check_table_entries(STATE_WARM_RESTART_PERF_TABLE_NAME, "system", + expected_status, expected_fields); + check_table_entries(STATE_WARM_RESTART_PERF_HISTORY_TABLE_NAME, + concat_key(std::to_string(count), "system"), + expected_status, expected_fields); + } + + // Checks for DB entries in the form: + // WARM_RESTART_PERFORMANCE_TABLE| + // WARM_RESTART_PERFORMANCE_TABLE|| + // WARM_RESTART_PERFORMANCE_HISTORY|| + // WARM_RESTART_PERFORMANCE_HISTORY||| + void check_stage_start_entries(int count, + WarmStart::WarmBootStage nsf_stage) { + fully_parameterized_stage_entries(count, nsf_stage, {}, "in-progress", "", + default_fields_for_status("in-progress")); + } + + void check_stage_end_entries(int count, WarmStart::WarmBootStage nsf_stage, + bool success) { + std::string expected_status = get_end_status_string(success); + fully_parameterized_stage_entries( + count, nsf_stage, kFakeApps, expected_status, + get_app_end_status_string(nsf_stage, success), + default_fields_for_status(expected_status)); + } + + void fully_parameterized_stage_entries( + int count, WarmStart::WarmBootStage nsf_stage, + const std::vector apps, const std::string &expected_status, + const std::string &expected_app_status, + const std::unordered_set &expected_fields) { + std::string stage_name = + swss::WarmStart::warmBootStageToNameMap()->at(nsf_stage); + check_table_entries(STATE_WARM_RESTART_PERF_TABLE_NAME, stage_name, + expected_status, expected_fields); + check_table_entries(STATE_WARM_RESTART_PERF_HISTORY_TABLE_NAME, + concat_key(std::to_string(count), stage_name), + expected_status, expected_fields); + + for (const auto &app : apps) { + std::string key_to_check = concat_key(stage_name, app.get_name()); + check_table_entries(STATE_WARM_RESTART_PERF_TABLE_NAME, key_to_check, + expected_app_status, expected_fields); + check_table_entries(STATE_WARM_RESTART_PERF_HISTORY_TABLE_NAME, + concat_key(std::to_string(count), key_to_check), + expected_app_status, expected_fields); + } + } + + // A filled out swss::FieldValueTuple with the specified values. + std::vector default_fvs( + const std::string &status, const std::string &start_timestamp, + const std::string &end_timestamp) { + std::vector field_values( + {{swss::WarmStart::kPerfTableStatusAttr, status}, + {swss::WarmStart::kPerfTableStartTimeAttr, start_timestamp}}); + if (!end_timestamp.empty()) { + field_values.push_back( + {swss::WarmStart::kPerfTableFinishTimeAttr, end_timestamp}); + } + return field_values; + } + + std::string get_end_status_string(bool success) { + return success ? "success" : "failure"; + } + + std::string get_app_end_status_string(WarmStart::WarmBootStage nsf_stage, + bool success) { + if (nsf_stage == WarmStart::WarmBootStage::STAGE_FREEZE) { + return success ? "quiescent" : "failure"; + } + return success ? "success" : "failure"; + } + + private: + // Not to be used directly. + void check_table_entries( + const std::string &table_name, const std::string &key, + const std::string &expected_status, + const std::unordered_set &expected_fields) { + // Check that we have the key. + swss::Table table(&m_db, table_name); + std::vector keys; + table.getKeys(keys); + EXPECT_THAT(keys, Contains(key)) + << "Table: " << table_name << " did not contain key: " << key; + + // Check that we have the right fields for those keys. + std::vector field_values; + bool result = table.get(key, field_values); + EXPECT_TRUE(result); + + std::unordered_set remaining_expected_fields(expected_fields); + for (const auto &field_value : field_values) { + remaining_expected_fields.erase(fvField(field_value)); + } + std::ostringstream stream; + std::copy(expected_fields.begin(), expected_fields.end(), + std::ostream_iterator(stream, ", ")); + EXPECT_THAT(remaining_expected_fields, IsEmpty()) + << "Table: " << table_name << " had incorrect fields for key: " << key + << ". Expected fields: " << stream.str(); + + // Check that the value of "status" is correct. + std::string actual_status; + result = + table.hget(key, swss::WarmStart::kPerfTableStatusAttr, actual_status); + EXPECT_THAT(actual_status, StrEq(expected_status)) + << "Table: " << table_name << " had incorrect status for key: " << key; + } + + std::string concat_key(const std::string &str1, const std::string &str2) { + return str1 + m_separator + str2; + } + + const std::unordered_set &default_fields_for_status( + std::string status) { + return status == "in-progress" ? kStartFields : kEndFields; + } + + protected: + const std::unordered_set kStartFields = { + swss::WarmStart::kPerfTableStatusAttr, + swss::WarmStart::kPerfTableStartTimeAttr}; + const std::unordered_set kEndFields = { + swss::WarmStart::kPerfTableStatusAttr, + swss::WarmStart::kPerfTableStartTimeAttr, + swss::WarmStart::kPerfTableFinishTimeAttr}; + const std::unordered_set kEndWithoutStartFields = { + swss::WarmStart::kPerfTableStatusAttr, + swss::WarmStart::kPerfTableFinishTimeAttr}; + const std::vector kStagesInOrder = { + WarmStart::WarmBootStage::STAGE_FREEZE, + WarmStart::WarmBootStage::STAGE_CHECKPOINT, + WarmStart::WarmBootStage::STAGE_RECONCILIATION, + WarmStart::WarmBootStage::STAGE_UNFREEZE}; + const std::vector kFakeApps = {FakeApp("app1"), FakeApp("app2"), + FakeApp("app3")}; + + swss::DBConnector m_db; + std::string m_separator; + TelemetryHelper m_telemetry_helper; +}; + +class TelemetryHelperWithResultTest + : public TelemetryHelperTest, + public ::testing::WithParamInterface {}; + +TEST_F(TelemetryHelperTest, OverallStartInitializesCounter) { + for (int i = 1; i < 6; i++) { + m_telemetry_helper.record_overall_start(); + + EXPECT_THAT(get_warm_restart_counter(m_db), StrEq(std::to_string(i))); + check_overall_entries(i, "in-progress"); + } +} + +TEST_F(TelemetryHelperTest, OverallStartIgnoresFakeCounter) { + swss::Table table(&m_db, "BOOT_INFO"); + table.hset("system", "warmboot-count", "fake_counter"); + + m_telemetry_helper.record_overall_start(); + + EXPECT_THAT(get_warm_restart_counter(m_db), StrEq("1")); + check_overall_entries(1, "in-progress"); +} + +TEST_F(TelemetryHelperTest, OverallStartClearsPerf) { + swss::Table table(&m_db, STATE_WARM_RESTART_PERF_TABLE_NAME); + table.set("system", + default_fvs("fake_status", "fake_timestamp", "fake_timestamp2")); + table.set("freeze|fake_app", + default_fvs("fake_status", "fake_timestamp", "fake_timestamp2")); + + m_telemetry_helper.record_overall_start(); + + EXPECT_THAT(get_warm_restart_counter(m_db), StrEq("1")); + check_overall_entries(1, "in-progress"); + + std::vector unused; + EXPECT_FALSE(table.get("freeze|fake_app", unused)); +} + +TEST_P(TelemetryHelperWithResultTest, OverallEndWithoutStart) { + m_telemetry_helper.record_overall_end(GetParam()); + + check_overall_entries(0, get_end_status_string(GetParam()), + kEndWithoutStartFields); +} + +TEST_P(TelemetryHelperWithResultTest, OverallEndWorks) { + m_telemetry_helper.record_overall_start(); + + m_telemetry_helper.record_overall_end(GetParam()); + + check_overall_entries(1, get_end_status_string(GetParam())); +} + +TEST_F(TelemetryHelperTest, StageStartWithoutStart) { + for (const auto &nsf_stage : kStagesInOrder) { + m_telemetry_helper.record_stage_start(nsf_stage); + for (const auto &app : kFakeApps) { + app.record_start(nsf_stage); + } + check_stage_start_entries(0, nsf_stage); + } +} + +TEST_F(TelemetryHelperTest, StageStartWorks) { + m_telemetry_helper.record_overall_start(); + + for (const auto &nsf_stage : kStagesInOrder) { + m_telemetry_helper.record_stage_start(nsf_stage); + for (const auto &app : kFakeApps) { + app.record_start(nsf_stage); + } + check_stage_start_entries(1, nsf_stage); + } +} + +TEST_P(TelemetryHelperWithResultTest, StageEndWithoutStart) { + for (const auto &nsf_stage : kStagesInOrder) { + m_telemetry_helper.record_stage_start(nsf_stage); + for (const auto &app : kFakeApps) { + app.record_start(nsf_stage); + app.record_end(nsf_stage, GetParam()); + } + m_telemetry_helper.record_stage_end(nsf_stage, GetParam()); + check_stage_end_entries(0, nsf_stage, GetParam()); + } +} + +TEST_P(TelemetryHelperWithResultTest, StageEndWithoutStageStart) { + m_telemetry_helper.record_overall_start(); + + std::string expected_status = get_end_status_string(GetParam()); + + for (const auto &nsf_stage : kStagesInOrder) { + for (const auto &app : kFakeApps) { + app.record_start(nsf_stage); + app.record_end(nsf_stage, GetParam()); + } + m_telemetry_helper.record_stage_end(nsf_stage, GetParam()); + + std::string expected_app_status = + get_app_end_status_string(nsf_stage, GetParam()); + fully_parameterized_stage_entries(1, nsf_stage, kFakeApps, expected_status, + expected_app_status, + kEndWithoutStartFields); + } +} + +TEST_P(TelemetryHelperWithResultTest, StageEndWorks) { + m_telemetry_helper.record_overall_start(); + + for (const auto &nsf_stage : kStagesInOrder) { + m_telemetry_helper.record_stage_start(nsf_stage); + for (const auto &app : kFakeApps) { + app.record_start(nsf_stage); + app.record_end(nsf_stage, GetParam()); + } + m_telemetry_helper.record_stage_end(nsf_stage, GetParam()); + check_stage_end_entries(1, nsf_stage, GetParam()); + } +} + +TEST_P(TelemetryHelperWithResultTest, EndToEndWorks) { + m_telemetry_helper.record_overall_start(); + check_overall_entries(1, "in-progress"); + + for (const auto &nsf_stage : kStagesInOrder) { + m_telemetry_helper.record_stage_start(nsf_stage); + for (const auto &app : kFakeApps) { + app.record_start(nsf_stage); + } + check_stage_start_entries(1, nsf_stage); + + for (const auto &app : kFakeApps) { + app.record_end(nsf_stage, GetParam()); + } + m_telemetry_helper.record_stage_end(nsf_stage, GetParam()); + check_stage_end_entries(1, nsf_stage, GetParam()); + } + + m_telemetry_helper.record_overall_end(GetParam()); + check_overall_entries(1, get_end_status_string(GetParam())); +} + +INSTANTIATE_TEST_SUITE_P(TestWithResultSuite, TelemetryHelperWithResultTest, + testing::Values(true, false)); + +} // namespace rebootbackend diff --git a/src/sonic-framework/tests/test_main.cpp b/src/sonic-framework/tests/test_main.cpp new file mode 100644 index 000000000000..693d88f181ed --- /dev/null +++ b/src/sonic-framework/tests/test_main.cpp @@ -0,0 +1,7 @@ + +#include "gtest/gtest.h" + +int main(int argc, char* argv[]) { + testing::InitGoogleTest(&argc, argv); + return RUN_ALL_TESTS(); +} \ No newline at end of file diff --git a/src/sonic-framework/tests/test_utils_common.cpp b/src/sonic-framework/tests/test_utils_common.cpp new file mode 100644 index 000000000000..6b5448c41395 --- /dev/null +++ b/src/sonic-framework/tests/test_utils_common.cpp @@ -0,0 +1,143 @@ +#include "test_utils_common.h" + +#include +#include + +#include +#include + +#include "dbconnector.h" +#include "notificationconsumer.h" +#include "redis_utils.h" +#include "select.h" +#include "selectableevent.h" +#include "stateverification.h" +#include "table.h" +#include "timestamp.h" +#include "warm_restart.h" + +namespace rebootbackend { + +void TestUtils::wait_for_finish(swss::Select &s, + swss::SelectableEvent &finished, + uint32_t timeout_seconds) { + swss::Selectable *sel; + int ret; + + ret = s.select(&sel, timeout_seconds * 1000); + EXPECT_EQ(ret, swss::Select::OBJECT); + EXPECT_EQ(sel, &finished); +} + +std::string TestUtils::wait_for_state_verification_trigger( + swss::NotificationConsumer &nc, uint32_t timeout_seconds, bool freeze) { + swss::Select s; + s.addSelectable(&nc); + + swss::Selectable *sel; + int ret; + ret = s.select(&sel, timeout_seconds * 1000); + EXPECT_EQ(ret, swss::Select::OBJECT); + if (ret != swss::Select::OBJECT) { + return ""; + } + + std::string op, timestamp_data; + std::vector values; + nc.pop(op, timestamp_data, values); + auto fv = values[0]; + EXPECT_EQ(op, ALL_COMPONENT); + EXPECT_EQ(fvField(fv), FREEZE_FIELD); + EXPECT_EQ(fvValue(fv), freeze ? "true" : "false"); + return timestamp_data; +} + +void TestUtils::confirm_no_state_verification_trigger( + swss::NotificationConsumer &nc, uint32_t timeout_seconds) { + swss::Select s; + s.addSelectable(&nc); + + swss::Selectable *sel; + int ret; + ret = s.select(&sel, timeout_seconds * 1000); + EXPECT_NE(ret, swss::Select::OBJECT); +} + +void TestUtils::populate_registration_table( + swss::DBConnector &db, const std::string &key, const bool &stop_on_freeze, + const bool &freeze, const bool &checkpoint, const bool &reconciliation) { + swss::Table registrationTable(&db, + STATE_WARM_RESTART_REGISTRATION_TABLE_NAME); + + std::string tableName = key; + std::vector values; + + values.push_back(swss::FieldValueTuple("stop_on_freeze", + stop_on_freeze ? "true" : "false")); + values.push_back(swss::FieldValueTuple("freeze", freeze ? "true" : "false")); + values.push_back( + swss::FieldValueTuple("checkpoint", checkpoint ? "true" : "false")); + values.push_back(swss::FieldValueTuple("reconciliation", + reconciliation ? "true" : "false")); + values.push_back(swss::FieldValueTuple("timestamp", swss::getTimestamp())); + + registrationTable.set(tableName, values); +} + +void TestUtils::populate_restart_table_state(swss::DBConnector &db, + const std::string &app_name, + const std::string &state) { + swss::Table warmRestartTable(&db, STATE_WARM_RESTART_TABLE_NAME); + warmRestartTable.hset(app_name, "state", state); +} + +void TestUtils::write_state_verification_result(swss::DBConnector &db, + const std::string &key, + const std::string &status, + const std::string ×tamp) { + swss::Table state_verification_table(&db, STATE_VERIFICATION_RESP_TABLE); + std::vector fvs; + fvs.push_back(swss::FieldValueTuple(TIMESTAMP_FIELD, timestamp)); + fvs.push_back(swss::FieldValueTuple(STATUS_FIELD, status)); + state_verification_table.set(key, fvs); +} + +void TestUtils::clear_tables(swss::DBConnector &db) { + const std::vector kTablesToClear = { + "BOOT_INFO", + STATE_WARM_RESTART_TABLE_NAME, + STATE_WARM_RESTART_REGISTRATION_TABLE_NAME, + STATE_WARM_RESTART_INIT_TABLE_NAME, + STATE_VERIFICATION_RESP_TABLE, + STATE_WARM_RESTART_ENABLE_TABLE_NAME, + STATE_WARM_RESTART_PERF_TABLE_NAME, + STATE_WARM_RESTART_PERF_HISTORY_TABLE_NAME}; + + for (const auto &table_name : kTablesToClear) { + swss::Table table(&db, table_name); + std::vector keys; + table.getKeys(keys); + for (const auto &key : keys) { + table.del(key); + } + } +} + +void TestUtils::check_warmboot_enabled(swss::DBConnector &db, + bool expected_state) { + swss::Table warmRestartTable(&db, STATE_WARM_RESTART_ENABLE_TABLE_NAME); + std::string actual_state; + warmRestartTable.hget("system", "enable", actual_state); + EXPECT_EQ(actual_state, expected_state ? "true" : "false"); +} + +void TestUtils::set_state_verification_enable(swss::DBConnector &config_db, + bool bootup, bool enabled) { + swss::Table warmRestartTable(&config_db, CFG_WARM_RESTART_TABLE_NAME); + warmRestartTable.hset( + "system", + bootup ? "state_verification_bootup" : "state_verification_shutdown", + enabled ? "true" : "false"); +} + +} // namespace rebootbackend diff --git a/src/sonic-framework/tests/test_utils_common.h b/src/sonic-framework/tests/test_utils_common.h new file mode 100644 index 000000000000..150762e50ad4 --- /dev/null +++ b/src/sonic-framework/tests/test_utils_common.h @@ -0,0 +1,48 @@ +#pragma once +#include +#include + +#include +#include + +#include "dbconnector.h" +#include "notificationconsumer.h" +#include "select.h" +#include "selectableevent.h" + +namespace rebootbackend { + +class TestUtils { + public: + static void wait_for_finish(swss::Select &s, swss::SelectableEvent &finished, + uint32_t timeout_seconds); + + static std::string wait_for_state_verification_trigger( + swss::NotificationConsumer &nc, uint32_t timeout_seconds, bool freeze); + + static void confirm_no_state_verification_trigger( + swss::NotificationConsumer &nc, uint32_t timeout_seconds); + + static void populate_registration_table( + swss::DBConnector &db, const std::string &key, const bool &stop_on_freeze, + const bool &freeze, const bool &checkpoint, const bool &reconciliation); + + static void populate_restart_table_state(swss::DBConnector &db, + const std::string &app_name, + const std::string &state); + + static void write_state_verification_result(swss::DBConnector &db, + const std::string &key, + const std::string &status, + const std::string ×tamp); + + static void clear_tables(swss::DBConnector &db); + + static void check_warmboot_enabled(swss::DBConnector &db, + bool expected_state); + + static void set_state_verification_enable(swss::DBConnector &db, bool bootup, + bool enabled); +}; + +} // namespace rebootbackend