diff --git a/capturas/captura.pcap b/capturas/captura.pcap new file mode 100644 index 0000000000000000000000000000000000000000..7716f20406cc680e08307c945c5618814572ce80 Binary files /dev/null and b/capturas/captura.pcap differ diff --git a/capturas/command.txt b/capturas/command.txt new file mode 100644 index 0000000000000000000000000000000000000000..452f545dd87a96710a6aa8fc0d15fb5270610857 --- /dev/null +++ b/capturas/command.txt @@ -0,0 +1 @@ +sudo tcpdump -i any tcp port 4189 -w pcep_capture.pcap diff --git a/capturas/pcep_capture.pcap b/capturas/pcep_capture.pcap new file mode 100644 index 0000000000000000000000000000000000000000..248dedf15b15265c38f3a2ba13f56e2c15823ec8 Binary files /dev/null and b/capturas/pcep_capture.pcap differ diff --git a/manifests/bgpls_speakerservice.yaml b/manifests/bgpls_speakerservice.yaml index c36577ba3249371bdc3d9d40f35cad5e2521ce35..9259b6a69f91eddfe4ba2fc554bc24c939e38498 100644 --- a/manifests/bgpls_speakerservice.yaml +++ b/manifests/bgpls_speakerservice.yaml @@ -36,7 +36,7 @@ spec: - containerPort: 9192 env: - name: LOG_LEVEL - value: "INFO" + value: "DEBUG" readinessProbe: exec: command: ["/bin/grpc_health_probe", "-addr=:20030"] diff --git a/manifests/netphony-external-service.yaml b/manifests/netphony-external-service.yaml new file mode 100644 index 0000000000000000000000000000000000000000..43356c533843de1fdf329eb95b2559f5e696f796 --- /dev/null +++ b/manifests/netphony-external-service.yaml @@ -0,0 +1,101 @@ +# apiVersion: v1 +# kind: Service +# metadata: +# name: netphony-service +# spec: +# type: LoadBalancer # Cambia a NodePort o ClusterIP según la necesidad +# selector: +# app: netphony +# loadBalancerIP: 10.0.2.150 # Ajusta según la configuración de MetalLB o tu entorno +# ports: +# - name: grpc +# port: 4189 # Puerto externo accesible +# targetPort: 4189 # Puerto donde escucha Netphony-PCE en el pod +# protocol: TCP +# --- +# apiVersion: apps/v1 +# kind: Deployment +# metadata: +# name: netphony-deployment +# spec: +# replicas: 1 +# selector: +# matchLabels: +# app: netphony +# template: +# metadata: +# labels: +# app: netphony +# spec: +# containers: +# - name: netphony +# image: # Reemplaza con la imagen correcta +# ports: +# - containerPort: 4189 +# apiVersion: v1 +# kind: Service +# metadata: +# name: netphony-external-service +# spec: +# type: ClusterIP +# ports: +# - port: 4189 +# targetPort: 4189 +# protocol: TCP +# --- +# apiVersion: v1 +# kind: Endpoints +# metadata: +# name: netphony-external-service +# subsets: +# - addresses: +# - ip: 192.168.1.100 # IP de VM A +# ports: +# - port: 4189 +apiVersion: v1 +kind: Service +metadata: + name: netphony-external-service +spec: + type: ClusterIP + ports: + - name: grpc + protocol: TCP + port: 20050 + targetPort: 20050 + - name: metrics + protocol: TCP + port: 9192 + targetPort: 9192 + - name: pcep + protocol: TCP + port: 4189 + targetPort: 4189 + - name: managm + protocol: TCP + port: 6666 + targetPort: 6666 + - name: grpcnetphony + protocol: TCP + port: 10060 + targetPort: 10060 +--- +apiVersion: v1 +kind: Endpoints +metadata: + name: netphony-external-service +subsets: + - addresses: + - ip: 192.168.159.225 # IP de la VM donde está Netphony + ports: + - name: grpc + port: 20050 + - name: metrics + port: 9192 + - name: pcep + port: 4189 + - name: managm + port: 6666 + - name: grpcnetphony + port: 10060 + diff --git a/manifests/pcepservice.yaml b/manifests/pcepservice.yaml new file mode 100644 index 0000000000000000000000000000000000000000..c296149b98bc07bfb6aac27c1d57c9b0a747ba77 --- /dev/null +++ b/manifests/pcepservice.yaml @@ -0,0 +1,98 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# 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. + +apiVersion: apps/v1 +kind: Deployment +metadata: + name: pcepservice +spec: + selector: + matchLabels: + app: pcepservice + replicas: 1 + template: + metadata: + annotations: + config.linkerd.io/skip-outbound-ports: "4189" + config.linkerd.io/skip-inbound-ports: "4189" + labels: + app: pcepservice + spec: + terminationGracePeriodSeconds: 5 + containers: + - name: server + image: localhost:32000/tfs/pcep:dev + imagePullPolicy: Always + ports: + - containerPort: 20050 + - containerPort: 9192 + - containerPort: 6666 + - containerPort: 4189 + - containerPort: 10060 + env: + - name: LOG_LEVEL + value: "DEBUG" + # - name: CRDB_DATABASE + # value: "tfs_pcep" + envFrom: + - secretRef: + name: crdb-data + readinessProbe: + exec: + command: ["/bin/grpc_health_probe", "-addr=:20050"] + livenessProbe: + exec: + command: ["/bin/grpc_health_probe", "-addr=:20050"] + resources: + requests: + cpu: 50m + memory: 64Mi + limits: + cpu: 500m + memory: 512Mi +--- +apiVersion: v1 +kind: Service +metadata: + name: pcepservice + labels: + app: pcepservice +spec: + type: ClusterIP + # externalTrafficPolicy: Local + selector: + app: pcepservice + # loadBalancerIP: 192.168.159.65 + ports: + - name: grpc + protocol: TCP + port: 20050 + targetPort: 20050 + - name: metrics + protocol: TCP + port: 9192 + targetPort: 9192 + - name: pcep + protocol: TCP + port: 4189 + targetPort: 4189 + - name: managm + protocol: TCP + port: 6666 + targetPort: 6666 + - name: grpcnetphony + protocol: TCP + port: 10060 + targetPort: 10060 + diff --git a/manifests/resource_managerservice.yaml b/manifests/resource_managerservice.yaml new file mode 100644 index 0000000000000000000000000000000000000000..964868c07e8d2336122b75229c9544569a5fb7d9 --- /dev/null +++ b/manifests/resource_managerservice.yaml @@ -0,0 +1,51 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: resource-managerservice +spec: + selector: + matchLabels: + app: resource-managerservice + template: + metadata: + labels: + app: resource-managerservice + spec: + containers: + - name: resource-managerservice + image: localhost:32000/tfs/resource_manager:dev + imagePullPolicy: Always + ports: + - containerPort: 40010 + env: + - name: LOG_LEVEL + value: "DEBUG" + readinessProbe: + exec: + command: ["/bin/grpc_health_probe", "-addr=:40010"] + livenessProbe: + exec: + command: ["/bin/grpc_health_probe", "-addr=:40010"] + resources: + requests: + cpu: 250m + memory: 128Mi + limits: + cpu: 500m + memory: 512Mi + +--- +apiVersion: v1 +kind: Service +metadata: + name: resource-managerservice +spec: + type: NodePort + ports: + - name: grpc + protocol: TCP + port: 40010 + targetPort: 40010 + nodePort: 30010 + selector: + app: resource-managerservice \ No newline at end of file diff --git a/manifests/webuiservice.yaml b/manifests/webuiservice.yaml index 0a6213e992b2961cc8a60a53543a0e4ec4ea5f4c..69fef4c3588737c66e94570c42133b0836ac3461 100644 --- a/manifests/webuiservice.yaml +++ b/manifests/webuiservice.yaml @@ -50,9 +50,21 @@ spec: - containerPort: 8004 env: - name: LOG_LEVEL - value: "INFO" + value: "DEBUG" - name: WEBUISERVICE_SERVICE_BASEURL_HTTP value: "/webui/" + - name: CRDB_NAMESPACE + value: "crdb" + - name: CRDB_SQL_PORT + value: "26257" + - name: CRDB_DATABASE_LSP_MGMT + value: "tfs_lsp_mgmt" + - name: CRDB_USERNAME + value: "tfs" + - name: CRDB_PASSWORD + value: "tfs123" + - name: CRDB_SSLMODE + value: "require" readinessProbe: httpGet: path: /healthz/ready diff --git a/my_deploy.sh b/my_deploy.sh index f4f8d203e718af3655bd27f72edd1b1af629b895..dda4c37a4a3f179abe6001bd2a8c1ee42a900a08 100644 --- a/my_deploy.sh +++ b/my_deploy.sh @@ -32,7 +32,13 @@ export TFS_COMPONENTS="context device pathcomp service slice nbi webui" #export TFS_COMPONENTS="${TFS_COMPONENTS} qos_profile" # Uncomment to activate BGP-LS Speaker -#export TFS_COMPONENTS="${TFS_COMPONENTS} bgpls_speaker" +#export TFS_COMPONENTS="${TFS_COMPONENTS} bgpls_speaker"ç + +# Uncomment to activate Resource Manager +export TFS_COMPONENTS="${TFS_COMPONENTS} resource_manager " + +# Uncomment to activate PCEP +export TFS_COMPONENTS="${TFS_COMPONENTS} pcep" # Uncomment to activate Optical Controller # To manage optical connections, "service" requires "opticalcontroller" to be deployed @@ -134,7 +140,7 @@ export CRDB_PASSWORD="tfs123" export CRDB_DEPLOY_MODE="single" # Disable flag for dropping database, if it exists. -export CRDB_DROP_DATABASE_IF_EXISTS="" +export CRDB_DROP_DATABASE_IF_EXISTS="YES" # Disable flag for re-deploying CockroachDB from scratch. export CRDB_REDEPLOY="" @@ -202,7 +208,7 @@ export QDB_TABLE_MONITORING_KPIS="tfs_monitoring_kpis" export QDB_TABLE_SLICE_GROUPS="tfs_slice_groups" # Disable flag for dropping tables if they exist. -export QDB_DROP_TABLES_IF_EXIST="" +export QDB_DROP_TABLES_IF_EXIST="YES" # Disable flag for re-deploying QuestDB from scratch. export QDB_REDEPLOY="" diff --git a/proto/context.proto b/proto/context.proto index b33750e80b07b0300cf2aa8b526597bfea9a9ee5..9cc75355fe91594acf446aa41a91ca4bcf4beb64 100644 --- a/proto/context.proto +++ b/proto/context.proto @@ -279,6 +279,10 @@ enum LinkTypeEnum { message LinkAttributes { float total_capacity_gbps = 1; float used_capacity_gbps = 2; + float available_bw = 3; + float link_delay = 5; + float min_max_link_delay = 6; + float delay_variation = 7; } message Link { diff --git a/proto/pcep.proto b/proto/pcep.proto new file mode 100644 index 0000000000000000000000000000000000000000..265cf47d0cd135f7ed91e2378b33d13d97577e69 --- /dev/null +++ b/proto/pcep.proto @@ -0,0 +1,94 @@ +// Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +// +// 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 pcep; + +import "context.proto"; + + + +service PcepService { + rpc sendRequest ( RequestRq ) returns ( commandResponse ) {} + rpc configuratePCE ( PceIpRq ) returns ( PceIpRp ) {} + rpc getLSPdb (LSPdb_Request) returns (LSPdb_Response) {} + + rpc SetLsp (LspDescriptor ) returns (LspId ) {} + rpc DeleteLsp (LspId ) returns (context.Empty ) {} + rpc GetLsp (LspId ) returns (LspDescriptor ) {} + + // RPC method for retrieving LSP database + rpc getSessionsInfo(Session_Request) returns (Session_Response); + +} +// Command request from the client +message commandRequest{ + string command = 1; +} + +// Response after a Command Request (If bad request show error log) +message commandResponse{ + bool success = 1; + string error_message = 2; +} + +message RequestRq { + string command = 1; +} + +message RequestRp { + string commandRp = 1; +} + +message PceIpRq { + string address=1; + string port= 2; + string asNumber=3; +} + +message PceIpRp{ + string addressRp=1; +} + + +message LspId { + context.Uuid lsp_uuid = 1; +} + +message LspDescriptor { + LspId lsp_id = 1; // ID del LSP (UUID en formato string) + string srp = 2; // SRP + string lsp = 3; // LSP (almacenado como JSON, en formato string) + string path = 4; // Path (almacenado como JSON, en formato string) + string associationlist = 5; // Lista de asociaciones (almacenada como JSON, en formato string) +} + +// LSP database request from the client +message LSPdb_Request{ +} + +// Response containing LSP database information +message LSPdb_Response{ + string LSPdb_data = 2; +} +// Active PCEP sessions request from the client +message Session_Request{ +} + +// Response containing LSP database information +message Session_Response{ + string Session_data = 2; +} + + diff --git a/proto/resource_manager.proto b/proto/resource_manager.proto new file mode 100644 index 0000000000000000000000000000000000000000..9e859b446358adb0b5e15899b05a4a8268eb5a68 --- /dev/null +++ b/proto/resource_manager.proto @@ -0,0 +1,52 @@ +// Copyright 2022-2024 ETSI OSG/SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/) +// +// 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 resource_manager; + +// Define el servicio +service ResourceManager { + rpc VerifyAndAssignL2 (L2Request) returns (L2Response); + rpc VerifyAndAssignL3 (L3Request) returns (L3Response); +} + +// Define las solicitudes y respuestas para los servicios +message L2Request { + string service_uuid = 1; + string connection_uuid = 2; + string device_uuid = 3; + string endpoint_uuid = 4; + string endpoint_name = 5; + int32 vlan_id = 6; +} + +message L2Response { + bool success = 1; + string message = 2; +} + +message L3Request { + string service_uuid = 1; + string connection_uuid = 2; + string device_uuid = 3; + string endpoint_uuid = 4; + string endpoint_name = 5; + string ip_address = 6; +} + +message L3Response { + bool success = 1; + string message = 2; +} \ No newline at end of file diff --git a/quick_deploy.sh b/quick_deploy.sh new file mode 100755 index 0000000000000000000000000000000000000000..dfcf989da5e896c11bb4885094e8e036005fe5b4 --- /dev/null +++ b/quick_deploy.sh @@ -0,0 +1,438 @@ +#!/bin/bash +# Copyright 2022-2024 ETSI OSG/SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/) +# +# 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. + + +######################################################################################################################## +# Read deployment settings +######################################################################################################################## + + +# ----- TeraFlowSDN ------------------------------------------------------------ + +# If not already set, set the URL of the Docker registry where the images will be uploaded to. +# By default, assume internal MicroK8s registry is used. +export TFS_REGISTRY_IMAGES=${TFS_REGISTRY_IMAGES:-"http://localhost:32000/tfs/"} + +# If not already set, set the list of components, separated by spaces, you want to build images for, and deploy. +# By default, only basic components are deployed +export TFS_COMPONENTS="context device pathcomp service slice nbi webui resource_manager pcep" + +# If not already set, set the tag you want to use for your images. +export TFS_IMAGE_TAG=${TFS_IMAGE_TAG:-"dev"} + +# If not already set, set the name of the Kubernetes namespace to deploy TFS to. +export TFS_K8S_NAMESPACE=${TFS_K8S_NAMESPACE:-"tfs"} + +# If not already set, set additional manifest files to be applied after the deployment +export TFS_EXTRA_MANIFESTS=${TFS_EXTRA_MANIFESTS:-""} + +# If not already set, set the new Grafana admin password +export TFS_GRAFANA_PASSWORD=${TFS_GRAFANA_PASSWORD:-"admin123+"} + +# If not already set, disable skip-build flag to rebuild the Docker images. +# If TFS_SKIP_BUILD is "YES", the containers are not rebuilt-retagged-repushed and existing ones are used. +export TFS_SKIP_BUILD=${TFS_SKIP_BUILD:-"YES"} + +# If TFS_SKIP_BUILD is "YES", select the containers to be build +# Any other container will use previous docker images +export TFS_QUICK_COMPONENTS="webui" + +# ----- CockroachDB ------------------------------------------------------------ + +# If not already set, set the namespace where CockroackDB will be deployed. +export CRDB_NAMESPACE=${CRDB_NAMESPACE:-"crdb"} + +# If not already set, set the database username to be used by Context. +export CRDB_USERNAME=${CRDB_USERNAME:-"tfs"} + +# If not already set, set the database user's password to be used by Context. +export CRDB_PASSWORD=${CRDB_PASSWORD:-"tfs123"} + +# If not already set, set the database name to be used by Context. +export CRDB_DATABASE=${CRDB_DATABASE:-"tfs"} + + +# ----- NATS ------------------------------------------------------------------- + +# If not already set, set the namespace where NATS will be deployed. +export NATS_NAMESPACE=${NATS_NAMESPACE:-"nats"} + + +# ----- QuestDB ---------------------------------------------------------------- + +# If not already set, set the namespace where QuestDB will be deployed. +export QDB_NAMESPACE=${QDB_NAMESPACE:-"qdb"} + +# If not already set, set the database username to be used for QuestDB. +export QDB_USERNAME=${QDB_USERNAME:-"admin"} + +# If not already set, set the database user's password to be used for QuestDB. +export QDB_PASSWORD=${QDB_PASSWORD:-"quest"} + +# If not already set, set the table name to be used by Monitoring for KPIs. +export QDB_TABLE_MONITORING_KPIS=${QDB_TABLE_MONITORING_KPIS:-"tfs_monitoring_kpis"} + +# If not already set, set the table name to be used by Slice for plotting groups. +export QDB_TABLE_SLICE_GROUPS=${QDB_TABLE_SLICE_GROUPS:-"tfs_slice_groups"} + + +######################################################################################################################## +# Automated steps start here +######################################################################################################################## + +# Constants +GITLAB_REPO_URL="labs.etsi.org:5050/tfs/controller" +TMP_FOLDER="./tmp" + +# Create a tmp folder for files modified during the deployment +TMP_MANIFESTS_FOLDER="$TMP_FOLDER/manifests" +mkdir -p $TMP_MANIFESTS_FOLDER +TMP_LOGS_FOLDER="$TMP_FOLDER/logs" +mkdir -p $TMP_LOGS_FOLDER + +echo "Deleting and Creating a new namespace..." +kubectl delete namespace $TFS_K8S_NAMESPACE --ignore-not-found +kubectl create namespace $TFS_K8S_NAMESPACE +printf "\n" + +echo "Create secret with CockroachDB data" +CRDB_SQL_PORT=$(kubectl --namespace ${CRDB_NAMESPACE} get service cockroachdb-public -o 'jsonpath={.spec.ports[?(@.name=="sql")].port}') +kubectl create secret generic crdb-data --namespace ${TFS_K8S_NAMESPACE} --type='Opaque' \ + --from-literal=CRDB_NAMESPACE=${CRDB_NAMESPACE} \ + --from-literal=CRDB_SQL_PORT=${CRDB_SQL_PORT} \ + --from-literal=CRDB_DATABASE=${CRDB_DATABASE} \ + --from-literal=CRDB_USERNAME=${CRDB_USERNAME} \ + --from-literal=CRDB_PASSWORD=${CRDB_PASSWORD} \ + --from-literal=CRDB_SSLMODE=require +printf "\n" + +echo "Create secret with NATS data" +NATS_CLIENT_PORT=$(kubectl --namespace ${NATS_NAMESPACE} get service nats -o 'jsonpath={.spec.ports[?(@.name=="client")].port}') +kubectl create secret generic nats-data --namespace ${TFS_K8S_NAMESPACE} --type='Opaque' \ + --from-literal=NATS_NAMESPACE=${NATS_NAMESPACE} \ + --from-literal=NATS_CLIENT_PORT=${NATS_CLIENT_PORT} +printf "\n" + +echo "Create secret with QuestDB data" +QDB_HTTP_PORT=$(kubectl --namespace ${QDB_NAMESPACE} get service questdb-public -o 'jsonpath={.spec.ports[?(@.name=="http")].port}') +QDB_ILP_PORT=$(kubectl --namespace ${QDB_NAMESPACE} get service questdb-public -o 'jsonpath={.spec.ports[?(@.name=="ilp")].port}') +QDB_SQL_PORT=$(kubectl --namespace ${QDB_NAMESPACE} get service questdb-public -o 'jsonpath={.spec.ports[?(@.name=="sql")].port}') +METRICSDB_HOSTNAME="questdb-public.${QDB_NAMESPACE}.svc.cluster.local" +kubectl create secret generic qdb-data --namespace ${TFS_K8S_NAMESPACE} --type='Opaque' \ + --from-literal=QDB_NAMESPACE=${QDB_NAMESPACE} \ + --from-literal=METRICSDB_HOSTNAME=${METRICSDB_HOSTNAME} \ + --from-literal=METRICSDB_REST_PORT=${QDB_HTTP_PORT} \ + --from-literal=METRICSDB_ILP_PORT=${QDB_ILP_PORT} \ + --from-literal=METRICSDB_SQL_PORT=${QDB_SQL_PORT} \ + --from-literal=METRICSDB_TABLE_MONITORING_KPIS=${QDB_TABLE_MONITORING_KPIS} \ + --from-literal=METRICSDB_TABLE_SLICE_GROUPS=${QDB_TABLE_SLICE_GROUPS} \ + --from-literal=METRICSDB_USERNAME=${QDB_USERNAME} \ + --from-literal=METRICSDB_PASSWORD=${QDB_PASSWORD} +printf "\n" + +echo "Deploying components and collecting environment variables..." +ENV_VARS_SCRIPT=tfs_runtime_env_vars.sh +echo "# Environment variables for TeraFlowSDN deployment" > $ENV_VARS_SCRIPT +PYTHONPATH=$(pwd)/src +echo "export PYTHONPATH=${PYTHONPATH}" >> $ENV_VARS_SCRIPT + +for COMPONENT in $TFS_COMPONENTS; do + echo "Processing '$COMPONENT' component..." + + if [ "$TFS_SKIP_BUILD" != "YES" ]; then + echo " Building Docker image..." + BUILD_LOG="$TMP_LOGS_FOLDER/build_${COMPONENT}.log" + + if [ "$COMPONENT" == "automation" ] || [ "$COMPONENT" == "policy" ]; then + docker build -t "$COMPONENT:$TFS_IMAGE_TAG" -f ./src/"$COMPONENT"/Dockerfile ./src/"$COMPONENT"/ > "$BUILD_LOG" + elif [ "$COMPONENT" == "pathcomp" ]; then + BUILD_LOG="$TMP_LOGS_FOLDER/build_${COMPONENT}-frontend.log" + docker build -t "$COMPONENT-frontend:$TFS_IMAGE_TAG" -f ./src/"$COMPONENT"/frontend/Dockerfile . > "$BUILD_LOG" + + BUILD_LOG="$TMP_LOGS_FOLDER/build_${COMPONENT}-backend.log" + docker build -t "$COMPONENT-backend:$TFS_IMAGE_TAG" -f ./src/"$COMPONENT"/backend/Dockerfile . > "$BUILD_LOG" + # next command is redundant, but helpful to keep cache updated between rebuilds + IMAGE_NAME="$COMPONENT-backend:$TFS_IMAGE_TAG-builder" + docker build -t "$IMAGE_NAME" --target builder -f ./src/"$COMPONENT"/backend/Dockerfile . >> "$BUILD_LOG" + elif [ "$COMPONENT" == "dlt" ]; then + BUILD_LOG="$TMP_LOGS_FOLDER/build_${COMPONENT}-connector.log" + docker build -t "$COMPONENT-connector:$TFS_IMAGE_TAG" -f ./src/"$COMPONENT"/connector/Dockerfile . > "$BUILD_LOG" + + BUILD_LOG="$TMP_LOGS_FOLDER/build_${COMPONENT}-gateway.log" + docker build -t "$COMPONENT-gateway:$TFS_IMAGE_TAG" -f ./src/"$COMPONENT"/gateway/Dockerfile . > "$BUILD_LOG" + else + docker build -t "$COMPONENT:$TFS_IMAGE_TAG" -f ./src/"$COMPONENT"/Dockerfile . > "$BUILD_LOG" + fi + + echo " Pushing Docker image to '$TFS_REGISTRY_IMAGES'..." + + if [ "$COMPONENT" == "pathcomp" ]; then + IMAGE_URL=$(echo "$TFS_REGISTRY_IMAGES/$COMPONENT-frontend:$TFS_IMAGE_TAG" | sed 's,//,/,g' | sed 's,http:/,,g') + + TAG_LOG="$TMP_LOGS_FOLDER/tag_${COMPONENT}-frontend.log" + docker tag "$COMPONENT-frontend:$TFS_IMAGE_TAG" "$IMAGE_URL" > "$TAG_LOG" + + PUSH_LOG="$TMP_LOGS_FOLDER/push_${COMPONENT}-frontend.log" + docker push "$IMAGE_URL" > "$PUSH_LOG" + + IMAGE_URL=$(echo "$TFS_REGISTRY_IMAGES/$COMPONENT-backend:$TFS_IMAGE_TAG" | sed 's,//,/,g' | sed 's,http:/,,g') + + TAG_LOG="$TMP_LOGS_FOLDER/tag_${COMPONENT}-backend.log" + docker tag "$COMPONENT-backend:$TFS_IMAGE_TAG" "$IMAGE_URL" > "$TAG_LOG" + + PUSH_LOG="$TMP_LOGS_FOLDER/push_${COMPONENT}-backend.log" + docker push "$IMAGE_URL" > "$PUSH_LOG" + elif [ "$COMPONENT" == "dlt" ]; then + IMAGE_URL=$(echo "$TFS_REGISTRY_IMAGES/$COMPONENT-connector:$TFS_IMAGE_TAG" | sed 's,//,/,g' | sed 's,http:/,,g') + + TAG_LOG="$TMP_LOGS_FOLDER/tag_${COMPONENT}-connector.log" + docker tag "$COMPONENT-connector:$TFS_IMAGE_TAG" "$IMAGE_URL" > "$TAG_LOG" + + PUSH_LOG="$TMP_LOGS_FOLDER/push_${COMPONENT}-connector.log" + docker push "$IMAGE_URL" > "$PUSH_LOG" + + IMAGE_URL=$(echo "$TFS_REGISTRY_IMAGES/$COMPONENT-gateway:$TFS_IMAGE_TAG" | sed 's,//,/,g' | sed 's,http:/,,g') + + TAG_LOG="$TMP_LOGS_FOLDER/tag_${COMPONENT}-gateway.log" + docker tag "$COMPONENT-gateway:$TFS_IMAGE_TAG" "$IMAGE_URL" > "$TAG_LOG" + + PUSH_LOG="$TMP_LOGS_FOLDER/push_${COMPONENT}-gateway.log" + docker push "$IMAGE_URL" > "$PUSH_LOG" + else + IMAGE_URL=$(echo "$TFS_REGISTRY_IMAGES/$COMPONENT:$TFS_IMAGE_TAG" | sed 's,//,/,g' | sed 's,http:/,,g') + + TAG_LOG="$TMP_LOGS_FOLDER/tag_${COMPONENT}.log" + docker tag "$COMPONENT:$TFS_IMAGE_TAG" "$IMAGE_URL" > "$TAG_LOG" + + PUSH_LOG="$TMP_LOGS_FOLDER/push_${COMPONENT}.log" + docker push "$IMAGE_URL" > "$PUSH_LOG" + fi + else + for QUICK_COMPONENT in $TFS_QUICK_COMPONENTS; do + if [ "$COMPONENT" == "$QUICK_COMPONENT" ]; then + + echo " Building Docker image..." + BUILD_LOG="$TMP_LOGS_FOLDER/build_${QUICK_COMPONENT}.log" + + docker build -t "$QUICK_COMPONENT:$TFS_IMAGE_TAG" -f ./src/"$QUICK_COMPONENT"/Dockerfile . > "$BUILD_LOG" + echo " Pushing Docker image to '$TFS_REGISTRY_IMAGES'..." + + + + IMAGE_URL=$(echo "$TFS_REGISTRY_IMAGES/$QUICK_COMPONENT:$TFS_IMAGE_TAG" | sed 's,//,/,g' | sed 's,http:/,,g') + + TAG_LOG="$TMP_LOGS_FOLDER/tag_${QUICK_COMPONENT}.log" + docker tag "$QUICK_COMPONENT:$TFS_IMAGE_TAG" "$IMAGE_URL" > "$TAG_LOG" + + PUSH_LOG="$TMP_LOGS_FOLDER/push_${QUICK_COMPONENT}.log" + docker push "$IMAGE_URL" > "$PUSH_LOG" + fi + done + fi + + echo " Adapting '$COMPONENT' manifest file..." + MANIFEST="$TMP_MANIFESTS_FOLDER/${COMPONENT}service.yaml" + cp ./manifests/"${COMPONENT}"service.yaml "$MANIFEST" + + if [ "$COMPONENT" == "pathcomp" ]; then + IMAGE_URL=$(echo "$TFS_REGISTRY_IMAGES/$COMPONENT-frontend:$TFS_IMAGE_TAG" | sed 's,//,/,g' | sed 's,http:/,,g') + VERSION=$(grep -i "${GITLAB_REPO_URL}/${COMPONENT}-frontend:" "$MANIFEST" | cut -d ":" -f4) + sed -E -i "s#image: $GITLAB_REPO_URL/$COMPONENT-frontend:${VERSION}#image: $IMAGE_URL#g" "$MANIFEST" + + IMAGE_URL=$(echo "$TFS_REGISTRY_IMAGES/$COMPONENT-backend:$TFS_IMAGE_TAG" | sed 's,//,/,g' | sed 's,http:/,,g') + VERSION=$(grep -i "${GITLAB_REPO_URL}/${COMPONENT}-backend:" "$MANIFEST" | cut -d ":" -f4) + sed -E -i "s#image: $GITLAB_REPO_URL/$COMPONENT-backend:${VERSION}#image: $IMAGE_URL#g" "$MANIFEST" + elif [ "$COMPONENT" == "dlt" ]; then + IMAGE_URL=$(echo "$TFS_REGISTRY_IMAGES/$COMPONENT-connector:$TFS_IMAGE_TAG" | sed 's,//,/,g' | sed 's,http:/,,g') + VERSION=$(grep -i "${GITLAB_REPO_URL}/${COMPONENT}-connector:" "$MANIFEST" | cut -d ":" -f4) + sed -E -i "s#image: $GITLAB_REPO_URL/$COMPONENT-connector:${VERSION}#image: $IMAGE_URL#g" "$MANIFEST" + + IMAGE_URL=$(echo "$TFS_REGISTRY_IMAGES/$COMPONENT-gateway:$TFS_IMAGE_TAG" | sed 's,//,/,g' | sed 's,http:/,,g') + VERSION=$(grep -i "${GITLAB_REPO_URL}/${COMPONENT}-gateway:" "$MANIFEST" | cut -d ":" -f4) + sed -E -i "s#image: $GITLAB_REPO_URL/$COMPONENT-gateway:${VERSION}#image: $IMAGE_URL#g" "$MANIFEST" + else + IMAGE_URL=$(echo "$TFS_REGISTRY_IMAGES/$COMPONENT:$TFS_IMAGE_TAG" | sed 's,//,/,g' | sed 's,http:/,,g') + VERSION=$(grep -i "${GITLAB_REPO_URL}/${COMPONENT}:" "$MANIFEST" | cut -d ":" -f4) + sed -E -i "s#image: $GITLAB_REPO_URL/$COMPONENT:${VERSION}#image: $IMAGE_URL#g" "$MANIFEST" + fi + + sed -E -i "s#imagePullPolicy: .*#imagePullPolicy: Always#g" "$MANIFEST" + + # TODO: harmonize names of the monitoring component + + echo " Deploying '$COMPONENT' component to Kubernetes..." + DEPLOY_LOG="$TMP_LOGS_FOLDER/deploy_${COMPONENT}.log" + kubectl --namespace $TFS_K8S_NAMESPACE apply -f "$MANIFEST" > "$DEPLOY_LOG" + COMPONENT_OBJNAME=$(echo "${COMPONENT}" | sed "s/\_/-/") + #kubectl --namespace $TFS_K8S_NAMESPACE scale deployment --replicas=0 ${COMPONENT_OBJNAME}service >> "$DEPLOY_LOG" + #kubectl --namespace $TFS_K8S_NAMESPACE scale deployment --replicas=1 ${COMPONENT_OBJNAME}service >> "$DEPLOY_LOG" + + echo " Collecting env-vars for '$COMPONENT' component..." + + SERVICE_DATA=$(kubectl get service ${COMPONENT_OBJNAME}service --namespace $TFS_K8S_NAMESPACE -o json) + if [ -z "${SERVICE_DATA}" ]; then continue; fi + + # Env vars for service's host address + SERVICE_HOST=$(echo ${SERVICE_DATA} | jq -r '.spec.clusterIP') + if [ -z "${SERVICE_HOST}" ]; then continue; fi + ENVVAR_HOST=$(echo "${COMPONENT}service_SERVICE_HOST" | tr '[:lower:]' '[:upper:]') + echo "export ${ENVVAR_HOST}=${SERVICE_HOST}" >> $ENV_VARS_SCRIPT + + # Env vars for service's 'grpc' port (if any) + SERVICE_PORT_GRPC=$(echo ${SERVICE_DATA} | jq -r '.spec.ports[] | select(.name=="grpc") | .port') + if [ -n "${SERVICE_PORT_GRPC}" ]; then + ENVVAR_PORT_GRPC=$(echo "${COMPONENT}service_SERVICE_PORT_GRPC" | tr '[:lower:]' '[:upper:]') + echo "export ${ENVVAR_PORT_GRPC}=${SERVICE_PORT_GRPC}" >> $ENV_VARS_SCRIPT + fi + + # Env vars for service's 'http' port (if any) + SERVICE_PORT_HTTP=$(echo ${SERVICE_DATA} | jq -r '.spec.ports[] | select(.name=="http") | .port') + if [ -n "${SERVICE_PORT_HTTP}" ]; then + ENVVAR_PORT_HTTP=$(echo "${COMPONENT}service_SERVICE_PORT_HTTP" | tr '[:lower:]' '[:upper:]') + echo "export ${ENVVAR_PORT_HTTP}=${SERVICE_PORT_HTTP}" >> $ENV_VARS_SCRIPT + fi + + printf "\n" +done + +echo "Deploying extra manifests..." +for EXTRA_MANIFEST in $TFS_EXTRA_MANIFESTS; do + echo "Processing manifest '$EXTRA_MANIFEST'..." + if [[ "$EXTRA_MANIFEST" == *"servicemonitor"* ]]; then + kubectl apply -f $EXTRA_MANIFEST + else + kubectl --namespace $TFS_K8S_NAMESPACE apply -f $EXTRA_MANIFEST + fi + printf "\n" +done +printf "\n" + +for COMPONENT in $TFS_COMPONENTS; do + echo "Waiting for '$COMPONENT' component..." + COMPONENT_OBJNAME=$(echo "${COMPONENT}" | sed "s/\_/-/") + kubectl wait --namespace $TFS_K8S_NAMESPACE \ + --for='condition=available' --timeout=300s deployment/${COMPONENT_OBJNAME}service + printf "\n" +done + +if [[ "$TFS_COMPONENTS" == *"webui"* ]] && [[ "$TFS_COMPONENTS" == *"monitoring"* ]]; then + echo "Configuring WebUI DataStores and Dashboards..." + sleep 5 + + # Exposed through the ingress controller "tfs-ingress" + GRAFANA_URL="127.0.0.1:80/grafana" + + # Default Grafana credentials + GRAFANA_USERNAME="admin" + GRAFANA_PASSWORD="admin" + + # Configure Grafana Admin Password + # Ref: https://grafana.com/docs/grafana/latest/http_api/user/#change-password + GRAFANA_URL_DEFAULT="http://${GRAFANA_USERNAME}:${GRAFANA_PASSWORD}@${GRAFANA_URL}" + + echo ">> Updating Grafana 'admin' password..." + curl -X PUT -H "Content-Type: application/json" -d '{ + "oldPassword": "'${GRAFANA_PASSWORD}'", + "newPassword": "'${TFS_GRAFANA_PASSWORD}'", + "confirmNew" : "'${TFS_GRAFANA_PASSWORD}'" + }' ${GRAFANA_URL_DEFAULT}/api/user/password + echo + echo + + # Updated Grafana API URL + GRAFANA_URL_UPDATED="http://${GRAFANA_USERNAME}:${TFS_GRAFANA_PASSWORD}@${GRAFANA_URL}" + echo "export GRAFANA_URL_UPDATED=${GRAFANA_URL_UPDATED}" >> $ENV_VARS_SCRIPT + + echo ">> Installing Scatter Plot plugin..." + curl -X POST -H "Content-Type: application/json" -H "Content-Length: 0" \ + ${GRAFANA_URL_UPDATED}/api/plugins/michaeldmoore-scatter-panel/install + echo + + # Ref: https://grafana.com/docs/grafana/latest/http_api/data_source/ + QDB_HOST_PORT="${METRICSDB_HOSTNAME}:${QDB_SQL_PORT}" + echo ">> Creating datasources..." + curl -X POST -H "Content-Type: application/json" -H "Accept: application/json" -d '{ + "access" : "proxy", + "type" : "postgres", + "name" : "questdb-mon-kpi", + "url" : "'${QDB_HOST_PORT}'", + "database" : "'${QDB_TABLE_MONITORING_KPIS}'", + "user" : "'${QDB_USERNAME}'", + "basicAuth": false, + "isDefault": true, + "jsonData" : { + "sslmode" : "disable", + "postgresVersion" : 1100, + "maxOpenConns" : 0, + "maxIdleConns" : 2, + "connMaxLifetime" : 14400, + "tlsAuth" : false, + "tlsAuthWithCACert" : false, + "timescaledb" : false, + "tlsConfigurationMethod": "file-path", + "tlsSkipVerify" : true + }, + "secureJsonData": {"password": "'${QDB_PASSWORD}'"} + }' ${GRAFANA_URL_UPDATED}/api/datasources + echo + + curl -X POST -H "Content-Type: application/json" -H "Accept: application/json" -d '{ + "access" : "proxy", + "type" : "postgres", + "name" : "questdb-slc-grp", + "url" : "'${QDB_HOST_PORT}'", + "database" : "'${QDB_TABLE_SLICE_GROUPS}'", + "user" : "'${QDB_USERNAME}'", + "basicAuth": false, + "isDefault": false, + "jsonData" : { + "sslmode" : "disable", + "postgresVersion" : 1100, + "maxOpenConns" : 0, + "maxIdleConns" : 2, + "connMaxLifetime" : 14400, + "tlsAuth" : false, + "tlsAuthWithCACert" : false, + "timescaledb" : false, + "tlsConfigurationMethod": "file-path", + "tlsSkipVerify" : true + }, + "secureJsonData": {"password": "'${QDB_PASSWORD}'"} + }' ${GRAFANA_URL_UPDATED}/api/datasources + printf "\n\n" + + echo ">> Creating dashboards..." + # Ref: https://grafana.com/docs/grafana/latest/http_api/dashboard/ + curl -X POST -H "Content-Type: application/json" -d '@src/webui/grafana_db_mon_kpis_psql.json' \ + ${GRAFANA_URL_UPDATED}/api/dashboards/db + echo + + curl -X POST -H "Content-Type: application/json" -d '@src/webui/grafana_db_slc_grps_psql.json' \ + ${GRAFANA_URL_UPDATED}/api/dashboards/db + printf "\n\n" + + echo ">> Staring dashboards..." + DASHBOARD_URL="${GRAFANA_URL_UPDATED}/api/dashboards/uid/tfs-l3-monit" + DASHBOARD_ID=$(curl -s "${DASHBOARD_URL}" | jq '.dashboard.id') + curl -X POST ${GRAFANA_URL_UPDATED}/api/user/stars/dashboard/${DASHBOARD_ID} + echo + + DASHBOARD_URL="${GRAFANA_URL_UPDATED}/api/dashboards/uid/tfs-slice-grps" + DASHBOARD_ID=$(curl -s "${DASHBOARD_URL}" | jq '.dashboard.id') + curl -X POST ${GRAFANA_URL_UPDATED}/api/user/stars/dashboard/${DASHBOARD_ID} + echo + + printf "\n\n" +fi diff --git a/scripts/show_logs_bgp.sh b/scripts/show_logs_bgp.sh index dbf8efbf2992b480ffab6599a7a5c3f8638753c7..86a9744c70d671999318c6f84d009a1afacf10b6 100755 --- a/scripts/show_logs_bgp.sh +++ b/scripts/show_logs_bgp.sh @@ -24,4 +24,4 @@ export TFS_K8S_NAMESPACE=${TFS_K8S_NAMESPACE:-"tfs"} # Automated steps start here ######################################################################################################################## -kubectl --namespace $TFS_K8S_NAMESPACE logs deployment/bgpls_speakerservice -c server +kubectl --namespace $TFS_K8S_NAMESPACE logs deployment/bgpls-speakerservice -c server diff --git a/scripts/show_logs_pcep.sh b/scripts/show_logs_pcep.sh new file mode 100755 index 0000000000000000000000000000000000000000..af7cccd96c7ab774974bbf6a2802e397f7b0f24f --- /dev/null +++ b/scripts/show_logs_pcep.sh @@ -0,0 +1,27 @@ +#!/bin/bash +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# 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. + +######################################################################################################################## +# Define your deployment settings here +######################################################################################################################## + +# If not already set, set the name of the Kubernetes namespace to deploy to. +export TFS_K8S_NAMESPACE=${TFS_K8S_NAMESPACE:-"tfs"} + +######################################################################################################################## +# Automated steps start here +######################################################################################################################## + +kubectl --namespace $TFS_K8S_NAMESPACE logs deployment/pcepservice -c server diff --git a/scripts/show_logs_resource_manager.sh b/scripts/show_logs_resource_manager.sh new file mode 100755 index 0000000000000000000000000000000000000000..62b9b096ee4e080294b931d9b64b71b9fc2c6ee8 --- /dev/null +++ b/scripts/show_logs_resource_manager.sh @@ -0,0 +1,27 @@ +#!/bin/bash +# Copyright 2022-2024 ETSI OSG/SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/) +# +# 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. + +######################################################################################################################## +# Define your deployment settings here +######################################################################################################################## + +# If not already set, set the name of the Kubernetes namespace to deploy to. +export TFS_K8S_NAMESPACE=${TFS_K8S_NAMESPACE:-"tfs"} + +######################################################################################################################## +# Automated steps start here +######################################################################################################################## + +kubectl --namespace $TFS_K8S_NAMESPACE logs deployment/resource-managerservice diff --git a/src/bgpls_speaker/service/java/BGP4Parameters_3.xml b/src/bgpls_speaker/service/java/BGP4Parameters_3.xml index ec13295652aa4c0985b380ca8910ea8998d4a22a..e9fef07916568d11d80bb79fc690036a3d87ec7d 100644 --- a/src/bgpls_speaker/service/java/BGP4Parameters_3.xml +++ b/src/bgpls_speaker/service/java/BGP4Parameters_3.xml @@ -15,12 +15,12 @@ 12179 - 7.7.7.7 + 1.1.1.1 1112 - 10.95.90.43 + 10.95.90.46 false true 179 @@ -45,7 +45,7 @@ 4 - 65006 + 101 diff --git a/src/bgpls_speaker/service/java/exec_speakear_java.sh b/src/bgpls_speaker/service/java/exec_speakear_java.sh index 2bef9ed880294591782decb521f3e78cc42c938b..c4bb6c1868db3b43cc8ab8d5a2da1f2fbb1f08bc 100644 --- a/src/bgpls_speaker/service/java/exec_speakear_java.sh +++ b/src/bgpls_speaker/service/java/exec_speakear_java.sh @@ -14,6 +14,6 @@ #!/bin/bash cd netphony-topology/ -"/home/ubuntu/downloads/apache-maven-3.8.8/bin/mvn" clean package -P bgp-ls-speaker assembly:single -DskipTests +"/usr/bin/mvn" clean package -P bgp-ls-speaker assembly:single -DskipTests cd .. sudo java -jar netphony-topology/target/bgp-ls-speaker-jar-with-dependencies.jar BGP4Parameters_3.xml \ No newline at end of file diff --git a/src/bgpls_speaker/service/java/netphony-topology/BGP4Parameters_3.xml b/src/bgpls_speaker/service/java/netphony-topology/BGP4Parameters_3.xml index 2994fc7250922723c05e138a066addff1373f9bf..8420c549d43bdd9dbc8d433cb5f89c154ffb2018 100644 --- a/src/bgpls_speaker/service/java/netphony-topology/BGP4Parameters_3.xml +++ b/src/bgpls_speaker/service/java/netphony-topology/BGP4Parameters_3.xml @@ -15,12 +15,12 @@ limitations under the License. --> 12179 - 7.7.7.7 + 1.1.1.1 1112 - 10.95.90.43 + 10.95.90.46 false true 179 @@ -45,7 +45,7 @@ limitations under the License. --> 4 - 100 + 101 diff --git a/src/bgpls_speaker/service/java/netphony-topology/log4j2.xml b/src/bgpls_speaker/service/java/netphony-topology/log4j2.xml index a27d702e5bc9a480213d8d31223a320986c60381..727b6c7348b1e56633e681056adc42c266d7f249 100644 --- a/src/bgpls_speaker/service/java/netphony-topology/log4j2.xml +++ b/src/bgpls_speaker/service/java/netphony-topology/log4j2.xml @@ -1,36 +1,14 @@ - - - + - + - - - - - - - - - - + + diff --git a/src/bgpls_speaker/service/java/netphony-topology/node.json b/src/bgpls_speaker/service/java/netphony-topology/node.json new file mode 100644 index 0000000000000000000000000000000000000000..d338e514f03554bcb079bb33228f7444200aff12 --- /dev/null +++ b/src/bgpls_speaker/service/java/netphony-topology/node.json @@ -0,0 +1,262 @@ +{ + "nodeList": [ + { + "localBgplsID": "/3.3.3.3", + "as_number": "0.0.0.101", + "nodeName": "/2.2.2.2", + "learntFrom": "10.95.90.46", + "igpid": "2.2.2.2", + "routerID": "/2.2.2.2" + }, + { + "localBgplsID": "/3.3.3.3", + "as_number": "0.0.0.101", + "nodeName": "/1.1.1.1", + "learntFrom": "10.95.90.46", + "igpid": "1.1.1.1", + "routerID": "/1.1.1.1" + }, + { + "localBgplsID": "/3.3.3.3", + "as_number": "0.0.0.101", + "nodeName": "/4.4.4.4", + "learntFrom": "10.95.90.46", + "igpid": "4.4.4.4", + "routerID": "/4.4.4.4" + }, + { + "localBgplsID": "/3.3.3.3", + "as_number": "0.0.0.101", + "nodeName": "/3.3.3.3", + "learntFrom": "10.95.90.46", + "igpid": "3.3.3.3", + "routerID": "/3.3.3.3" + }, + { + "localBgplsID": "/3.3.3.3", + "as_number": "0.0.0.101", + "nodeName": "/5.5.5.5", + "learntFrom": "10.95.90.46", + "igpid": "5.5.5.5", + "routerID": "/5.5.5.5" + } + ], + "linkList": [ + { + "localDomainID": "0.0.0.101", + "remoteDomainID": "0.0.0.101", + "linkDelay": 0, + "linkDelayVar": 0, + "minDelay": 0, + "maxDelay": 0, + "residualBw": 0, + "availableBw": 0, + "utilizedBw": 0, + "iPv4RouterIDLocalNodeLATLV": "/192.168.15.1", + "iPv4RouterIDNeighborNodeLATLV": "/192.168.15.5", + "localBgplsID": "/3.3.3.3", + "remoteBgplsID": "/3.3.3.3", + "learntFrom": "10.95.90.46", + "localNodeIGPId": "1.1.1.1", + "remoteNodeIGPId": "5.5.5.5" + }, + { + "localDomainID": "0.0.0.101", + "remoteDomainID": "0.0.0.101", + "linkDelay": 0, + "linkDelayVar": 0, + "minDelay": 0, + "maxDelay": 0, + "residualBw": 0, + "availableBw": 0, + "utilizedBw": 0, + "iPv4RouterIDLocalNodeLATLV": "/192.168.24.2", + "iPv4RouterIDNeighborNodeLATLV": "/192.168.24.4", + "localBgplsID": "/3.3.3.3", + "remoteBgplsID": "/3.3.3.3", + "learntFrom": "10.95.90.46", + "localNodeIGPId": "2.2.2.2", + "remoteNodeIGPId": "4.4.4.4" + }, + { + "localDomainID": "0.0.0.101", + "remoteDomainID": "0.0.0.101", + "linkDelay": 0, + "linkDelayVar": 0, + "minDelay": 0, + "maxDelay": 0, + "residualBw": 0, + "availableBw": 0, + "utilizedBw": 0, + "iPv4RouterIDLocalNodeLATLV": "/192.168.35.5", + "iPv4RouterIDNeighborNodeLATLV": "/192.168.35.3", + "localBgplsID": "/3.3.3.3", + "remoteBgplsID": "/3.3.3.3", + "learntFrom": "10.95.90.46", + "localNodeIGPId": "5.5.5.5", + "remoteNodeIGPId": "3.3.3.3" + }, + { + "localDomainID": "0.0.0.101", + "remoteDomainID": "0.0.0.101", + "linkDelay": 0, + "linkDelayVar": 0, + "minDelay": 0, + "maxDelay": 0, + "residualBw": 0, + "availableBw": 0, + "utilizedBw": 0, + "iPv4RouterIDLocalNodeLATLV": "/192.168.35.3", + "iPv4RouterIDNeighborNodeLATLV": "/192.168.35.5", + "localBgplsID": "/3.3.3.3", + "remoteBgplsID": "/3.3.3.3", + "learntFrom": "10.95.90.46", + "localNodeIGPId": "3.3.3.3", + "remoteNodeIGPId": "5.5.5.5" + }, + { + "localDomainID": "0.0.0.101", + "remoteDomainID": "0.0.0.101", + "linkDelay": 0, + "linkDelayVar": 0, + "minDelay": 0, + "maxDelay": 0, + "residualBw": 0, + "availableBw": 0, + "utilizedBw": 0, + "iPv4RouterIDLocalNodeLATLV": "/192.168.12.2", + "iPv4RouterIDNeighborNodeLATLV": "/192.168.12.1", + "localBgplsID": "/3.3.3.3", + "remoteBgplsID": "/3.3.3.3", + "learntFrom": "10.95.90.46", + "localNodeIGPId": "2.2.2.2", + "remoteNodeIGPId": "1.1.1.1" + }, + { + "localDomainID": "0.0.0.101", + "remoteDomainID": "0.0.0.101", + "linkDelay": 0, + "linkDelayVar": 0, + "minDelay": 0, + "maxDelay": 0, + "residualBw": 0, + "availableBw": 0, + "utilizedBw": 0, + "iPv4RouterIDLocalNodeLATLV": "/192.168.23.3", + "iPv4RouterIDNeighborNodeLATLV": "/192.168.23.2", + "localBgplsID": "/3.3.3.3", + "remoteBgplsID": "/3.3.3.3", + "learntFrom": "10.95.90.46", + "localNodeIGPId": "3.3.3.3", + "remoteNodeIGPId": "2.2.2.2" + }, + { + "localDomainID": "0.0.0.101", + "remoteDomainID": "0.0.0.101", + "linkDelay": 0, + "linkDelayVar": 0, + "minDelay": 0, + "maxDelay": 0, + "residualBw": 0, + "availableBw": 0, + "utilizedBw": 0, + "iPv4RouterIDLocalNodeLATLV": "/192.168.24.4", + "iPv4RouterIDNeighborNodeLATLV": "/192.168.24.2", + "localBgplsID": "/3.3.3.3", + "remoteBgplsID": "/3.3.3.3", + "learntFrom": "10.95.90.46", + "localNodeIGPId": "4.4.4.4", + "remoteNodeIGPId": "2.2.2.2" + }, + { + "localDomainID": "0.0.0.101", + "remoteDomainID": "0.0.0.101", + "linkDelay": 0, + "linkDelayVar": 0, + "minDelay": 0, + "maxDelay": 0, + "residualBw": 0, + "availableBw": 0, + "utilizedBw": 0, + "iPv4RouterIDLocalNodeLATLV": "/192.168.15.5", + "iPv4RouterIDNeighborNodeLATLV": "/192.168.15.1", + "localBgplsID": "/3.3.3.3", + "remoteBgplsID": "/3.3.3.3", + "learntFrom": "10.95.90.46", + "localNodeIGPId": "5.5.5.5", + "remoteNodeIGPId": "1.1.1.1" + }, + { + "localDomainID": "0.0.0.101", + "remoteDomainID": "0.0.0.101", + "linkDelay": 0, + "linkDelayVar": 0, + "minDelay": 0, + "maxDelay": 0, + "residualBw": 0, + "availableBw": 0, + "utilizedBw": 0, + "iPv4RouterIDLocalNodeLATLV": "/192.168.12.1", + "iPv4RouterIDNeighborNodeLATLV": "/192.168.12.2", + "localBgplsID": "/3.3.3.3", + "remoteBgplsID": "/3.3.3.3", + "learntFrom": "10.95.90.46", + "localNodeIGPId": "1.1.1.1", + "remoteNodeIGPId": "2.2.2.2" + }, + { + "localDomainID": "0.0.0.101", + "remoteDomainID": "0.0.0.101", + "linkDelay": 0, + "linkDelayVar": 0, + "minDelay": 0, + "maxDelay": 0, + "residualBw": 0, + "availableBw": 0, + "utilizedBw": 0, + "iPv4RouterIDLocalNodeLATLV": "/192.168.25.2", + "iPv4RouterIDNeighborNodeLATLV": "/192.168.25.5", + "localBgplsID": "/3.3.3.3", + "remoteBgplsID": "/3.3.3.3", + "learntFrom": "10.95.90.46", + "localNodeIGPId": "2.2.2.2", + "remoteNodeIGPId": "5.5.5.5" + }, + { + "localDomainID": "0.0.0.101", + "remoteDomainID": "0.0.0.101", + "linkDelay": 0, + "linkDelayVar": 0, + "minDelay": 0, + "maxDelay": 0, + "residualBw": 0, + "availableBw": 0, + "utilizedBw": 0, + "iPv4RouterIDLocalNodeLATLV": "/192.168.25.5", + "iPv4RouterIDNeighborNodeLATLV": "/192.168.25.2", + "localBgplsID": "/3.3.3.3", + "remoteBgplsID": "/3.3.3.3", + "learntFrom": "10.95.90.46", + "localNodeIGPId": "5.5.5.5", + "remoteNodeIGPId": "2.2.2.2" + }, + { + "localDomainID": "0.0.0.101", + "remoteDomainID": "0.0.0.101", + "linkDelay": 0, + "linkDelayVar": 0, + "minDelay": 0, + "maxDelay": 0, + "residualBw": 0, + "availableBw": 0, + "utilizedBw": 0, + "iPv4RouterIDLocalNodeLATLV": "/192.168.23.2", + "iPv4RouterIDNeighborNodeLATLV": "/192.168.23.3", + "localBgplsID": "/3.3.3.3", + "remoteBgplsID": "/3.3.3.3", + "learntFrom": "10.95.90.46", + "localNodeIGPId": "2.2.2.2", + "remoteNodeIGPId": "3.3.3.3" + } + ] +} \ No newline at end of file diff --git a/src/bgpls_speaker/service/java/netphony-topology/pom.xml b/src/bgpls_speaker/service/java/netphony-topology/pom.xml index e26e47d69df0f4482e99c2b4c9843c2f19e0c431..2cd04969b2c65501792a49888165d02df34666c8 100644 --- a/src/bgpls_speaker/service/java/netphony-topology/pom.xml +++ b/src/bgpls_speaker/service/java/netphony-topology/pom.xml @@ -36,17 +36,32 @@ ${jersey-version} - + - + + + org.apache.logging.log4j + log4j-slf4j-impl + 2.5 + + + org.apache.logging.log4j + log4j-api + 2.5 + + + org.apache.logging.log4j + log4j-core + 2.5 + es.tid.netphony network-protocols diff --git a/src/bgpls_speaker/service/java/netphony-topology/src/main/java/eu/teraflow/tid/bgp4Peer/peer/BGPPeerMain.java b/src/bgpls_speaker/service/java/netphony-topology/src/main/java/eu/teraflow/tid/bgp4Peer/peer/BGPPeerMain.java index bd924a7c7cc1df60e96d820d80329c657b4e9262..7d1ed9750f6fee062f957a96e4e816259d1b3f03 100644 --- a/src/bgpls_speaker/service/java/netphony-topology/src/main/java/eu/teraflow/tid/bgp4Peer/peer/BGPPeerMain.java +++ b/src/bgpls_speaker/service/java/netphony-topology/src/main/java/eu/teraflow/tid/bgp4Peer/peer/BGPPeerMain.java @@ -28,7 +28,7 @@ public class BGPPeerMain { //bgpPeer.createTEDB("hola"); //did it in configure bgpPeer.createUpdateDispatcher(); - bgpPeer.startClient(); + // bgpPeer.startClient(); bgpPeer.startServer(); bgpPeer.startSaveTopology(); bgpPeer.startManagementServer(); diff --git a/src/bgpls_speaker/service/java/netphony-topology/src/main/java/eu/teraflow/tid/bgp4Peer/updateTEDB/UpdateProccesorThread.java b/src/bgpls_speaker/service/java/netphony-topology/src/main/java/eu/teraflow/tid/bgp4Peer/updateTEDB/UpdateProccesorThread.java index 13ad046314f1a6cbfd1db9d53cd07ceb0d78d667..17864d8eae89408519a573e6b6246e23104443b5 100644 --- a/src/bgpls_speaker/service/java/netphony-topology/src/main/java/eu/teraflow/tid/bgp4Peer/updateTEDB/UpdateProccesorThread.java +++ b/src/bgpls_speaker/service/java/netphony-topology/src/main/java/eu/teraflow/tid/bgp4Peer/updateTEDB/UpdateProccesorThread.java @@ -243,7 +243,7 @@ public class UpdateProccesorThread extends Thread { //log.info("We don't use ORIGIN"); break; default: - //log.info("Attribute typecode " + typeCode +"unknown"); + log.info("Attribute typecode " + typeCode +"unknown"); break; } @@ -395,6 +395,7 @@ public class UpdateProccesorThread extends Thread { private void processAttributeLinkState(LinkStateAttribute lsAtt){ if (lsAtt.getMaximumLinkBandwidthTLV() != null){ + log.debug("MAXIMUM LINK BANDWIDTH TLV"+ lsAtt.getMaximumLinkBandwidthTLV().toString()); maximumLinkBandwidthTLV = lsAtt.getMaximumLinkBandwidthTLV(); } diff --git a/src/bgpls_speaker/service/java/netphony-topology/src/test/resources/log4j2.xml b/src/bgpls_speaker/service/java/netphony-topology/src/test/resources/log4j2.xml index 0df0599bb1f6065dd9fcb505f9281b0821b5c77a..9acc760c9b0433bf8fb58029dd55bca0666317bc 100644 --- a/src/bgpls_speaker/service/java/netphony-topology/src/test/resources/log4j2.xml +++ b/src/bgpls_speaker/service/java/netphony-topology/src/test/resources/log4j2.xml @@ -11,7 +11,6 @@ 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. --> - @@ -20,7 +19,7 @@ limitations under the License. --> - + diff --git a/src/bgpls_speaker/service/java/netphony-topology/target/generated-sources/protobuf/grpc-java/src/main/proto/updateServiceGrpc.java b/src/bgpls_speaker/service/java/netphony-topology/target/generated-sources/protobuf/grpc-java/src/main/proto/updateServiceGrpc.java index f3755419ad1d83a479ec4f6187d2fdf292f4a677..237ff040525df0a56308d5ccb86edcbe02dfeac6 100644 --- a/src/bgpls_speaker/service/java/netphony-topology/target/generated-sources/protobuf/grpc-java/src/main/proto/updateServiceGrpc.java +++ b/src/bgpls_speaker/service/java/netphony-topology/target/generated-sources/protobuf/grpc-java/src/main/proto/updateServiceGrpc.java @@ -1,17 +1,3 @@ -// Copyright 2022-2025 ETSI SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/) - -// 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 src.main.proto; import static io.grpc.MethodDescriptor.generateFullMethodName; diff --git a/src/bgpls_speaker/service/java/netphony-topology/target/generated-sources/protobuf/java/src/main/proto/GrpcService.java b/src/bgpls_speaker/service/java/netphony-topology/target/generated-sources/protobuf/java/src/main/proto/GrpcService.java new file mode 100644 index 0000000000000000000000000000000000000000..a09f8ded37a455a27520f4e8ba9dc04ad799c0d9 --- /dev/null +++ b/src/bgpls_speaker/service/java/netphony-topology/target/generated-sources/protobuf/java/src/main/proto/GrpcService.java @@ -0,0 +1,6202 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: grpcService.proto + +package src.main.proto; + +public final class GrpcService { + private GrpcService() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface updateRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:src.main.proto.updateRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * string addressFamilyID = 1; + */ + java.lang.String getAddressFamilyID(); + /** + * string addressFamilyID = 1; + */ + com.google.protobuf.ByteString + getAddressFamilyIDBytes(); + + /** + * string nextHop = 2; + */ + java.lang.String getNextHop(); + /** + * string nextHop = 2; + */ + com.google.protobuf.ByteString + getNextHopBytes(); + + /** + * string asPathSegment = 3; + */ + java.lang.String getAsPathSegment(); + /** + * string asPathSegment = 3; + */ + com.google.protobuf.ByteString + getAsPathSegmentBytes(); + + /** + * repeated .src.main.proto.nodeInfo node = 4; + */ + java.util.List + getNodeList(); + /** + * repeated .src.main.proto.nodeInfo node = 4; + */ + src.main.proto.GrpcService.nodeInfo getNode(int index); + /** + * repeated .src.main.proto.nodeInfo node = 4; + */ + int getNodeCount(); + /** + * repeated .src.main.proto.nodeInfo node = 4; + */ + java.util.List + getNodeOrBuilderList(); + /** + * repeated .src.main.proto.nodeInfo node = 4; + */ + src.main.proto.GrpcService.nodeInfoOrBuilder getNodeOrBuilder( + int index); + + /** + *
+     * repeated : se da la posibilidad de mandar 0 o varios
+     * 
+ * + * repeated .src.main.proto.linkInfo link = 5; + */ + java.util.List + getLinkList(); + /** + *
+     * repeated : se da la posibilidad de mandar 0 o varios
+     * 
+ * + * repeated .src.main.proto.linkInfo link = 5; + */ + src.main.proto.GrpcService.linkInfo getLink(int index); + /** + *
+     * repeated : se da la posibilidad de mandar 0 o varios
+     * 
+ * + * repeated .src.main.proto.linkInfo link = 5; + */ + int getLinkCount(); + /** + *
+     * repeated : se da la posibilidad de mandar 0 o varios
+     * 
+ * + * repeated .src.main.proto.linkInfo link = 5; + */ + java.util.List + getLinkOrBuilderList(); + /** + *
+     * repeated : se da la posibilidad de mandar 0 o varios
+     * 
+ * + * repeated .src.main.proto.linkInfo link = 5; + */ + src.main.proto.GrpcService.linkInfoOrBuilder getLinkOrBuilder( + int index); + } + /** + * Protobuf type {@code src.main.proto.updateRequest} + */ + public static final class updateRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:src.main.proto.updateRequest) + updateRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use updateRequest.newBuilder() to construct. + private updateRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private updateRequest() { + addressFamilyID_ = ""; + nextHop_ = ""; + asPathSegment_ = ""; + node_ = java.util.Collections.emptyList(); + link_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new updateRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private updateRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + addressFamilyID_ = s; + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + nextHop_ = s; + break; + } + case 26: { + java.lang.String s = input.readStringRequireUtf8(); + + asPathSegment_ = s; + break; + } + case 34: { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + node_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + node_.add( + input.readMessage(src.main.proto.GrpcService.nodeInfo.parser(), extensionRegistry)); + break; + } + case 42: { + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + link_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000002; + } + link_.add( + input.readMessage(src.main.proto.GrpcService.linkInfo.parser(), extensionRegistry)); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + node_ = java.util.Collections.unmodifiableList(node_); + } + if (((mutable_bitField0_ & 0x00000002) != 0)) { + link_ = java.util.Collections.unmodifiableList(link_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return src.main.proto.GrpcService.internal_static_src_main_proto_updateRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return src.main.proto.GrpcService.internal_static_src_main_proto_updateRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + src.main.proto.GrpcService.updateRequest.class, src.main.proto.GrpcService.updateRequest.Builder.class); + } + + public static final int ADDRESSFAMILYID_FIELD_NUMBER = 1; + private volatile java.lang.Object addressFamilyID_; + /** + * string addressFamilyID = 1; + */ + public java.lang.String getAddressFamilyID() { + java.lang.Object ref = addressFamilyID_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + addressFamilyID_ = s; + return s; + } + } + /** + * string addressFamilyID = 1; + */ + public com.google.protobuf.ByteString + getAddressFamilyIDBytes() { + java.lang.Object ref = addressFamilyID_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + addressFamilyID_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int NEXTHOP_FIELD_NUMBER = 2; + private volatile java.lang.Object nextHop_; + /** + * string nextHop = 2; + */ + public java.lang.String getNextHop() { + java.lang.Object ref = nextHop_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextHop_ = s; + return s; + } + } + /** + * string nextHop = 2; + */ + public com.google.protobuf.ByteString + getNextHopBytes() { + java.lang.Object ref = nextHop_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + nextHop_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ASPATHSEGMENT_FIELD_NUMBER = 3; + private volatile java.lang.Object asPathSegment_; + /** + * string asPathSegment = 3; + */ + public java.lang.String getAsPathSegment() { + java.lang.Object ref = asPathSegment_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + asPathSegment_ = s; + return s; + } + } + /** + * string asPathSegment = 3; + */ + public com.google.protobuf.ByteString + getAsPathSegmentBytes() { + java.lang.Object ref = asPathSegment_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + asPathSegment_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int NODE_FIELD_NUMBER = 4; + private java.util.List node_; + /** + * repeated .src.main.proto.nodeInfo node = 4; + */ + public java.util.List getNodeList() { + return node_; + } + /** + * repeated .src.main.proto.nodeInfo node = 4; + */ + public java.util.List + getNodeOrBuilderList() { + return node_; + } + /** + * repeated .src.main.proto.nodeInfo node = 4; + */ + public int getNodeCount() { + return node_.size(); + } + /** + * repeated .src.main.proto.nodeInfo node = 4; + */ + public src.main.proto.GrpcService.nodeInfo getNode(int index) { + return node_.get(index); + } + /** + * repeated .src.main.proto.nodeInfo node = 4; + */ + public src.main.proto.GrpcService.nodeInfoOrBuilder getNodeOrBuilder( + int index) { + return node_.get(index); + } + + public static final int LINK_FIELD_NUMBER = 5; + private java.util.List link_; + /** + *
+     * repeated : se da la posibilidad de mandar 0 o varios
+     * 
+ * + * repeated .src.main.proto.linkInfo link = 5; + */ + public java.util.List getLinkList() { + return link_; + } + /** + *
+     * repeated : se da la posibilidad de mandar 0 o varios
+     * 
+ * + * repeated .src.main.proto.linkInfo link = 5; + */ + public java.util.List + getLinkOrBuilderList() { + return link_; + } + /** + *
+     * repeated : se da la posibilidad de mandar 0 o varios
+     * 
+ * + * repeated .src.main.proto.linkInfo link = 5; + */ + public int getLinkCount() { + return link_.size(); + } + /** + *
+     * repeated : se da la posibilidad de mandar 0 o varios
+     * 
+ * + * repeated .src.main.proto.linkInfo link = 5; + */ + public src.main.proto.GrpcService.linkInfo getLink(int index) { + return link_.get(index); + } + /** + *
+     * repeated : se da la posibilidad de mandar 0 o varios
+     * 
+ * + * repeated .src.main.proto.linkInfo link = 5; + */ + public src.main.proto.GrpcService.linkInfoOrBuilder getLinkOrBuilder( + int index) { + return link_.get(index); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getAddressFamilyIDBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, addressFamilyID_); + } + if (!getNextHopBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextHop_); + } + if (!getAsPathSegmentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, asPathSegment_); + } + for (int i = 0; i < node_.size(); i++) { + output.writeMessage(4, node_.get(i)); + } + for (int i = 0; i < link_.size(); i++) { + output.writeMessage(5, link_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getAddressFamilyIDBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, addressFamilyID_); + } + if (!getNextHopBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextHop_); + } + if (!getAsPathSegmentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, asPathSegment_); + } + for (int i = 0; i < node_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, node_.get(i)); + } + for (int i = 0; i < link_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(5, link_.get(i)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof src.main.proto.GrpcService.updateRequest)) { + return super.equals(obj); + } + src.main.proto.GrpcService.updateRequest other = (src.main.proto.GrpcService.updateRequest) obj; + + if (!getAddressFamilyID() + .equals(other.getAddressFamilyID())) return false; + if (!getNextHop() + .equals(other.getNextHop())) return false; + if (!getAsPathSegment() + .equals(other.getAsPathSegment())) return false; + if (!getNodeList() + .equals(other.getNodeList())) return false; + if (!getLinkList() + .equals(other.getLinkList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + ADDRESSFAMILYID_FIELD_NUMBER; + hash = (53 * hash) + getAddressFamilyID().hashCode(); + hash = (37 * hash) + NEXTHOP_FIELD_NUMBER; + hash = (53 * hash) + getNextHop().hashCode(); + hash = (37 * hash) + ASPATHSEGMENT_FIELD_NUMBER; + hash = (53 * hash) + getAsPathSegment().hashCode(); + if (getNodeCount() > 0) { + hash = (37 * hash) + NODE_FIELD_NUMBER; + hash = (53 * hash) + getNodeList().hashCode(); + } + if (getLinkCount() > 0) { + hash = (37 * hash) + LINK_FIELD_NUMBER; + hash = (53 * hash) + getLinkList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static src.main.proto.GrpcService.updateRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static src.main.proto.GrpcService.updateRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static src.main.proto.GrpcService.updateRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static src.main.proto.GrpcService.updateRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static src.main.proto.GrpcService.updateRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static src.main.proto.GrpcService.updateRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static src.main.proto.GrpcService.updateRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static src.main.proto.GrpcService.updateRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static src.main.proto.GrpcService.updateRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static src.main.proto.GrpcService.updateRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static src.main.proto.GrpcService.updateRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static src.main.proto.GrpcService.updateRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(src.main.proto.GrpcService.updateRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code src.main.proto.updateRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:src.main.proto.updateRequest) + src.main.proto.GrpcService.updateRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return src.main.proto.GrpcService.internal_static_src_main_proto_updateRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return src.main.proto.GrpcService.internal_static_src_main_proto_updateRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + src.main.proto.GrpcService.updateRequest.class, src.main.proto.GrpcService.updateRequest.Builder.class); + } + + // Construct using src.main.proto.GrpcService.updateRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getNodeFieldBuilder(); + getLinkFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + addressFamilyID_ = ""; + + nextHop_ = ""; + + asPathSegment_ = ""; + + if (nodeBuilder_ == null) { + node_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + nodeBuilder_.clear(); + } + if (linkBuilder_ == null) { + link_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + } else { + linkBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return src.main.proto.GrpcService.internal_static_src_main_proto_updateRequest_descriptor; + } + + @java.lang.Override + public src.main.proto.GrpcService.updateRequest getDefaultInstanceForType() { + return src.main.proto.GrpcService.updateRequest.getDefaultInstance(); + } + + @java.lang.Override + public src.main.proto.GrpcService.updateRequest build() { + src.main.proto.GrpcService.updateRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public src.main.proto.GrpcService.updateRequest buildPartial() { + src.main.proto.GrpcService.updateRequest result = new src.main.proto.GrpcService.updateRequest(this); + int from_bitField0_ = bitField0_; + result.addressFamilyID_ = addressFamilyID_; + result.nextHop_ = nextHop_; + result.asPathSegment_ = asPathSegment_; + if (nodeBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + node_ = java.util.Collections.unmodifiableList(node_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.node_ = node_; + } else { + result.node_ = nodeBuilder_.build(); + } + if (linkBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + link_ = java.util.Collections.unmodifiableList(link_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.link_ = link_; + } else { + result.link_ = linkBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof src.main.proto.GrpcService.updateRequest) { + return mergeFrom((src.main.proto.GrpcService.updateRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(src.main.proto.GrpcService.updateRequest other) { + if (other == src.main.proto.GrpcService.updateRequest.getDefaultInstance()) return this; + if (!other.getAddressFamilyID().isEmpty()) { + addressFamilyID_ = other.addressFamilyID_; + onChanged(); + } + if (!other.getNextHop().isEmpty()) { + nextHop_ = other.nextHop_; + onChanged(); + } + if (!other.getAsPathSegment().isEmpty()) { + asPathSegment_ = other.asPathSegment_; + onChanged(); + } + if (nodeBuilder_ == null) { + if (!other.node_.isEmpty()) { + if (node_.isEmpty()) { + node_ = other.node_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureNodeIsMutable(); + node_.addAll(other.node_); + } + onChanged(); + } + } else { + if (!other.node_.isEmpty()) { + if (nodeBuilder_.isEmpty()) { + nodeBuilder_.dispose(); + nodeBuilder_ = null; + node_ = other.node_; + bitField0_ = (bitField0_ & ~0x00000001); + nodeBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getNodeFieldBuilder() : null; + } else { + nodeBuilder_.addAllMessages(other.node_); + } + } + } + if (linkBuilder_ == null) { + if (!other.link_.isEmpty()) { + if (link_.isEmpty()) { + link_ = other.link_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureLinkIsMutable(); + link_.addAll(other.link_); + } + onChanged(); + } + } else { + if (!other.link_.isEmpty()) { + if (linkBuilder_.isEmpty()) { + linkBuilder_.dispose(); + linkBuilder_ = null; + link_ = other.link_; + bitField0_ = (bitField0_ & ~0x00000002); + linkBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getLinkFieldBuilder() : null; + } else { + linkBuilder_.addAllMessages(other.link_); + } + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + src.main.proto.GrpcService.updateRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (src.main.proto.GrpcService.updateRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.lang.Object addressFamilyID_ = ""; + /** + * string addressFamilyID = 1; + */ + public java.lang.String getAddressFamilyID() { + java.lang.Object ref = addressFamilyID_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + addressFamilyID_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string addressFamilyID = 1; + */ + public com.google.protobuf.ByteString + getAddressFamilyIDBytes() { + java.lang.Object ref = addressFamilyID_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + addressFamilyID_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string addressFamilyID = 1; + */ + public Builder setAddressFamilyID( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + addressFamilyID_ = value; + onChanged(); + return this; + } + /** + * string addressFamilyID = 1; + */ + public Builder clearAddressFamilyID() { + + addressFamilyID_ = getDefaultInstance().getAddressFamilyID(); + onChanged(); + return this; + } + /** + * string addressFamilyID = 1; + */ + public Builder setAddressFamilyIDBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + addressFamilyID_ = value; + onChanged(); + return this; + } + + private java.lang.Object nextHop_ = ""; + /** + * string nextHop = 2; + */ + public java.lang.String getNextHop() { + java.lang.Object ref = nextHop_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextHop_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string nextHop = 2; + */ + public com.google.protobuf.ByteString + getNextHopBytes() { + java.lang.Object ref = nextHop_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + nextHop_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string nextHop = 2; + */ + public Builder setNextHop( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + nextHop_ = value; + onChanged(); + return this; + } + /** + * string nextHop = 2; + */ + public Builder clearNextHop() { + + nextHop_ = getDefaultInstance().getNextHop(); + onChanged(); + return this; + } + /** + * string nextHop = 2; + */ + public Builder setNextHopBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + nextHop_ = value; + onChanged(); + return this; + } + + private java.lang.Object asPathSegment_ = ""; + /** + * string asPathSegment = 3; + */ + public java.lang.String getAsPathSegment() { + java.lang.Object ref = asPathSegment_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + asPathSegment_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string asPathSegment = 3; + */ + public com.google.protobuf.ByteString + getAsPathSegmentBytes() { + java.lang.Object ref = asPathSegment_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + asPathSegment_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string asPathSegment = 3; + */ + public Builder setAsPathSegment( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + asPathSegment_ = value; + onChanged(); + return this; + } + /** + * string asPathSegment = 3; + */ + public Builder clearAsPathSegment() { + + asPathSegment_ = getDefaultInstance().getAsPathSegment(); + onChanged(); + return this; + } + /** + * string asPathSegment = 3; + */ + public Builder setAsPathSegmentBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + asPathSegment_ = value; + onChanged(); + return this; + } + + private java.util.List node_ = + java.util.Collections.emptyList(); + private void ensureNodeIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + node_ = new java.util.ArrayList(node_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + src.main.proto.GrpcService.nodeInfo, src.main.proto.GrpcService.nodeInfo.Builder, src.main.proto.GrpcService.nodeInfoOrBuilder> nodeBuilder_; + + /** + * repeated .src.main.proto.nodeInfo node = 4; + */ + public java.util.List getNodeList() { + if (nodeBuilder_ == null) { + return java.util.Collections.unmodifiableList(node_); + } else { + return nodeBuilder_.getMessageList(); + } + } + /** + * repeated .src.main.proto.nodeInfo node = 4; + */ + public int getNodeCount() { + if (nodeBuilder_ == null) { + return node_.size(); + } else { + return nodeBuilder_.getCount(); + } + } + /** + * repeated .src.main.proto.nodeInfo node = 4; + */ + public src.main.proto.GrpcService.nodeInfo getNode(int index) { + if (nodeBuilder_ == null) { + return node_.get(index); + } else { + return nodeBuilder_.getMessage(index); + } + } + /** + * repeated .src.main.proto.nodeInfo node = 4; + */ + public Builder setNode( + int index, src.main.proto.GrpcService.nodeInfo value) { + if (nodeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNodeIsMutable(); + node_.set(index, value); + onChanged(); + } else { + nodeBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .src.main.proto.nodeInfo node = 4; + */ + public Builder setNode( + int index, src.main.proto.GrpcService.nodeInfo.Builder builderForValue) { + if (nodeBuilder_ == null) { + ensureNodeIsMutable(); + node_.set(index, builderForValue.build()); + onChanged(); + } else { + nodeBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .src.main.proto.nodeInfo node = 4; + */ + public Builder addNode(src.main.proto.GrpcService.nodeInfo value) { + if (nodeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNodeIsMutable(); + node_.add(value); + onChanged(); + } else { + nodeBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .src.main.proto.nodeInfo node = 4; + */ + public Builder addNode( + int index, src.main.proto.GrpcService.nodeInfo value) { + if (nodeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNodeIsMutable(); + node_.add(index, value); + onChanged(); + } else { + nodeBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .src.main.proto.nodeInfo node = 4; + */ + public Builder addNode( + src.main.proto.GrpcService.nodeInfo.Builder builderForValue) { + if (nodeBuilder_ == null) { + ensureNodeIsMutable(); + node_.add(builderForValue.build()); + onChanged(); + } else { + nodeBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .src.main.proto.nodeInfo node = 4; + */ + public Builder addNode( + int index, src.main.proto.GrpcService.nodeInfo.Builder builderForValue) { + if (nodeBuilder_ == null) { + ensureNodeIsMutable(); + node_.add(index, builderForValue.build()); + onChanged(); + } else { + nodeBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .src.main.proto.nodeInfo node = 4; + */ + public Builder addAllNode( + java.lang.Iterable values) { + if (nodeBuilder_ == null) { + ensureNodeIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, node_); + onChanged(); + } else { + nodeBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .src.main.proto.nodeInfo node = 4; + */ + public Builder clearNode() { + if (nodeBuilder_ == null) { + node_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + nodeBuilder_.clear(); + } + return this; + } + /** + * repeated .src.main.proto.nodeInfo node = 4; + */ + public Builder removeNode(int index) { + if (nodeBuilder_ == null) { + ensureNodeIsMutable(); + node_.remove(index); + onChanged(); + } else { + nodeBuilder_.remove(index); + } + return this; + } + /** + * repeated .src.main.proto.nodeInfo node = 4; + */ + public src.main.proto.GrpcService.nodeInfo.Builder getNodeBuilder( + int index) { + return getNodeFieldBuilder().getBuilder(index); + } + /** + * repeated .src.main.proto.nodeInfo node = 4; + */ + public src.main.proto.GrpcService.nodeInfoOrBuilder getNodeOrBuilder( + int index) { + if (nodeBuilder_ == null) { + return node_.get(index); } else { + return nodeBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .src.main.proto.nodeInfo node = 4; + */ + public java.util.List + getNodeOrBuilderList() { + if (nodeBuilder_ != null) { + return nodeBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(node_); + } + } + /** + * repeated .src.main.proto.nodeInfo node = 4; + */ + public src.main.proto.GrpcService.nodeInfo.Builder addNodeBuilder() { + return getNodeFieldBuilder().addBuilder( + src.main.proto.GrpcService.nodeInfo.getDefaultInstance()); + } + /** + * repeated .src.main.proto.nodeInfo node = 4; + */ + public src.main.proto.GrpcService.nodeInfo.Builder addNodeBuilder( + int index) { + return getNodeFieldBuilder().addBuilder( + index, src.main.proto.GrpcService.nodeInfo.getDefaultInstance()); + } + /** + * repeated .src.main.proto.nodeInfo node = 4; + */ + public java.util.List + getNodeBuilderList() { + return getNodeFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + src.main.proto.GrpcService.nodeInfo, src.main.proto.GrpcService.nodeInfo.Builder, src.main.proto.GrpcService.nodeInfoOrBuilder> + getNodeFieldBuilder() { + if (nodeBuilder_ == null) { + nodeBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + src.main.proto.GrpcService.nodeInfo, src.main.proto.GrpcService.nodeInfo.Builder, src.main.proto.GrpcService.nodeInfoOrBuilder>( + node_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + node_ = null; + } + return nodeBuilder_; + } + + private java.util.List link_ = + java.util.Collections.emptyList(); + private void ensureLinkIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + link_ = new java.util.ArrayList(link_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + src.main.proto.GrpcService.linkInfo, src.main.proto.GrpcService.linkInfo.Builder, src.main.proto.GrpcService.linkInfoOrBuilder> linkBuilder_; + + /** + *
+       * repeated : se da la posibilidad de mandar 0 o varios
+       * 
+ * + * repeated .src.main.proto.linkInfo link = 5; + */ + public java.util.List getLinkList() { + if (linkBuilder_ == null) { + return java.util.Collections.unmodifiableList(link_); + } else { + return linkBuilder_.getMessageList(); + } + } + /** + *
+       * repeated : se da la posibilidad de mandar 0 o varios
+       * 
+ * + * repeated .src.main.proto.linkInfo link = 5; + */ + public int getLinkCount() { + if (linkBuilder_ == null) { + return link_.size(); + } else { + return linkBuilder_.getCount(); + } + } + /** + *
+       * repeated : se da la posibilidad de mandar 0 o varios
+       * 
+ * + * repeated .src.main.proto.linkInfo link = 5; + */ + public src.main.proto.GrpcService.linkInfo getLink(int index) { + if (linkBuilder_ == null) { + return link_.get(index); + } else { + return linkBuilder_.getMessage(index); + } + } + /** + *
+       * repeated : se da la posibilidad de mandar 0 o varios
+       * 
+ * + * repeated .src.main.proto.linkInfo link = 5; + */ + public Builder setLink( + int index, src.main.proto.GrpcService.linkInfo value) { + if (linkBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureLinkIsMutable(); + link_.set(index, value); + onChanged(); + } else { + linkBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+       * repeated : se da la posibilidad de mandar 0 o varios
+       * 
+ * + * repeated .src.main.proto.linkInfo link = 5; + */ + public Builder setLink( + int index, src.main.proto.GrpcService.linkInfo.Builder builderForValue) { + if (linkBuilder_ == null) { + ensureLinkIsMutable(); + link_.set(index, builderForValue.build()); + onChanged(); + } else { + linkBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+       * repeated : se da la posibilidad de mandar 0 o varios
+       * 
+ * + * repeated .src.main.proto.linkInfo link = 5; + */ + public Builder addLink(src.main.proto.GrpcService.linkInfo value) { + if (linkBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureLinkIsMutable(); + link_.add(value); + onChanged(); + } else { + linkBuilder_.addMessage(value); + } + return this; + } + /** + *
+       * repeated : se da la posibilidad de mandar 0 o varios
+       * 
+ * + * repeated .src.main.proto.linkInfo link = 5; + */ + public Builder addLink( + int index, src.main.proto.GrpcService.linkInfo value) { + if (linkBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureLinkIsMutable(); + link_.add(index, value); + onChanged(); + } else { + linkBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+       * repeated : se da la posibilidad de mandar 0 o varios
+       * 
+ * + * repeated .src.main.proto.linkInfo link = 5; + */ + public Builder addLink( + src.main.proto.GrpcService.linkInfo.Builder builderForValue) { + if (linkBuilder_ == null) { + ensureLinkIsMutable(); + link_.add(builderForValue.build()); + onChanged(); + } else { + linkBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+       * repeated : se da la posibilidad de mandar 0 o varios
+       * 
+ * + * repeated .src.main.proto.linkInfo link = 5; + */ + public Builder addLink( + int index, src.main.proto.GrpcService.linkInfo.Builder builderForValue) { + if (linkBuilder_ == null) { + ensureLinkIsMutable(); + link_.add(index, builderForValue.build()); + onChanged(); + } else { + linkBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+       * repeated : se da la posibilidad de mandar 0 o varios
+       * 
+ * + * repeated .src.main.proto.linkInfo link = 5; + */ + public Builder addAllLink( + java.lang.Iterable values) { + if (linkBuilder_ == null) { + ensureLinkIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, link_); + onChanged(); + } else { + linkBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+       * repeated : se da la posibilidad de mandar 0 o varios
+       * 
+ * + * repeated .src.main.proto.linkInfo link = 5; + */ + public Builder clearLink() { + if (linkBuilder_ == null) { + link_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + linkBuilder_.clear(); + } + return this; + } + /** + *
+       * repeated : se da la posibilidad de mandar 0 o varios
+       * 
+ * + * repeated .src.main.proto.linkInfo link = 5; + */ + public Builder removeLink(int index) { + if (linkBuilder_ == null) { + ensureLinkIsMutable(); + link_.remove(index); + onChanged(); + } else { + linkBuilder_.remove(index); + } + return this; + } + /** + *
+       * repeated : se da la posibilidad de mandar 0 o varios
+       * 
+ * + * repeated .src.main.proto.linkInfo link = 5; + */ + public src.main.proto.GrpcService.linkInfo.Builder getLinkBuilder( + int index) { + return getLinkFieldBuilder().getBuilder(index); + } + /** + *
+       * repeated : se da la posibilidad de mandar 0 o varios
+       * 
+ * + * repeated .src.main.proto.linkInfo link = 5; + */ + public src.main.proto.GrpcService.linkInfoOrBuilder getLinkOrBuilder( + int index) { + if (linkBuilder_ == null) { + return link_.get(index); } else { + return linkBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+       * repeated : se da la posibilidad de mandar 0 o varios
+       * 
+ * + * repeated .src.main.proto.linkInfo link = 5; + */ + public java.util.List + getLinkOrBuilderList() { + if (linkBuilder_ != null) { + return linkBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(link_); + } + } + /** + *
+       * repeated : se da la posibilidad de mandar 0 o varios
+       * 
+ * + * repeated .src.main.proto.linkInfo link = 5; + */ + public src.main.proto.GrpcService.linkInfo.Builder addLinkBuilder() { + return getLinkFieldBuilder().addBuilder( + src.main.proto.GrpcService.linkInfo.getDefaultInstance()); + } + /** + *
+       * repeated : se da la posibilidad de mandar 0 o varios
+       * 
+ * + * repeated .src.main.proto.linkInfo link = 5; + */ + public src.main.proto.GrpcService.linkInfo.Builder addLinkBuilder( + int index) { + return getLinkFieldBuilder().addBuilder( + index, src.main.proto.GrpcService.linkInfo.getDefaultInstance()); + } + /** + *
+       * repeated : se da la posibilidad de mandar 0 o varios
+       * 
+ * + * repeated .src.main.proto.linkInfo link = 5; + */ + public java.util.List + getLinkBuilderList() { + return getLinkFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + src.main.proto.GrpcService.linkInfo, src.main.proto.GrpcService.linkInfo.Builder, src.main.proto.GrpcService.linkInfoOrBuilder> + getLinkFieldBuilder() { + if (linkBuilder_ == null) { + linkBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + src.main.proto.GrpcService.linkInfo, src.main.proto.GrpcService.linkInfo.Builder, src.main.proto.GrpcService.linkInfoOrBuilder>( + link_, + ((bitField0_ & 0x00000002) != 0), + getParentForChildren(), + isClean()); + link_ = null; + } + return linkBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:src.main.proto.updateRequest) + } + + // @@protoc_insertion_point(class_scope:src.main.proto.updateRequest) + private static final src.main.proto.GrpcService.updateRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new src.main.proto.GrpcService.updateRequest(); + } + + public static src.main.proto.GrpcService.updateRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public updateRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new updateRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public src.main.proto.GrpcService.updateRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface nodeInfoOrBuilder extends + // @@protoc_insertion_point(interface_extends:src.main.proto.nodeInfo) + com.google.protobuf.MessageOrBuilder { + + /** + * string nodeName = 1; + */ + java.lang.String getNodeName(); + /** + * string nodeName = 1; + */ + com.google.protobuf.ByteString + getNodeNameBytes(); + + /** + * string igpID = 2; + */ + java.lang.String getIgpID(); + /** + * string igpID = 2; + */ + com.google.protobuf.ByteString + getIgpIDBytes(); + + /** + * string bgplsID = 3; + */ + java.lang.String getBgplsID(); + /** + * string bgplsID = 3; + */ + com.google.protobuf.ByteString + getBgplsIDBytes(); + + /** + * int32 asID = 4; + */ + int getAsID(); + + /** + * string learntFrom = 5; + */ + java.lang.String getLearntFrom(); + /** + * string learntFrom = 5; + */ + com.google.protobuf.ByteString + getLearntFromBytes(); + } + /** + * Protobuf type {@code src.main.proto.nodeInfo} + */ + public static final class nodeInfo extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:src.main.proto.nodeInfo) + nodeInfoOrBuilder { + private static final long serialVersionUID = 0L; + // Use nodeInfo.newBuilder() to construct. + private nodeInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private nodeInfo() { + nodeName_ = ""; + igpID_ = ""; + bgplsID_ = ""; + learntFrom_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new nodeInfo(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private nodeInfo( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + nodeName_ = s; + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + igpID_ = s; + break; + } + case 26: { + java.lang.String s = input.readStringRequireUtf8(); + + bgplsID_ = s; + break; + } + case 32: { + + asID_ = input.readInt32(); + break; + } + case 42: { + java.lang.String s = input.readStringRequireUtf8(); + + learntFrom_ = s; + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return src.main.proto.GrpcService.internal_static_src_main_proto_nodeInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return src.main.proto.GrpcService.internal_static_src_main_proto_nodeInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + src.main.proto.GrpcService.nodeInfo.class, src.main.proto.GrpcService.nodeInfo.Builder.class); + } + + public static final int NODENAME_FIELD_NUMBER = 1; + private volatile java.lang.Object nodeName_; + /** + * string nodeName = 1; + */ + public java.lang.String getNodeName() { + java.lang.Object ref = nodeName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nodeName_ = s; + return s; + } + } + /** + * string nodeName = 1; + */ + public com.google.protobuf.ByteString + getNodeNameBytes() { + java.lang.Object ref = nodeName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + nodeName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int IGPID_FIELD_NUMBER = 2; + private volatile java.lang.Object igpID_; + /** + * string igpID = 2; + */ + public java.lang.String getIgpID() { + java.lang.Object ref = igpID_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + igpID_ = s; + return s; + } + } + /** + * string igpID = 2; + */ + public com.google.protobuf.ByteString + getIgpIDBytes() { + java.lang.Object ref = igpID_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + igpID_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BGPLSID_FIELD_NUMBER = 3; + private volatile java.lang.Object bgplsID_; + /** + * string bgplsID = 3; + */ + public java.lang.String getBgplsID() { + java.lang.Object ref = bgplsID_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + bgplsID_ = s; + return s; + } + } + /** + * string bgplsID = 3; + */ + public com.google.protobuf.ByteString + getBgplsIDBytes() { + java.lang.Object ref = bgplsID_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + bgplsID_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ASID_FIELD_NUMBER = 4; + private int asID_; + /** + * int32 asID = 4; + */ + public int getAsID() { + return asID_; + } + + public static final int LEARNTFROM_FIELD_NUMBER = 5; + private volatile java.lang.Object learntFrom_; + /** + * string learntFrom = 5; + */ + public java.lang.String getLearntFrom() { + java.lang.Object ref = learntFrom_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + learntFrom_ = s; + return s; + } + } + /** + * string learntFrom = 5; + */ + public com.google.protobuf.ByteString + getLearntFromBytes() { + java.lang.Object ref = learntFrom_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + learntFrom_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getNodeNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, nodeName_); + } + if (!getIgpIDBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, igpID_); + } + if (!getBgplsIDBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, bgplsID_); + } + if (asID_ != 0) { + output.writeInt32(4, asID_); + } + if (!getLearntFromBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, learntFrom_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNodeNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, nodeName_); + } + if (!getIgpIDBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, igpID_); + } + if (!getBgplsIDBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, bgplsID_); + } + if (asID_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(4, asID_); + } + if (!getLearntFromBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, learntFrom_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof src.main.proto.GrpcService.nodeInfo)) { + return super.equals(obj); + } + src.main.proto.GrpcService.nodeInfo other = (src.main.proto.GrpcService.nodeInfo) obj; + + if (!getNodeName() + .equals(other.getNodeName())) return false; + if (!getIgpID() + .equals(other.getIgpID())) return false; + if (!getBgplsID() + .equals(other.getBgplsID())) return false; + if (getAsID() + != other.getAsID()) return false; + if (!getLearntFrom() + .equals(other.getLearntFrom())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NODENAME_FIELD_NUMBER; + hash = (53 * hash) + getNodeName().hashCode(); + hash = (37 * hash) + IGPID_FIELD_NUMBER; + hash = (53 * hash) + getIgpID().hashCode(); + hash = (37 * hash) + BGPLSID_FIELD_NUMBER; + hash = (53 * hash) + getBgplsID().hashCode(); + hash = (37 * hash) + ASID_FIELD_NUMBER; + hash = (53 * hash) + getAsID(); + hash = (37 * hash) + LEARNTFROM_FIELD_NUMBER; + hash = (53 * hash) + getLearntFrom().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static src.main.proto.GrpcService.nodeInfo parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static src.main.proto.GrpcService.nodeInfo parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static src.main.proto.GrpcService.nodeInfo parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static src.main.proto.GrpcService.nodeInfo parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static src.main.proto.GrpcService.nodeInfo parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static src.main.proto.GrpcService.nodeInfo parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static src.main.proto.GrpcService.nodeInfo parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static src.main.proto.GrpcService.nodeInfo parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static src.main.proto.GrpcService.nodeInfo parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static src.main.proto.GrpcService.nodeInfo parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static src.main.proto.GrpcService.nodeInfo parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static src.main.proto.GrpcService.nodeInfo parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(src.main.proto.GrpcService.nodeInfo prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code src.main.proto.nodeInfo} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:src.main.proto.nodeInfo) + src.main.proto.GrpcService.nodeInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return src.main.proto.GrpcService.internal_static_src_main_proto_nodeInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return src.main.proto.GrpcService.internal_static_src_main_proto_nodeInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + src.main.proto.GrpcService.nodeInfo.class, src.main.proto.GrpcService.nodeInfo.Builder.class); + } + + // Construct using src.main.proto.GrpcService.nodeInfo.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + nodeName_ = ""; + + igpID_ = ""; + + bgplsID_ = ""; + + asID_ = 0; + + learntFrom_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return src.main.proto.GrpcService.internal_static_src_main_proto_nodeInfo_descriptor; + } + + @java.lang.Override + public src.main.proto.GrpcService.nodeInfo getDefaultInstanceForType() { + return src.main.proto.GrpcService.nodeInfo.getDefaultInstance(); + } + + @java.lang.Override + public src.main.proto.GrpcService.nodeInfo build() { + src.main.proto.GrpcService.nodeInfo result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public src.main.proto.GrpcService.nodeInfo buildPartial() { + src.main.proto.GrpcService.nodeInfo result = new src.main.proto.GrpcService.nodeInfo(this); + result.nodeName_ = nodeName_; + result.igpID_ = igpID_; + result.bgplsID_ = bgplsID_; + result.asID_ = asID_; + result.learntFrom_ = learntFrom_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof src.main.proto.GrpcService.nodeInfo) { + return mergeFrom((src.main.proto.GrpcService.nodeInfo)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(src.main.proto.GrpcService.nodeInfo other) { + if (other == src.main.proto.GrpcService.nodeInfo.getDefaultInstance()) return this; + if (!other.getNodeName().isEmpty()) { + nodeName_ = other.nodeName_; + onChanged(); + } + if (!other.getIgpID().isEmpty()) { + igpID_ = other.igpID_; + onChanged(); + } + if (!other.getBgplsID().isEmpty()) { + bgplsID_ = other.bgplsID_; + onChanged(); + } + if (other.getAsID() != 0) { + setAsID(other.getAsID()); + } + if (!other.getLearntFrom().isEmpty()) { + learntFrom_ = other.learntFrom_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + src.main.proto.GrpcService.nodeInfo parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (src.main.proto.GrpcService.nodeInfo) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object nodeName_ = ""; + /** + * string nodeName = 1; + */ + public java.lang.String getNodeName() { + java.lang.Object ref = nodeName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nodeName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string nodeName = 1; + */ + public com.google.protobuf.ByteString + getNodeNameBytes() { + java.lang.Object ref = nodeName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + nodeName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string nodeName = 1; + */ + public Builder setNodeName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + nodeName_ = value; + onChanged(); + return this; + } + /** + * string nodeName = 1; + */ + public Builder clearNodeName() { + + nodeName_ = getDefaultInstance().getNodeName(); + onChanged(); + return this; + } + /** + * string nodeName = 1; + */ + public Builder setNodeNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + nodeName_ = value; + onChanged(); + return this; + } + + private java.lang.Object igpID_ = ""; + /** + * string igpID = 2; + */ + public java.lang.String getIgpID() { + java.lang.Object ref = igpID_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + igpID_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string igpID = 2; + */ + public com.google.protobuf.ByteString + getIgpIDBytes() { + java.lang.Object ref = igpID_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + igpID_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string igpID = 2; + */ + public Builder setIgpID( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + igpID_ = value; + onChanged(); + return this; + } + /** + * string igpID = 2; + */ + public Builder clearIgpID() { + + igpID_ = getDefaultInstance().getIgpID(); + onChanged(); + return this; + } + /** + * string igpID = 2; + */ + public Builder setIgpIDBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + igpID_ = value; + onChanged(); + return this; + } + + private java.lang.Object bgplsID_ = ""; + /** + * string bgplsID = 3; + */ + public java.lang.String getBgplsID() { + java.lang.Object ref = bgplsID_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + bgplsID_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string bgplsID = 3; + */ + public com.google.protobuf.ByteString + getBgplsIDBytes() { + java.lang.Object ref = bgplsID_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + bgplsID_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string bgplsID = 3; + */ + public Builder setBgplsID( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + bgplsID_ = value; + onChanged(); + return this; + } + /** + * string bgplsID = 3; + */ + public Builder clearBgplsID() { + + bgplsID_ = getDefaultInstance().getBgplsID(); + onChanged(); + return this; + } + /** + * string bgplsID = 3; + */ + public Builder setBgplsIDBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + bgplsID_ = value; + onChanged(); + return this; + } + + private int asID_ ; + /** + * int32 asID = 4; + */ + public int getAsID() { + return asID_; + } + /** + * int32 asID = 4; + */ + public Builder setAsID(int value) { + + asID_ = value; + onChanged(); + return this; + } + /** + * int32 asID = 4; + */ + public Builder clearAsID() { + + asID_ = 0; + onChanged(); + return this; + } + + private java.lang.Object learntFrom_ = ""; + /** + * string learntFrom = 5; + */ + public java.lang.String getLearntFrom() { + java.lang.Object ref = learntFrom_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + learntFrom_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string learntFrom = 5; + */ + public com.google.protobuf.ByteString + getLearntFromBytes() { + java.lang.Object ref = learntFrom_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + learntFrom_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string learntFrom = 5; + */ + public Builder setLearntFrom( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + learntFrom_ = value; + onChanged(); + return this; + } + /** + * string learntFrom = 5; + */ + public Builder clearLearntFrom() { + + learntFrom_ = getDefaultInstance().getLearntFrom(); + onChanged(); + return this; + } + /** + * string learntFrom = 5; + */ + public Builder setLearntFromBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + learntFrom_ = value; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:src.main.proto.nodeInfo) + } + + // @@protoc_insertion_point(class_scope:src.main.proto.nodeInfo) + private static final src.main.proto.GrpcService.nodeInfo DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new src.main.proto.GrpcService.nodeInfo(); + } + + public static src.main.proto.GrpcService.nodeInfo getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public nodeInfo parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new nodeInfo(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public src.main.proto.GrpcService.nodeInfo getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface linkInfoOrBuilder extends + // @@protoc_insertion_point(interface_extends:src.main.proto.linkInfo) + com.google.protobuf.MessageOrBuilder { + + /** + * string remoteID = 1; + */ + java.lang.String getRemoteID(); + /** + * string remoteID = 1; + */ + com.google.protobuf.ByteString + getRemoteIDBytes(); + + /** + * string localID = 2; + */ + java.lang.String getLocalID(); + /** + * string localID = 2; + */ + com.google.protobuf.ByteString + getLocalIDBytes(); + + /** + * string remoteIPv4ID = 3; + */ + java.lang.String getRemoteIPv4ID(); + /** + * string remoteIPv4ID = 3; + */ + com.google.protobuf.ByteString + getRemoteIPv4IDBytes(); + + /** + * string localIPv4ID = 4; + */ + java.lang.String getLocalIPv4ID(); + /** + * string localIPv4ID = 4; + */ + com.google.protobuf.ByteString + getLocalIPv4IDBytes(); + + /** + * .src.main.proto.NodeDescriptors local = 5; + */ + boolean hasLocal(); + /** + * .src.main.proto.NodeDescriptors local = 5; + */ + src.main.proto.GrpcService.NodeDescriptors getLocal(); + /** + * .src.main.proto.NodeDescriptors local = 5; + */ + src.main.proto.GrpcService.NodeDescriptorsOrBuilder getLocalOrBuilder(); + + /** + * .src.main.proto.NodeDescriptors remote = 6; + */ + boolean hasRemote(); + /** + * .src.main.proto.NodeDescriptors remote = 6; + */ + src.main.proto.GrpcService.NodeDescriptors getRemote(); + /** + * .src.main.proto.NodeDescriptors remote = 6; + */ + src.main.proto.GrpcService.NodeDescriptorsOrBuilder getRemoteOrBuilder(); + + /** + * float availableBw = 7; + */ + float getAvailableBw(); + + /** + * float residualBw = 8; + */ + float getResidualBw(); + + /** + * float utilized = 9; + */ + float getUtilized(); + + /** + * float maxLinkDelay = 10; + */ + float getMaxLinkDelay(); + + /** + * float minLinkDelay = 11; + */ + float getMinLinkDelay(); + + /** + * float delayVariation = 12; + */ + float getDelayVariation(); + + /** + * float delay = 13; + */ + float getDelay(); + + /** + * int32 TEDefaultMetric = 14; + */ + int getTEDefaultMetric(); + + /** + * string adjacencySid = 15; + */ + java.lang.String getAdjacencySid(); + /** + * string adjacencySid = 15; + */ + com.google.protobuf.ByteString + getAdjacencySidBytes(); + + /** + * string learntFrom = 16; + */ + java.lang.String getLearntFrom(); + /** + * string learntFrom = 16; + */ + com.google.protobuf.ByteString + getLearntFromBytes(); + } + /** + * Protobuf type {@code src.main.proto.linkInfo} + */ + public static final class linkInfo extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:src.main.proto.linkInfo) + linkInfoOrBuilder { + private static final long serialVersionUID = 0L; + // Use linkInfo.newBuilder() to construct. + private linkInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private linkInfo() { + remoteID_ = ""; + localID_ = ""; + remoteIPv4ID_ = ""; + localIPv4ID_ = ""; + adjacencySid_ = ""; + learntFrom_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new linkInfo(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private linkInfo( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + remoteID_ = s; + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + localID_ = s; + break; + } + case 26: { + java.lang.String s = input.readStringRequireUtf8(); + + remoteIPv4ID_ = s; + break; + } + case 34: { + java.lang.String s = input.readStringRequireUtf8(); + + localIPv4ID_ = s; + break; + } + case 42: { + src.main.proto.GrpcService.NodeDescriptors.Builder subBuilder = null; + if (local_ != null) { + subBuilder = local_.toBuilder(); + } + local_ = input.readMessage(src.main.proto.GrpcService.NodeDescriptors.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(local_); + local_ = subBuilder.buildPartial(); + } + + break; + } + case 50: { + src.main.proto.GrpcService.NodeDescriptors.Builder subBuilder = null; + if (remote_ != null) { + subBuilder = remote_.toBuilder(); + } + remote_ = input.readMessage(src.main.proto.GrpcService.NodeDescriptors.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(remote_); + remote_ = subBuilder.buildPartial(); + } + + break; + } + case 61: { + + availableBw_ = input.readFloat(); + break; + } + case 69: { + + residualBw_ = input.readFloat(); + break; + } + case 77: { + + utilized_ = input.readFloat(); + break; + } + case 85: { + + maxLinkDelay_ = input.readFloat(); + break; + } + case 93: { + + minLinkDelay_ = input.readFloat(); + break; + } + case 101: { + + delayVariation_ = input.readFloat(); + break; + } + case 109: { + + delay_ = input.readFloat(); + break; + } + case 112: { + + tEDefaultMetric_ = input.readInt32(); + break; + } + case 122: { + java.lang.String s = input.readStringRequireUtf8(); + + adjacencySid_ = s; + break; + } + case 130: { + java.lang.String s = input.readStringRequireUtf8(); + + learntFrom_ = s; + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return src.main.proto.GrpcService.internal_static_src_main_proto_linkInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return src.main.proto.GrpcService.internal_static_src_main_proto_linkInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + src.main.proto.GrpcService.linkInfo.class, src.main.proto.GrpcService.linkInfo.Builder.class); + } + + public static final int REMOTEID_FIELD_NUMBER = 1; + private volatile java.lang.Object remoteID_; + /** + * string remoteID = 1; + */ + public java.lang.String getRemoteID() { + java.lang.Object ref = remoteID_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + remoteID_ = s; + return s; + } + } + /** + * string remoteID = 1; + */ + public com.google.protobuf.ByteString + getRemoteIDBytes() { + java.lang.Object ref = remoteID_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + remoteID_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int LOCALID_FIELD_NUMBER = 2; + private volatile java.lang.Object localID_; + /** + * string localID = 2; + */ + public java.lang.String getLocalID() { + java.lang.Object ref = localID_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + localID_ = s; + return s; + } + } + /** + * string localID = 2; + */ + public com.google.protobuf.ByteString + getLocalIDBytes() { + java.lang.Object ref = localID_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + localID_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int REMOTEIPV4ID_FIELD_NUMBER = 3; + private volatile java.lang.Object remoteIPv4ID_; + /** + * string remoteIPv4ID = 3; + */ + public java.lang.String getRemoteIPv4ID() { + java.lang.Object ref = remoteIPv4ID_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + remoteIPv4ID_ = s; + return s; + } + } + /** + * string remoteIPv4ID = 3; + */ + public com.google.protobuf.ByteString + getRemoteIPv4IDBytes() { + java.lang.Object ref = remoteIPv4ID_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + remoteIPv4ID_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int LOCALIPV4ID_FIELD_NUMBER = 4; + private volatile java.lang.Object localIPv4ID_; + /** + * string localIPv4ID = 4; + */ + public java.lang.String getLocalIPv4ID() { + java.lang.Object ref = localIPv4ID_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + localIPv4ID_ = s; + return s; + } + } + /** + * string localIPv4ID = 4; + */ + public com.google.protobuf.ByteString + getLocalIPv4IDBytes() { + java.lang.Object ref = localIPv4ID_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + localIPv4ID_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int LOCAL_FIELD_NUMBER = 5; + private src.main.proto.GrpcService.NodeDescriptors local_; + /** + * .src.main.proto.NodeDescriptors local = 5; + */ + public boolean hasLocal() { + return local_ != null; + } + /** + * .src.main.proto.NodeDescriptors local = 5; + */ + public src.main.proto.GrpcService.NodeDescriptors getLocal() { + return local_ == null ? src.main.proto.GrpcService.NodeDescriptors.getDefaultInstance() : local_; + } + /** + * .src.main.proto.NodeDescriptors local = 5; + */ + public src.main.proto.GrpcService.NodeDescriptorsOrBuilder getLocalOrBuilder() { + return getLocal(); + } + + public static final int REMOTE_FIELD_NUMBER = 6; + private src.main.proto.GrpcService.NodeDescriptors remote_; + /** + * .src.main.proto.NodeDescriptors remote = 6; + */ + public boolean hasRemote() { + return remote_ != null; + } + /** + * .src.main.proto.NodeDescriptors remote = 6; + */ + public src.main.proto.GrpcService.NodeDescriptors getRemote() { + return remote_ == null ? src.main.proto.GrpcService.NodeDescriptors.getDefaultInstance() : remote_; + } + /** + * .src.main.proto.NodeDescriptors remote = 6; + */ + public src.main.proto.GrpcService.NodeDescriptorsOrBuilder getRemoteOrBuilder() { + return getRemote(); + } + + public static final int AVAILABLEBW_FIELD_NUMBER = 7; + private float availableBw_; + /** + * float availableBw = 7; + */ + public float getAvailableBw() { + return availableBw_; + } + + public static final int RESIDUALBW_FIELD_NUMBER = 8; + private float residualBw_; + /** + * float residualBw = 8; + */ + public float getResidualBw() { + return residualBw_; + } + + public static final int UTILIZED_FIELD_NUMBER = 9; + private float utilized_; + /** + * float utilized = 9; + */ + public float getUtilized() { + return utilized_; + } + + public static final int MAXLINKDELAY_FIELD_NUMBER = 10; + private float maxLinkDelay_; + /** + * float maxLinkDelay = 10; + */ + public float getMaxLinkDelay() { + return maxLinkDelay_; + } + + public static final int MINLINKDELAY_FIELD_NUMBER = 11; + private float minLinkDelay_; + /** + * float minLinkDelay = 11; + */ + public float getMinLinkDelay() { + return minLinkDelay_; + } + + public static final int DELAYVARIATION_FIELD_NUMBER = 12; + private float delayVariation_; + /** + * float delayVariation = 12; + */ + public float getDelayVariation() { + return delayVariation_; + } + + public static final int DELAY_FIELD_NUMBER = 13; + private float delay_; + /** + * float delay = 13; + */ + public float getDelay() { + return delay_; + } + + public static final int TEDEFAULTMETRIC_FIELD_NUMBER = 14; + private int tEDefaultMetric_; + /** + * int32 TEDefaultMetric = 14; + */ + public int getTEDefaultMetric() { + return tEDefaultMetric_; + } + + public static final int ADJACENCYSID_FIELD_NUMBER = 15; + private volatile java.lang.Object adjacencySid_; + /** + * string adjacencySid = 15; + */ + public java.lang.String getAdjacencySid() { + java.lang.Object ref = adjacencySid_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + adjacencySid_ = s; + return s; + } + } + /** + * string adjacencySid = 15; + */ + public com.google.protobuf.ByteString + getAdjacencySidBytes() { + java.lang.Object ref = adjacencySid_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + adjacencySid_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int LEARNTFROM_FIELD_NUMBER = 16; + private volatile java.lang.Object learntFrom_; + /** + * string learntFrom = 16; + */ + public java.lang.String getLearntFrom() { + java.lang.Object ref = learntFrom_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + learntFrom_ = s; + return s; + } + } + /** + * string learntFrom = 16; + */ + public com.google.protobuf.ByteString + getLearntFromBytes() { + java.lang.Object ref = learntFrom_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + learntFrom_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getRemoteIDBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, remoteID_); + } + if (!getLocalIDBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, localID_); + } + if (!getRemoteIPv4IDBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, remoteIPv4ID_); + } + if (!getLocalIPv4IDBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, localIPv4ID_); + } + if (local_ != null) { + output.writeMessage(5, getLocal()); + } + if (remote_ != null) { + output.writeMessage(6, getRemote()); + } + if (availableBw_ != 0F) { + output.writeFloat(7, availableBw_); + } + if (residualBw_ != 0F) { + output.writeFloat(8, residualBw_); + } + if (utilized_ != 0F) { + output.writeFloat(9, utilized_); + } + if (maxLinkDelay_ != 0F) { + output.writeFloat(10, maxLinkDelay_); + } + if (minLinkDelay_ != 0F) { + output.writeFloat(11, minLinkDelay_); + } + if (delayVariation_ != 0F) { + output.writeFloat(12, delayVariation_); + } + if (delay_ != 0F) { + output.writeFloat(13, delay_); + } + if (tEDefaultMetric_ != 0) { + output.writeInt32(14, tEDefaultMetric_); + } + if (!getAdjacencySidBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 15, adjacencySid_); + } + if (!getLearntFromBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 16, learntFrom_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getRemoteIDBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, remoteID_); + } + if (!getLocalIDBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, localID_); + } + if (!getRemoteIPv4IDBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, remoteIPv4ID_); + } + if (!getLocalIPv4IDBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, localIPv4ID_); + } + if (local_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(5, getLocal()); + } + if (remote_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(6, getRemote()); + } + if (availableBw_ != 0F) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(7, availableBw_); + } + if (residualBw_ != 0F) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(8, residualBw_); + } + if (utilized_ != 0F) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(9, utilized_); + } + if (maxLinkDelay_ != 0F) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(10, maxLinkDelay_); + } + if (minLinkDelay_ != 0F) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(11, minLinkDelay_); + } + if (delayVariation_ != 0F) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(12, delayVariation_); + } + if (delay_ != 0F) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(13, delay_); + } + if (tEDefaultMetric_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(14, tEDefaultMetric_); + } + if (!getAdjacencySidBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(15, adjacencySid_); + } + if (!getLearntFromBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(16, learntFrom_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof src.main.proto.GrpcService.linkInfo)) { + return super.equals(obj); + } + src.main.proto.GrpcService.linkInfo other = (src.main.proto.GrpcService.linkInfo) obj; + + if (!getRemoteID() + .equals(other.getRemoteID())) return false; + if (!getLocalID() + .equals(other.getLocalID())) return false; + if (!getRemoteIPv4ID() + .equals(other.getRemoteIPv4ID())) return false; + if (!getLocalIPv4ID() + .equals(other.getLocalIPv4ID())) return false; + if (hasLocal() != other.hasLocal()) return false; + if (hasLocal()) { + if (!getLocal() + .equals(other.getLocal())) return false; + } + if (hasRemote() != other.hasRemote()) return false; + if (hasRemote()) { + if (!getRemote() + .equals(other.getRemote())) return false; + } + if (java.lang.Float.floatToIntBits(getAvailableBw()) + != java.lang.Float.floatToIntBits( + other.getAvailableBw())) return false; + if (java.lang.Float.floatToIntBits(getResidualBw()) + != java.lang.Float.floatToIntBits( + other.getResidualBw())) return false; + if (java.lang.Float.floatToIntBits(getUtilized()) + != java.lang.Float.floatToIntBits( + other.getUtilized())) return false; + if (java.lang.Float.floatToIntBits(getMaxLinkDelay()) + != java.lang.Float.floatToIntBits( + other.getMaxLinkDelay())) return false; + if (java.lang.Float.floatToIntBits(getMinLinkDelay()) + != java.lang.Float.floatToIntBits( + other.getMinLinkDelay())) return false; + if (java.lang.Float.floatToIntBits(getDelayVariation()) + != java.lang.Float.floatToIntBits( + other.getDelayVariation())) return false; + if (java.lang.Float.floatToIntBits(getDelay()) + != java.lang.Float.floatToIntBits( + other.getDelay())) return false; + if (getTEDefaultMetric() + != other.getTEDefaultMetric()) return false; + if (!getAdjacencySid() + .equals(other.getAdjacencySid())) return false; + if (!getLearntFrom() + .equals(other.getLearntFrom())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + REMOTEID_FIELD_NUMBER; + hash = (53 * hash) + getRemoteID().hashCode(); + hash = (37 * hash) + LOCALID_FIELD_NUMBER; + hash = (53 * hash) + getLocalID().hashCode(); + hash = (37 * hash) + REMOTEIPV4ID_FIELD_NUMBER; + hash = (53 * hash) + getRemoteIPv4ID().hashCode(); + hash = (37 * hash) + LOCALIPV4ID_FIELD_NUMBER; + hash = (53 * hash) + getLocalIPv4ID().hashCode(); + if (hasLocal()) { + hash = (37 * hash) + LOCAL_FIELD_NUMBER; + hash = (53 * hash) + getLocal().hashCode(); + } + if (hasRemote()) { + hash = (37 * hash) + REMOTE_FIELD_NUMBER; + hash = (53 * hash) + getRemote().hashCode(); + } + hash = (37 * hash) + AVAILABLEBW_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getAvailableBw()); + hash = (37 * hash) + RESIDUALBW_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getResidualBw()); + hash = (37 * hash) + UTILIZED_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getUtilized()); + hash = (37 * hash) + MAXLINKDELAY_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getMaxLinkDelay()); + hash = (37 * hash) + MINLINKDELAY_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getMinLinkDelay()); + hash = (37 * hash) + DELAYVARIATION_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getDelayVariation()); + hash = (37 * hash) + DELAY_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getDelay()); + hash = (37 * hash) + TEDEFAULTMETRIC_FIELD_NUMBER; + hash = (53 * hash) + getTEDefaultMetric(); + hash = (37 * hash) + ADJACENCYSID_FIELD_NUMBER; + hash = (53 * hash) + getAdjacencySid().hashCode(); + hash = (37 * hash) + LEARNTFROM_FIELD_NUMBER; + hash = (53 * hash) + getLearntFrom().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static src.main.proto.GrpcService.linkInfo parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static src.main.proto.GrpcService.linkInfo parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static src.main.proto.GrpcService.linkInfo parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static src.main.proto.GrpcService.linkInfo parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static src.main.proto.GrpcService.linkInfo parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static src.main.proto.GrpcService.linkInfo parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static src.main.proto.GrpcService.linkInfo parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static src.main.proto.GrpcService.linkInfo parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static src.main.proto.GrpcService.linkInfo parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static src.main.proto.GrpcService.linkInfo parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static src.main.proto.GrpcService.linkInfo parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static src.main.proto.GrpcService.linkInfo parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(src.main.proto.GrpcService.linkInfo prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code src.main.proto.linkInfo} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:src.main.proto.linkInfo) + src.main.proto.GrpcService.linkInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return src.main.proto.GrpcService.internal_static_src_main_proto_linkInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return src.main.proto.GrpcService.internal_static_src_main_proto_linkInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + src.main.proto.GrpcService.linkInfo.class, src.main.proto.GrpcService.linkInfo.Builder.class); + } + + // Construct using src.main.proto.GrpcService.linkInfo.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + remoteID_ = ""; + + localID_ = ""; + + remoteIPv4ID_ = ""; + + localIPv4ID_ = ""; + + if (localBuilder_ == null) { + local_ = null; + } else { + local_ = null; + localBuilder_ = null; + } + if (remoteBuilder_ == null) { + remote_ = null; + } else { + remote_ = null; + remoteBuilder_ = null; + } + availableBw_ = 0F; + + residualBw_ = 0F; + + utilized_ = 0F; + + maxLinkDelay_ = 0F; + + minLinkDelay_ = 0F; + + delayVariation_ = 0F; + + delay_ = 0F; + + tEDefaultMetric_ = 0; + + adjacencySid_ = ""; + + learntFrom_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return src.main.proto.GrpcService.internal_static_src_main_proto_linkInfo_descriptor; + } + + @java.lang.Override + public src.main.proto.GrpcService.linkInfo getDefaultInstanceForType() { + return src.main.proto.GrpcService.linkInfo.getDefaultInstance(); + } + + @java.lang.Override + public src.main.proto.GrpcService.linkInfo build() { + src.main.proto.GrpcService.linkInfo result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public src.main.proto.GrpcService.linkInfo buildPartial() { + src.main.proto.GrpcService.linkInfo result = new src.main.proto.GrpcService.linkInfo(this); + result.remoteID_ = remoteID_; + result.localID_ = localID_; + result.remoteIPv4ID_ = remoteIPv4ID_; + result.localIPv4ID_ = localIPv4ID_; + if (localBuilder_ == null) { + result.local_ = local_; + } else { + result.local_ = localBuilder_.build(); + } + if (remoteBuilder_ == null) { + result.remote_ = remote_; + } else { + result.remote_ = remoteBuilder_.build(); + } + result.availableBw_ = availableBw_; + result.residualBw_ = residualBw_; + result.utilized_ = utilized_; + result.maxLinkDelay_ = maxLinkDelay_; + result.minLinkDelay_ = minLinkDelay_; + result.delayVariation_ = delayVariation_; + result.delay_ = delay_; + result.tEDefaultMetric_ = tEDefaultMetric_; + result.adjacencySid_ = adjacencySid_; + result.learntFrom_ = learntFrom_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof src.main.proto.GrpcService.linkInfo) { + return mergeFrom((src.main.proto.GrpcService.linkInfo)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(src.main.proto.GrpcService.linkInfo other) { + if (other == src.main.proto.GrpcService.linkInfo.getDefaultInstance()) return this; + if (!other.getRemoteID().isEmpty()) { + remoteID_ = other.remoteID_; + onChanged(); + } + if (!other.getLocalID().isEmpty()) { + localID_ = other.localID_; + onChanged(); + } + if (!other.getRemoteIPv4ID().isEmpty()) { + remoteIPv4ID_ = other.remoteIPv4ID_; + onChanged(); + } + if (!other.getLocalIPv4ID().isEmpty()) { + localIPv4ID_ = other.localIPv4ID_; + onChanged(); + } + if (other.hasLocal()) { + mergeLocal(other.getLocal()); + } + if (other.hasRemote()) { + mergeRemote(other.getRemote()); + } + if (other.getAvailableBw() != 0F) { + setAvailableBw(other.getAvailableBw()); + } + if (other.getResidualBw() != 0F) { + setResidualBw(other.getResidualBw()); + } + if (other.getUtilized() != 0F) { + setUtilized(other.getUtilized()); + } + if (other.getMaxLinkDelay() != 0F) { + setMaxLinkDelay(other.getMaxLinkDelay()); + } + if (other.getMinLinkDelay() != 0F) { + setMinLinkDelay(other.getMinLinkDelay()); + } + if (other.getDelayVariation() != 0F) { + setDelayVariation(other.getDelayVariation()); + } + if (other.getDelay() != 0F) { + setDelay(other.getDelay()); + } + if (other.getTEDefaultMetric() != 0) { + setTEDefaultMetric(other.getTEDefaultMetric()); + } + if (!other.getAdjacencySid().isEmpty()) { + adjacencySid_ = other.adjacencySid_; + onChanged(); + } + if (!other.getLearntFrom().isEmpty()) { + learntFrom_ = other.learntFrom_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + src.main.proto.GrpcService.linkInfo parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (src.main.proto.GrpcService.linkInfo) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object remoteID_ = ""; + /** + * string remoteID = 1; + */ + public java.lang.String getRemoteID() { + java.lang.Object ref = remoteID_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + remoteID_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string remoteID = 1; + */ + public com.google.protobuf.ByteString + getRemoteIDBytes() { + java.lang.Object ref = remoteID_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + remoteID_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string remoteID = 1; + */ + public Builder setRemoteID( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + remoteID_ = value; + onChanged(); + return this; + } + /** + * string remoteID = 1; + */ + public Builder clearRemoteID() { + + remoteID_ = getDefaultInstance().getRemoteID(); + onChanged(); + return this; + } + /** + * string remoteID = 1; + */ + public Builder setRemoteIDBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + remoteID_ = value; + onChanged(); + return this; + } + + private java.lang.Object localID_ = ""; + /** + * string localID = 2; + */ + public java.lang.String getLocalID() { + java.lang.Object ref = localID_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + localID_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string localID = 2; + */ + public com.google.protobuf.ByteString + getLocalIDBytes() { + java.lang.Object ref = localID_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + localID_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string localID = 2; + */ + public Builder setLocalID( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + localID_ = value; + onChanged(); + return this; + } + /** + * string localID = 2; + */ + public Builder clearLocalID() { + + localID_ = getDefaultInstance().getLocalID(); + onChanged(); + return this; + } + /** + * string localID = 2; + */ + public Builder setLocalIDBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + localID_ = value; + onChanged(); + return this; + } + + private java.lang.Object remoteIPv4ID_ = ""; + /** + * string remoteIPv4ID = 3; + */ + public java.lang.String getRemoteIPv4ID() { + java.lang.Object ref = remoteIPv4ID_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + remoteIPv4ID_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string remoteIPv4ID = 3; + */ + public com.google.protobuf.ByteString + getRemoteIPv4IDBytes() { + java.lang.Object ref = remoteIPv4ID_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + remoteIPv4ID_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string remoteIPv4ID = 3; + */ + public Builder setRemoteIPv4ID( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + remoteIPv4ID_ = value; + onChanged(); + return this; + } + /** + * string remoteIPv4ID = 3; + */ + public Builder clearRemoteIPv4ID() { + + remoteIPv4ID_ = getDefaultInstance().getRemoteIPv4ID(); + onChanged(); + return this; + } + /** + * string remoteIPv4ID = 3; + */ + public Builder setRemoteIPv4IDBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + remoteIPv4ID_ = value; + onChanged(); + return this; + } + + private java.lang.Object localIPv4ID_ = ""; + /** + * string localIPv4ID = 4; + */ + public java.lang.String getLocalIPv4ID() { + java.lang.Object ref = localIPv4ID_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + localIPv4ID_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string localIPv4ID = 4; + */ + public com.google.protobuf.ByteString + getLocalIPv4IDBytes() { + java.lang.Object ref = localIPv4ID_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + localIPv4ID_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string localIPv4ID = 4; + */ + public Builder setLocalIPv4ID( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + localIPv4ID_ = value; + onChanged(); + return this; + } + /** + * string localIPv4ID = 4; + */ + public Builder clearLocalIPv4ID() { + + localIPv4ID_ = getDefaultInstance().getLocalIPv4ID(); + onChanged(); + return this; + } + /** + * string localIPv4ID = 4; + */ + public Builder setLocalIPv4IDBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + localIPv4ID_ = value; + onChanged(); + return this; + } + + private src.main.proto.GrpcService.NodeDescriptors local_; + private com.google.protobuf.SingleFieldBuilderV3< + src.main.proto.GrpcService.NodeDescriptors, src.main.proto.GrpcService.NodeDescriptors.Builder, src.main.proto.GrpcService.NodeDescriptorsOrBuilder> localBuilder_; + /** + * .src.main.proto.NodeDescriptors local = 5; + */ + public boolean hasLocal() { + return localBuilder_ != null || local_ != null; + } + /** + * .src.main.proto.NodeDescriptors local = 5; + */ + public src.main.proto.GrpcService.NodeDescriptors getLocal() { + if (localBuilder_ == null) { + return local_ == null ? src.main.proto.GrpcService.NodeDescriptors.getDefaultInstance() : local_; + } else { + return localBuilder_.getMessage(); + } + } + /** + * .src.main.proto.NodeDescriptors local = 5; + */ + public Builder setLocal(src.main.proto.GrpcService.NodeDescriptors value) { + if (localBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + local_ = value; + onChanged(); + } else { + localBuilder_.setMessage(value); + } + + return this; + } + /** + * .src.main.proto.NodeDescriptors local = 5; + */ + public Builder setLocal( + src.main.proto.GrpcService.NodeDescriptors.Builder builderForValue) { + if (localBuilder_ == null) { + local_ = builderForValue.build(); + onChanged(); + } else { + localBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .src.main.proto.NodeDescriptors local = 5; + */ + public Builder mergeLocal(src.main.proto.GrpcService.NodeDescriptors value) { + if (localBuilder_ == null) { + if (local_ != null) { + local_ = + src.main.proto.GrpcService.NodeDescriptors.newBuilder(local_).mergeFrom(value).buildPartial(); + } else { + local_ = value; + } + onChanged(); + } else { + localBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .src.main.proto.NodeDescriptors local = 5; + */ + public Builder clearLocal() { + if (localBuilder_ == null) { + local_ = null; + onChanged(); + } else { + local_ = null; + localBuilder_ = null; + } + + return this; + } + /** + * .src.main.proto.NodeDescriptors local = 5; + */ + public src.main.proto.GrpcService.NodeDescriptors.Builder getLocalBuilder() { + + onChanged(); + return getLocalFieldBuilder().getBuilder(); + } + /** + * .src.main.proto.NodeDescriptors local = 5; + */ + public src.main.proto.GrpcService.NodeDescriptorsOrBuilder getLocalOrBuilder() { + if (localBuilder_ != null) { + return localBuilder_.getMessageOrBuilder(); + } else { + return local_ == null ? + src.main.proto.GrpcService.NodeDescriptors.getDefaultInstance() : local_; + } + } + /** + * .src.main.proto.NodeDescriptors local = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + src.main.proto.GrpcService.NodeDescriptors, src.main.proto.GrpcService.NodeDescriptors.Builder, src.main.proto.GrpcService.NodeDescriptorsOrBuilder> + getLocalFieldBuilder() { + if (localBuilder_ == null) { + localBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + src.main.proto.GrpcService.NodeDescriptors, src.main.proto.GrpcService.NodeDescriptors.Builder, src.main.proto.GrpcService.NodeDescriptorsOrBuilder>( + getLocal(), + getParentForChildren(), + isClean()); + local_ = null; + } + return localBuilder_; + } + + private src.main.proto.GrpcService.NodeDescriptors remote_; + private com.google.protobuf.SingleFieldBuilderV3< + src.main.proto.GrpcService.NodeDescriptors, src.main.proto.GrpcService.NodeDescriptors.Builder, src.main.proto.GrpcService.NodeDescriptorsOrBuilder> remoteBuilder_; + /** + * .src.main.proto.NodeDescriptors remote = 6; + */ + public boolean hasRemote() { + return remoteBuilder_ != null || remote_ != null; + } + /** + * .src.main.proto.NodeDescriptors remote = 6; + */ + public src.main.proto.GrpcService.NodeDescriptors getRemote() { + if (remoteBuilder_ == null) { + return remote_ == null ? src.main.proto.GrpcService.NodeDescriptors.getDefaultInstance() : remote_; + } else { + return remoteBuilder_.getMessage(); + } + } + /** + * .src.main.proto.NodeDescriptors remote = 6; + */ + public Builder setRemote(src.main.proto.GrpcService.NodeDescriptors value) { + if (remoteBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + remote_ = value; + onChanged(); + } else { + remoteBuilder_.setMessage(value); + } + + return this; + } + /** + * .src.main.proto.NodeDescriptors remote = 6; + */ + public Builder setRemote( + src.main.proto.GrpcService.NodeDescriptors.Builder builderForValue) { + if (remoteBuilder_ == null) { + remote_ = builderForValue.build(); + onChanged(); + } else { + remoteBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .src.main.proto.NodeDescriptors remote = 6; + */ + public Builder mergeRemote(src.main.proto.GrpcService.NodeDescriptors value) { + if (remoteBuilder_ == null) { + if (remote_ != null) { + remote_ = + src.main.proto.GrpcService.NodeDescriptors.newBuilder(remote_).mergeFrom(value).buildPartial(); + } else { + remote_ = value; + } + onChanged(); + } else { + remoteBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .src.main.proto.NodeDescriptors remote = 6; + */ + public Builder clearRemote() { + if (remoteBuilder_ == null) { + remote_ = null; + onChanged(); + } else { + remote_ = null; + remoteBuilder_ = null; + } + + return this; + } + /** + * .src.main.proto.NodeDescriptors remote = 6; + */ + public src.main.proto.GrpcService.NodeDescriptors.Builder getRemoteBuilder() { + + onChanged(); + return getRemoteFieldBuilder().getBuilder(); + } + /** + * .src.main.proto.NodeDescriptors remote = 6; + */ + public src.main.proto.GrpcService.NodeDescriptorsOrBuilder getRemoteOrBuilder() { + if (remoteBuilder_ != null) { + return remoteBuilder_.getMessageOrBuilder(); + } else { + return remote_ == null ? + src.main.proto.GrpcService.NodeDescriptors.getDefaultInstance() : remote_; + } + } + /** + * .src.main.proto.NodeDescriptors remote = 6; + */ + private com.google.protobuf.SingleFieldBuilderV3< + src.main.proto.GrpcService.NodeDescriptors, src.main.proto.GrpcService.NodeDescriptors.Builder, src.main.proto.GrpcService.NodeDescriptorsOrBuilder> + getRemoteFieldBuilder() { + if (remoteBuilder_ == null) { + remoteBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + src.main.proto.GrpcService.NodeDescriptors, src.main.proto.GrpcService.NodeDescriptors.Builder, src.main.proto.GrpcService.NodeDescriptorsOrBuilder>( + getRemote(), + getParentForChildren(), + isClean()); + remote_ = null; + } + return remoteBuilder_; + } + + private float availableBw_ ; + /** + * float availableBw = 7; + */ + public float getAvailableBw() { + return availableBw_; + } + /** + * float availableBw = 7; + */ + public Builder setAvailableBw(float value) { + + availableBw_ = value; + onChanged(); + return this; + } + /** + * float availableBw = 7; + */ + public Builder clearAvailableBw() { + + availableBw_ = 0F; + onChanged(); + return this; + } + + private float residualBw_ ; + /** + * float residualBw = 8; + */ + public float getResidualBw() { + return residualBw_; + } + /** + * float residualBw = 8; + */ + public Builder setResidualBw(float value) { + + residualBw_ = value; + onChanged(); + return this; + } + /** + * float residualBw = 8; + */ + public Builder clearResidualBw() { + + residualBw_ = 0F; + onChanged(); + return this; + } + + private float utilized_ ; + /** + * float utilized = 9; + */ + public float getUtilized() { + return utilized_; + } + /** + * float utilized = 9; + */ + public Builder setUtilized(float value) { + + utilized_ = value; + onChanged(); + return this; + } + /** + * float utilized = 9; + */ + public Builder clearUtilized() { + + utilized_ = 0F; + onChanged(); + return this; + } + + private float maxLinkDelay_ ; + /** + * float maxLinkDelay = 10; + */ + public float getMaxLinkDelay() { + return maxLinkDelay_; + } + /** + * float maxLinkDelay = 10; + */ + public Builder setMaxLinkDelay(float value) { + + maxLinkDelay_ = value; + onChanged(); + return this; + } + /** + * float maxLinkDelay = 10; + */ + public Builder clearMaxLinkDelay() { + + maxLinkDelay_ = 0F; + onChanged(); + return this; + } + + private float minLinkDelay_ ; + /** + * float minLinkDelay = 11; + */ + public float getMinLinkDelay() { + return minLinkDelay_; + } + /** + * float minLinkDelay = 11; + */ + public Builder setMinLinkDelay(float value) { + + minLinkDelay_ = value; + onChanged(); + return this; + } + /** + * float minLinkDelay = 11; + */ + public Builder clearMinLinkDelay() { + + minLinkDelay_ = 0F; + onChanged(); + return this; + } + + private float delayVariation_ ; + /** + * float delayVariation = 12; + */ + public float getDelayVariation() { + return delayVariation_; + } + /** + * float delayVariation = 12; + */ + public Builder setDelayVariation(float value) { + + delayVariation_ = value; + onChanged(); + return this; + } + /** + * float delayVariation = 12; + */ + public Builder clearDelayVariation() { + + delayVariation_ = 0F; + onChanged(); + return this; + } + + private float delay_ ; + /** + * float delay = 13; + */ + public float getDelay() { + return delay_; + } + /** + * float delay = 13; + */ + public Builder setDelay(float value) { + + delay_ = value; + onChanged(); + return this; + } + /** + * float delay = 13; + */ + public Builder clearDelay() { + + delay_ = 0F; + onChanged(); + return this; + } + + private int tEDefaultMetric_ ; + /** + * int32 TEDefaultMetric = 14; + */ + public int getTEDefaultMetric() { + return tEDefaultMetric_; + } + /** + * int32 TEDefaultMetric = 14; + */ + public Builder setTEDefaultMetric(int value) { + + tEDefaultMetric_ = value; + onChanged(); + return this; + } + /** + * int32 TEDefaultMetric = 14; + */ + public Builder clearTEDefaultMetric() { + + tEDefaultMetric_ = 0; + onChanged(); + return this; + } + + private java.lang.Object adjacencySid_ = ""; + /** + * string adjacencySid = 15; + */ + public java.lang.String getAdjacencySid() { + java.lang.Object ref = adjacencySid_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + adjacencySid_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string adjacencySid = 15; + */ + public com.google.protobuf.ByteString + getAdjacencySidBytes() { + java.lang.Object ref = adjacencySid_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + adjacencySid_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string adjacencySid = 15; + */ + public Builder setAdjacencySid( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + adjacencySid_ = value; + onChanged(); + return this; + } + /** + * string adjacencySid = 15; + */ + public Builder clearAdjacencySid() { + + adjacencySid_ = getDefaultInstance().getAdjacencySid(); + onChanged(); + return this; + } + /** + * string adjacencySid = 15; + */ + public Builder setAdjacencySidBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + adjacencySid_ = value; + onChanged(); + return this; + } + + private java.lang.Object learntFrom_ = ""; + /** + * string learntFrom = 16; + */ + public java.lang.String getLearntFrom() { + java.lang.Object ref = learntFrom_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + learntFrom_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string learntFrom = 16; + */ + public com.google.protobuf.ByteString + getLearntFromBytes() { + java.lang.Object ref = learntFrom_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + learntFrom_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string learntFrom = 16; + */ + public Builder setLearntFrom( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + learntFrom_ = value; + onChanged(); + return this; + } + /** + * string learntFrom = 16; + */ + public Builder clearLearntFrom() { + + learntFrom_ = getDefaultInstance().getLearntFrom(); + onChanged(); + return this; + } + /** + * string learntFrom = 16; + */ + public Builder setLearntFromBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + learntFrom_ = value; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:src.main.proto.linkInfo) + } + + // @@protoc_insertion_point(class_scope:src.main.proto.linkInfo) + private static final src.main.proto.GrpcService.linkInfo DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new src.main.proto.GrpcService.linkInfo(); + } + + public static src.main.proto.GrpcService.linkInfo getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public linkInfo parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new linkInfo(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public src.main.proto.GrpcService.linkInfo getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface NodeDescriptorsOrBuilder extends + // @@protoc_insertion_point(interface_extends:src.main.proto.NodeDescriptors) + com.google.protobuf.MessageOrBuilder { + + /** + * string asNumber = 1; + */ + java.lang.String getAsNumber(); + /** + * string asNumber = 1; + */ + com.google.protobuf.ByteString + getAsNumberBytes(); + + /** + * string bgplsID = 2; + */ + java.lang.String getBgplsID(); + /** + * string bgplsID = 2; + */ + com.google.protobuf.ByteString + getBgplsIDBytes(); + } + /** + * Protobuf type {@code src.main.proto.NodeDescriptors} + */ + public static final class NodeDescriptors extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:src.main.proto.NodeDescriptors) + NodeDescriptorsOrBuilder { + private static final long serialVersionUID = 0L; + // Use NodeDescriptors.newBuilder() to construct. + private NodeDescriptors(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private NodeDescriptors() { + asNumber_ = ""; + bgplsID_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new NodeDescriptors(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private NodeDescriptors( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + asNumber_ = s; + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + bgplsID_ = s; + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return src.main.proto.GrpcService.internal_static_src_main_proto_NodeDescriptors_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return src.main.proto.GrpcService.internal_static_src_main_proto_NodeDescriptors_fieldAccessorTable + .ensureFieldAccessorsInitialized( + src.main.proto.GrpcService.NodeDescriptors.class, src.main.proto.GrpcService.NodeDescriptors.Builder.class); + } + + public static final int ASNUMBER_FIELD_NUMBER = 1; + private volatile java.lang.Object asNumber_; + /** + * string asNumber = 1; + */ + public java.lang.String getAsNumber() { + java.lang.Object ref = asNumber_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + asNumber_ = s; + return s; + } + } + /** + * string asNumber = 1; + */ + public com.google.protobuf.ByteString + getAsNumberBytes() { + java.lang.Object ref = asNumber_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + asNumber_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BGPLSID_FIELD_NUMBER = 2; + private volatile java.lang.Object bgplsID_; + /** + * string bgplsID = 2; + */ + public java.lang.String getBgplsID() { + java.lang.Object ref = bgplsID_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + bgplsID_ = s; + return s; + } + } + /** + * string bgplsID = 2; + */ + public com.google.protobuf.ByteString + getBgplsIDBytes() { + java.lang.Object ref = bgplsID_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + bgplsID_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getAsNumberBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, asNumber_); + } + if (!getBgplsIDBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, bgplsID_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getAsNumberBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, asNumber_); + } + if (!getBgplsIDBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, bgplsID_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof src.main.proto.GrpcService.NodeDescriptors)) { + return super.equals(obj); + } + src.main.proto.GrpcService.NodeDescriptors other = (src.main.proto.GrpcService.NodeDescriptors) obj; + + if (!getAsNumber() + .equals(other.getAsNumber())) return false; + if (!getBgplsID() + .equals(other.getBgplsID())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + ASNUMBER_FIELD_NUMBER; + hash = (53 * hash) + getAsNumber().hashCode(); + hash = (37 * hash) + BGPLSID_FIELD_NUMBER; + hash = (53 * hash) + getBgplsID().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static src.main.proto.GrpcService.NodeDescriptors parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static src.main.proto.GrpcService.NodeDescriptors parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static src.main.proto.GrpcService.NodeDescriptors parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static src.main.proto.GrpcService.NodeDescriptors parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static src.main.proto.GrpcService.NodeDescriptors parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static src.main.proto.GrpcService.NodeDescriptors parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static src.main.proto.GrpcService.NodeDescriptors parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static src.main.proto.GrpcService.NodeDescriptors parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static src.main.proto.GrpcService.NodeDescriptors parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static src.main.proto.GrpcService.NodeDescriptors parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static src.main.proto.GrpcService.NodeDescriptors parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static src.main.proto.GrpcService.NodeDescriptors parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(src.main.proto.GrpcService.NodeDescriptors prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code src.main.proto.NodeDescriptors} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:src.main.proto.NodeDescriptors) + src.main.proto.GrpcService.NodeDescriptorsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return src.main.proto.GrpcService.internal_static_src_main_proto_NodeDescriptors_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return src.main.proto.GrpcService.internal_static_src_main_proto_NodeDescriptors_fieldAccessorTable + .ensureFieldAccessorsInitialized( + src.main.proto.GrpcService.NodeDescriptors.class, src.main.proto.GrpcService.NodeDescriptors.Builder.class); + } + + // Construct using src.main.proto.GrpcService.NodeDescriptors.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + asNumber_ = ""; + + bgplsID_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return src.main.proto.GrpcService.internal_static_src_main_proto_NodeDescriptors_descriptor; + } + + @java.lang.Override + public src.main.proto.GrpcService.NodeDescriptors getDefaultInstanceForType() { + return src.main.proto.GrpcService.NodeDescriptors.getDefaultInstance(); + } + + @java.lang.Override + public src.main.proto.GrpcService.NodeDescriptors build() { + src.main.proto.GrpcService.NodeDescriptors result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public src.main.proto.GrpcService.NodeDescriptors buildPartial() { + src.main.proto.GrpcService.NodeDescriptors result = new src.main.proto.GrpcService.NodeDescriptors(this); + result.asNumber_ = asNumber_; + result.bgplsID_ = bgplsID_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof src.main.proto.GrpcService.NodeDescriptors) { + return mergeFrom((src.main.proto.GrpcService.NodeDescriptors)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(src.main.proto.GrpcService.NodeDescriptors other) { + if (other == src.main.proto.GrpcService.NodeDescriptors.getDefaultInstance()) return this; + if (!other.getAsNumber().isEmpty()) { + asNumber_ = other.asNumber_; + onChanged(); + } + if (!other.getBgplsID().isEmpty()) { + bgplsID_ = other.bgplsID_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + src.main.proto.GrpcService.NodeDescriptors parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (src.main.proto.GrpcService.NodeDescriptors) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object asNumber_ = ""; + /** + * string asNumber = 1; + */ + public java.lang.String getAsNumber() { + java.lang.Object ref = asNumber_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + asNumber_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string asNumber = 1; + */ + public com.google.protobuf.ByteString + getAsNumberBytes() { + java.lang.Object ref = asNumber_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + asNumber_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string asNumber = 1; + */ + public Builder setAsNumber( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + asNumber_ = value; + onChanged(); + return this; + } + /** + * string asNumber = 1; + */ + public Builder clearAsNumber() { + + asNumber_ = getDefaultInstance().getAsNumber(); + onChanged(); + return this; + } + /** + * string asNumber = 1; + */ + public Builder setAsNumberBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + asNumber_ = value; + onChanged(); + return this; + } + + private java.lang.Object bgplsID_ = ""; + /** + * string bgplsID = 2; + */ + public java.lang.String getBgplsID() { + java.lang.Object ref = bgplsID_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + bgplsID_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string bgplsID = 2; + */ + public com.google.protobuf.ByteString + getBgplsIDBytes() { + java.lang.Object ref = bgplsID_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + bgplsID_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string bgplsID = 2; + */ + public Builder setBgplsID( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + bgplsID_ = value; + onChanged(); + return this; + } + /** + * string bgplsID = 2; + */ + public Builder clearBgplsID() { + + bgplsID_ = getDefaultInstance().getBgplsID(); + onChanged(); + return this; + } + /** + * string bgplsID = 2; + */ + public Builder setBgplsIDBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + bgplsID_ = value; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:src.main.proto.NodeDescriptors) + } + + // @@protoc_insertion_point(class_scope:src.main.proto.NodeDescriptors) + private static final src.main.proto.GrpcService.NodeDescriptors DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new src.main.proto.GrpcService.NodeDescriptors(); + } + + public static src.main.proto.GrpcService.NodeDescriptors getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public NodeDescriptors parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new NodeDescriptors(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public src.main.proto.GrpcService.NodeDescriptors getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface updateResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:src.main.proto.updateResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * string ack = 1; + */ + java.lang.String getAck(); + /** + * string ack = 1; + */ + com.google.protobuf.ByteString + getAckBytes(); + } + /** + * Protobuf type {@code src.main.proto.updateResponse} + */ + public static final class updateResponse extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:src.main.proto.updateResponse) + updateResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use updateResponse.newBuilder() to construct. + private updateResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private updateResponse() { + ack_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new updateResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private updateResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + ack_ = s; + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return src.main.proto.GrpcService.internal_static_src_main_proto_updateResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return src.main.proto.GrpcService.internal_static_src_main_proto_updateResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + src.main.proto.GrpcService.updateResponse.class, src.main.proto.GrpcService.updateResponse.Builder.class); + } + + public static final int ACK_FIELD_NUMBER = 1; + private volatile java.lang.Object ack_; + /** + * string ack = 1; + */ + public java.lang.String getAck() { + java.lang.Object ref = ack_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + ack_ = s; + return s; + } + } + /** + * string ack = 1; + */ + public com.google.protobuf.ByteString + getAckBytes() { + java.lang.Object ref = ack_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + ack_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getAckBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, ack_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getAckBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, ack_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof src.main.proto.GrpcService.updateResponse)) { + return super.equals(obj); + } + src.main.proto.GrpcService.updateResponse other = (src.main.proto.GrpcService.updateResponse) obj; + + if (!getAck() + .equals(other.getAck())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + ACK_FIELD_NUMBER; + hash = (53 * hash) + getAck().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static src.main.proto.GrpcService.updateResponse parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static src.main.proto.GrpcService.updateResponse parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static src.main.proto.GrpcService.updateResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static src.main.proto.GrpcService.updateResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static src.main.proto.GrpcService.updateResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static src.main.proto.GrpcService.updateResponse parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static src.main.proto.GrpcService.updateResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static src.main.proto.GrpcService.updateResponse parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static src.main.proto.GrpcService.updateResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static src.main.proto.GrpcService.updateResponse parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static src.main.proto.GrpcService.updateResponse parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static src.main.proto.GrpcService.updateResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(src.main.proto.GrpcService.updateResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code src.main.proto.updateResponse} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:src.main.proto.updateResponse) + src.main.proto.GrpcService.updateResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return src.main.proto.GrpcService.internal_static_src_main_proto_updateResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return src.main.proto.GrpcService.internal_static_src_main_proto_updateResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + src.main.proto.GrpcService.updateResponse.class, src.main.proto.GrpcService.updateResponse.Builder.class); + } + + // Construct using src.main.proto.GrpcService.updateResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + ack_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return src.main.proto.GrpcService.internal_static_src_main_proto_updateResponse_descriptor; + } + + @java.lang.Override + public src.main.proto.GrpcService.updateResponse getDefaultInstanceForType() { + return src.main.proto.GrpcService.updateResponse.getDefaultInstance(); + } + + @java.lang.Override + public src.main.proto.GrpcService.updateResponse build() { + src.main.proto.GrpcService.updateResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public src.main.proto.GrpcService.updateResponse buildPartial() { + src.main.proto.GrpcService.updateResponse result = new src.main.proto.GrpcService.updateResponse(this); + result.ack_ = ack_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof src.main.proto.GrpcService.updateResponse) { + return mergeFrom((src.main.proto.GrpcService.updateResponse)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(src.main.proto.GrpcService.updateResponse other) { + if (other == src.main.proto.GrpcService.updateResponse.getDefaultInstance()) return this; + if (!other.getAck().isEmpty()) { + ack_ = other.ack_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + src.main.proto.GrpcService.updateResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (src.main.proto.GrpcService.updateResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object ack_ = ""; + /** + * string ack = 1; + */ + public java.lang.String getAck() { + java.lang.Object ref = ack_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + ack_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string ack = 1; + */ + public com.google.protobuf.ByteString + getAckBytes() { + java.lang.Object ref = ack_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + ack_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string ack = 1; + */ + public Builder setAck( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + ack_ = value; + onChanged(); + return this; + } + /** + * string ack = 1; + */ + public Builder clearAck() { + + ack_ = getDefaultInstance().getAck(); + onChanged(); + return this; + } + /** + * string ack = 1; + */ + public Builder setAckBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + ack_ = value; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:src.main.proto.updateResponse) + } + + // @@protoc_insertion_point(class_scope:src.main.proto.updateResponse) + private static final src.main.proto.GrpcService.updateResponse DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new src.main.proto.GrpcService.updateResponse(); + } + + public static src.main.proto.GrpcService.updateResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public updateResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new updateResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public src.main.proto.GrpcService.updateResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_src_main_proto_updateRequest_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_src_main_proto_updateRequest_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_src_main_proto_nodeInfo_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_src_main_proto_nodeInfo_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_src_main_proto_linkInfo_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_src_main_proto_linkInfo_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_src_main_proto_NodeDescriptors_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_src_main_proto_NodeDescriptors_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_src_main_proto_updateResponse_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_src_main_proto_updateResponse_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\021grpcService.proto\022\016src.main.proto\"\240\001\n\r" + + "updateRequest\022\027\n\017addressFamilyID\030\001 \001(\t\022\017" + + "\n\007nextHop\030\002 \001(\t\022\025\n\rasPathSegment\030\003 \001(\t\022&" + + "\n\004node\030\004 \003(\0132\030.src.main.proto.nodeInfo\022&" + + "\n\004link\030\005 \003(\0132\030.src.main.proto.linkInfo\"^" + + "\n\010nodeInfo\022\020\n\010nodeName\030\001 \001(\t\022\r\n\005igpID\030\002 " + + "\001(\t\022\017\n\007bgplsID\030\003 \001(\t\022\014\n\004asID\030\004 \001(\005\022\022\n\nle" + + "arntFrom\030\005 \001(\t\"\212\003\n\010linkInfo\022\020\n\010remoteID\030" + + "\001 \001(\t\022\017\n\007localID\030\002 \001(\t\022\024\n\014remoteIPv4ID\030\003" + + " \001(\t\022\023\n\013localIPv4ID\030\004 \001(\t\022.\n\005local\030\005 \001(\013" + + "2\037.src.main.proto.NodeDescriptors\022/\n\006rem" + + "ote\030\006 \001(\0132\037.src.main.proto.NodeDescripto" + + "rs\022\023\n\013availableBw\030\007 \001(\002\022\022\n\nresidualBw\030\010 " + + "\001(\002\022\020\n\010utilized\030\t \001(\002\022\024\n\014maxLinkDelay\030\n " + + "\001(\002\022\024\n\014minLinkDelay\030\013 \001(\002\022\026\n\016delayVariat" + + "ion\030\014 \001(\002\022\r\n\005delay\030\r \001(\002\022\027\n\017TEDefaultMet" + + "ric\030\016 \001(\005\022\024\n\014adjacencySid\030\017 \001(\t\022\022\n\nlearn" + + "tFrom\030\020 \001(\t\"4\n\017NodeDescriptors\022\020\n\010asNumb" + + "er\030\001 \001(\t\022\017\n\007bgplsID\030\002 \001(\t\"\035\n\016updateRespo" + + "nse\022\013\n\003ack\030\001 \001(\t2X\n\rupdateService\022G\n\006upd" + + "ate\022\035.src.main.proto.updateRequest\032\036.src" + + ".main.proto.updateResponseb\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }); + internal_static_src_main_proto_updateRequest_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_src_main_proto_updateRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_src_main_proto_updateRequest_descriptor, + new java.lang.String[] { "AddressFamilyID", "NextHop", "AsPathSegment", "Node", "Link", }); + internal_static_src_main_proto_nodeInfo_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_src_main_proto_nodeInfo_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_src_main_proto_nodeInfo_descriptor, + new java.lang.String[] { "NodeName", "IgpID", "BgplsID", "AsID", "LearntFrom", }); + internal_static_src_main_proto_linkInfo_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_src_main_proto_linkInfo_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_src_main_proto_linkInfo_descriptor, + new java.lang.String[] { "RemoteID", "LocalID", "RemoteIPv4ID", "LocalIPv4ID", "Local", "Remote", "AvailableBw", "ResidualBw", "Utilized", "MaxLinkDelay", "MinLinkDelay", "DelayVariation", "Delay", "TEDefaultMetric", "AdjacencySid", "LearntFrom", }); + internal_static_src_main_proto_NodeDescriptors_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_src_main_proto_NodeDescriptors_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_src_main_proto_NodeDescriptors_descriptor, + new java.lang.String[] { "AsNumber", "BgplsID", }); + internal_static_src_main_proto_updateResponse_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_src_main_proto_updateResponse_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_src_main_proto_updateResponse_descriptor, + new java.lang.String[] { "Ack", }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/src/bgpls_speaker/service/java/netphony-topology/updateWriter.json b/src/bgpls_speaker/service/java/netphony-topology/updateWriter.json new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/common/Constants.py b/src/common/Constants.py index 2cb7c3787be234a6b624dca5ab1bdaf3010c9ea1..f0fedba6f45d4d0f2520bafe3ab40365c6f6df3a 100644 --- a/src/common/Constants.py +++ b/src/common/Constants.py @@ -58,6 +58,7 @@ class ServiceNameEnum(Enum): OPTICALATTACKDETECTOR = 'opticalattackdetector' OPTICALATTACKMITIGATOR = 'opticalattackmitigator' CACHING = 'caching' + PCEP = 'pcep' TE = 'te' FORECASTER = 'forecaster' E2EORCHESTRATOR = 'e2e-orchestrator' @@ -74,6 +75,7 @@ class ServiceNameEnum(Enum): ANALYTICSBACKEND = 'analytics-backend' QOSPROFILE = 'qos-profile' OSMCLIENT = 'osm-client' + RESOURCEMANAGER = 'resource-manager' # Used for test and debugging only DLT_GATEWAY = 'dltgateway' @@ -105,6 +107,7 @@ DEFAULT_SERVICE_GRPC_PORTS = { ServiceNameEnum.QKD_APP .value : 10070, ServiceNameEnum.VNTMANAGER .value : 10080, ServiceNameEnum.BGPLS .value : 20030, + ServiceNameEnum.PCEP .value : 20050, ServiceNameEnum.QOSPROFILE .value : 20040, ServiceNameEnum.KPIMANAGER .value : 30010, ServiceNameEnum.KPIVALUEAPI .value : 30020, @@ -115,6 +118,7 @@ DEFAULT_SERVICE_GRPC_PORTS = { ServiceNameEnum.ANALYTICSBACKEND .value : 30090, ServiceNameEnum.AUTOMATION .value : 30200, ServiceNameEnum.OSMCLIENT .value : 30210, + ServiceNameEnum.RESOURCEMANAGER .value : 40010, # Used for test and debugging only ServiceNameEnum.DLT_GATEWAY .value : 50051, diff --git a/src/context/service/database/Link.py b/src/context/service/database/Link.py index 8176873dee99b5856df70e5ce38e4f53412e1a61..903ed98e72a4065d145d87e5edf86f35b9f5b38f 100644 --- a/src/context/service/database/Link.py +++ b/src/context/service/database/Link.py @@ -104,7 +104,9 @@ def link_set(db_engine : Engine, messagebroker : MessageBroker, request : Link) }) topology_uuids.add(endpoint_topology_uuid) - total_capacity_gbps, used_capacity_gbps = None, None + total_capacity_gbps, used_capacity_gbps, available_bw = None, None, None + link_delay, min_max_link_delay, delay_variation = None, None, None + if request.HasField('attributes'): attributes = request.attributes @@ -119,14 +121,35 @@ def link_set(db_engine : Engine, messagebroker : MessageBroker, request : Link) else: used_capacity_gbps = 0.0 + + if 'available_bw' in attribute_names: # Extraer available_bw + available_bw = attributes.available_bw + + else: + available_bw = 0.0 + + if 'link_delay' in attribute_names: + link_delay = attributes.link_delay + + if 'min_max_link_delay' in attribute_names: + min_max_link_delay = attributes.min_max_link_delay + + if 'delay_variation' in attribute_names: + delay_variation = attributes.delay_variation + link_data = [{ 'link_uuid' : link_uuid, 'link_name' : link_name, 'link_type' : link_type, 'total_capacity_gbps' : total_capacity_gbps, 'used_capacity_gbps' : used_capacity_gbps, + 'available_bw': available_bw, + 'link_delay' : link_delay, + 'min_max_link_delay' : min_max_link_delay, + 'delay_variation' : delay_variation, 'created_at' : now, 'updated_at' : now, + }] def callback(session : Session) -> Tuple[bool, List[Dict]]: @@ -138,6 +161,10 @@ def link_set(db_engine : Engine, messagebroker : MessageBroker, request : Link) link_type = stmt.excluded.link_type, total_capacity_gbps = stmt.excluded.total_capacity_gbps, used_capacity_gbps = stmt.excluded.used_capacity_gbps, + available_bw = stmt.excluded.available_bw, + link_delay = stmt.excluded.link_delay, + min_max_link_delay = stmt.excluded.min_max_link_delay, + delay_variation = stmt.excluded.delay_variation, updated_at = stmt.excluded.updated_at, ) ) diff --git a/src/context/service/database/models/LinkModel.py b/src/context/service/database/models/LinkModel.py index 77a9d9fa4e22693971b8f6fa24a16e826d9cdf36..b61357885d462cd9756c681dc850175235356327 100644 --- a/src/context/service/database/models/LinkModel.py +++ b/src/context/service/database/models/LinkModel.py @@ -31,8 +31,12 @@ class LinkModel(_Base): link_type = Column(Enum(ORM_LinkTypeEnum), nullable=False) total_capacity_gbps = Column(Float, nullable=True) used_capacity_gbps = Column(Float, nullable=True) + available_bw = Column(Float, nullable=True) created_at = Column(DateTime, nullable=False) updated_at = Column(DateTime, nullable=False) + link_delay = Column(Float, nullable=True) + min_max_link_delay = Column(Float, nullable=True) + delay_variation = Column(Float, nullable=True) #topology_links = relationship('TopologyLinkModel', back_populates='link') link_endpoints = relationship('LinkEndPointModel') # lazy='joined', back_populates='link' @@ -63,6 +67,18 @@ class LinkModel(_Base): if self.used_capacity_gbps is not None: attributes : Dict = result.setdefault('attributes', dict()) attributes.setdefault('used_capacity_gbps', self.used_capacity_gbps) + if self.available_bw is not None: + attributes: Dict = result.setdefault('attributes', dict()) + attributes.setdefault('available_bw', self.available_bw) + if self.link_delay is not None: + attributes: Dict = result.setdefault('attributes', dict()) + attributes.setdefault('link_delay', self.link_delay) + if self.min_max_link_delay is not None: + attributes: Dict = result.setdefault('attributes', dict()) + attributes.setdefault('min_max_link_delay', self.min_max_link_delay) + if self.delay_variation is not None: + attributes: Dict = result.setdefault('attributes', dict()) + attributes.setdefault('delay_variation', self.delay_variation) return result class LinkEndPointModel(_Base): diff --git a/src/device/service/driver_api/_Driver.py b/src/device/service/driver_api/_Driver.py index e8540b8728c902ec563822dd1780163a72bdcbd3..4777b89746aeed4a7594f9d1056032f08234e027 100644 --- a/src/device/service/driver_api/_Driver.py +++ b/src/device/service/driver_api/_Driver.py @@ -27,7 +27,6 @@ RESOURCE_ACL = '__acl__' RESOURCE_INVENTORY = '__inventory__' RESOURCE_RULES = "__rules__" - class _Driver: def __init__(self, name : str, address: str, port: int, **settings) -> None: """ Initialize Driver. diff --git a/src/device/service/drivers/openconfig/templates/__init__.py b/src/device/service/drivers/openconfig/templates/__init__.py index 47559efda07a08e9e56a980436d7dd1470556ecf..1a4620901be749d43b56f22249f8dae19792abf3 100644 --- a/src/device/service/drivers/openconfig/templates/__init__.py +++ b/src/device/service/drivers/openconfig/templates/__init__.py @@ -12,7 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -from ast import List, Tuple import json, logging, lxml.etree as ET, re import time from typing import Any, Dict, Optional @@ -33,7 +32,6 @@ from .acl.acl_adapter_ipinfusion_proprietary import acl_cr_to_dict_ipinfusion_pr LOGGER = logging.getLogger(__name__) ALL_RESOURCE_KEYS = [ - RESOURCE_INVENTORY, RESOURCE_ENDPOINTS, RESOURCE_INTERFACES, RESOURCE_ROUTING_POLICIES, # routing policies should come before network instances @@ -42,7 +40,6 @@ ALL_RESOURCE_KEYS = [ ] RESOURCE_KEY_MAPPINGS = { - RESOURCE_INVENTORY : 'inventory', RESOURCE_ENDPOINTS : 'component', RESOURCE_INTERFACES : 'interface', RESOURCE_NETWORK_INSTANCES: 'network_instance', @@ -51,7 +48,6 @@ RESOURCE_KEY_MAPPINGS = { } RESOURCE_PARSERS = { - 'inventory' : parse_inventory, 'component' : parse_endpoints, 'interface' : parse_interfaces, 'network_instance': parse_network_instances, diff --git a/src/pcep/.gitlab-ci.yml b/src/pcep/.gitlab-ci.yml new file mode 100644 index 0000000000000000000000000000000000000000..a755aa0b5897b2189347e15ca9e34f00df8ecf6d --- /dev/null +++ b/src/pcep/.gitlab-ci.yml @@ -0,0 +1,224 @@ +# Copyright 2022-2024 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# 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. + +# Build, tag, and push the Docker image to the GitLab Docker registry +build service: + variables: + IMAGE_NAME: 'pcep' # name of the microservice + IMAGE_TAG: 'latest' # tag of the container image (production, development, etc) + stage: build + before_script: + - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY + script: + - docker build -t "$IMAGE_NAME:$IMAGE_TAG" -f ./src/$IMAGE_NAME/Dockerfile . + - docker tag "$IMAGE_NAME:$IMAGE_TAG" "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG" + - docker push "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG" + after_script: + - docker images --filter="dangling=true" --quiet | xargs -r docker rmi + rules: + - if: '$CI_PIPELINE_SOURCE == "merge_request_event" && ($CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "develop" || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH)' + - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "develop"' + - changes: + - src/common/**/*.py + - proto/*.proto + - src/$IMAGE_NAME/**/*.{py,in,yml} + - src/$IMAGE_NAME/Dockerfile + - src/$IMAGE_NAME/tests/*.py + - manifests/${IMAGE_NAME}service.yaml + - .gitlab-ci.yml + +# Apply unit test to the component +unit_test service: + variables: + IMAGE_NAME: 'pcep' # name of the microservice + IMAGE_TAG: 'latest' # tag of the container image (production, development, etc) + stage: unit_test + needs: + - build service + before_script: + - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY + - if docker network list | grep teraflowbridge; then echo "teraflowbridge is already created"; else docker network create --driver=bridge teraflowbridge; fi + + # Context-related + - if docker container ls | grep crdb; then docker rm -f crdb; else echo "CockroachDB container is not in the system"; fi + - if docker volume ls | grep crdb; then docker volume rm -f crdb; else echo "CockroachDB volume is not in the system"; fi + - if docker container ls | grep nats; then docker rm -f nats; else echo "NATS container is not in the system"; fi + + # Device-related + - if docker container ls | grep context; then docker rm -f context; else echo "context image is not in the system"; fi + - if docker container ls | grep device; then docker rm -f device; else echo "device image is not in the system"; fi + + # Pathcomp-related + - if docker container ls | grep pathcomp-frontend; then docker rm -f pathcomp-frontend; else echo "pathcomp-frontend image is not in the system"; fi + - if docker container ls | grep pathcomp-backend; then docker rm -f pathcomp-backend; else echo "pathcomp-backend image is not in the system"; fi + + # Service-related + - if docker container ls | grep $IMAGE_NAME; then docker rm -f $IMAGE_NAME; else echo "$IMAGE_NAME image is not in the system"; fi + + script: + - docker pull "cockroachdb/cockroach:latest-v22.2" + - docker pull "nats:2.9" + - docker pull "$CI_REGISTRY_IMAGE/context:$IMAGE_TAG" + - docker pull "$CI_REGISTRY_IMAGE/device:$IMAGE_TAG" + - docker pull "$CI_REGISTRY_IMAGE/pathcomp-frontend:$IMAGE_TAG" + - docker pull "$CI_REGISTRY_IMAGE/pathcomp-backend:$IMAGE_TAG" + - docker pull "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG" + + # Context preparation + - docker volume create crdb + - > + docker run --name crdb -d --network=teraflowbridge -p 26257:26257 -p 8080:8080 + --env COCKROACH_DATABASE=tfs_test --env COCKROACH_USER=tfs --env COCKROACH_PASSWORD=tfs123 + --volume "crdb:/cockroach/cockroach-data" + cockroachdb/cockroach:latest-v22.2 start-single-node + - > + docker run --name nats -d --network=teraflowbridge -p 4222:4222 -p 8222:8222 + nats:2.9 --http_port 8222 --user tfs --pass tfs123 + - echo "Waiting for initialization..." + - while ! docker logs crdb 2>&1 | grep -q 'finished creating default user \"tfs\"'; do sleep 1; done + - docker logs crdb + - while ! docker logs nats 2>&1 | grep -q 'Server is ready'; do sleep 1; done + - docker logs nats + - docker ps -a + - CRDB_ADDRESS=$(docker inspect crdb --format "{{.NetworkSettings.Networks.teraflowbridge.IPAddress}}") + - echo $CRDB_ADDRESS + - NATS_ADDRESS=$(docker inspect nats --format "{{.NetworkSettings.Networks.teraflowbridge.IPAddress}}") + - echo $NATS_ADDRESS + - > + docker run --name context -d -p 1010:1010 + --env "CRDB_URI=cockroachdb://tfs:tfs123@${CRDB_ADDRESS}:26257/tfs_test?sslmode=require" + --env "MB_BACKEND=nats" + --env "NATS_URI=nats://tfs:tfs123@${NATS_ADDRESS}:4222" + --network=teraflowbridge + $CI_REGISTRY_IMAGE/context:$IMAGE_TAG + - CONTEXTSERVICE_SERVICE_HOST=$(docker inspect context --format "{{.NetworkSettings.Networks.teraflowbridge.IPAddress}}") + - echo $CONTEXTSERVICE_SERVICE_HOST + + # Device preparation + - > + docker run --name device -d -p 2020:2020 + --env "CONTEXTSERVICE_SERVICE_HOST=${CONTEXTSERVICE_SERVICE_HOST}" + --network=teraflowbridge + $CI_REGISTRY_IMAGE/device:$IMAGE_TAG + - DEVICESERVICE_SERVICE_HOST=$(docker inspect device --format "{{.NetworkSettings.Networks.teraflowbridge.IPAddress}}") + - echo $DEVICESERVICE_SERVICE_HOST + + # PathComp preparation + - > + docker run --name pathcomp-backend -d -p 8081:8081 + --network=teraflowbridge + $CI_REGISTRY_IMAGE/pathcomp-backend:$IMAGE_TAG + - PATHCOMP_BACKEND_HOST=$(docker inspect pathcomp-backend --format "{{.NetworkSettings.Networks.teraflowbridge.IPAddress}}") + - echo $PATHCOMP_BACKEND_HOST + - sleep 1 + - > + docker run --name pathcomp-frontend -d -p 10020:10020 + --env "CONTEXTSERVICE_SERVICE_HOST=${CONTEXTSERVICE_SERVICE_HOST}" + --env "PATHCOMP_BACKEND_HOST=${PATHCOMP_BACKEND_HOST}" + --env "PATHCOMP_BACKEND_PORT=8081" + --network=teraflowbridge + $CI_REGISTRY_IMAGE/pathcomp-frontend:$IMAGE_TAG + - sleep 1 + - PATHCOMPSERVICE_SERVICE_HOST=$(docker inspect pathcomp-frontend --format "{{.NetworkSettings.Networks.teraflowbridge.IPAddress}}") + - echo $PATHCOMPSERVICE_SERVICE_HOST + + # Service preparation + - > + docker run --name $IMAGE_NAME -d -p 3030:3030 -p 4189:4189 -p 6666:6666 + --env "CONTEXTSERVICE_SERVICE_HOST=${CONTEXTSERVICE_SERVICE_HOST}" + --env "DEVICESERVICE_SERVICE_HOST=${DEVICESERVICE_SERVICE_HOST}" + --env "PATHCOMPSERVICE_SERVICE_HOST=${PATHCOMPSERVICE_SERVICE_HOST}" + --volume "$PWD/src/$IMAGE_NAME/tests:/opt/results" + --network=teraflowbridge + $CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG + + # Check status before the tests + - sleep 5 + - docker ps -a + - docker logs context + - docker logs device + - docker logs pathcomp-frontend + - docker logs pathcomp-backend + - docker logs $IMAGE_NAME + + # Run the tests + - > + docker exec -i $IMAGE_NAME bash -c + "coverage run -m pytest --log-level=INFO --verbose $IMAGE_NAME/tests/test_unitary.py --junitxml=/opt/results/${IMAGE_NAME}_report.xml" + - docker exec -i $IMAGE_NAME bash -c "coverage report --include='${IMAGE_NAME}/*' --show-missing" + + coverage: '/TOTAL\s+\d+\s+\d+\s+(\d+%)/' + after_script: + # Check status after the tests + - docker ps -a + - docker logs context + - docker logs device + - docker logs pathcomp-frontend + - docker logs pathcomp-backend + - docker logs $IMAGE_NAME + + - docker rm -f $IMAGE_NAME + - docker rm -f pathcomp-frontend + - docker rm -f pathcomp-backend + - docker rm -f device + - docker rm -f context + + - docker rm -f $IMAGE_NAME crdb nats + - docker volume rm -f crdb + - docker network rm teraflowbridge + - docker volume prune --force + - docker image prune --force + + rules: + - if: '$CI_PIPELINE_SOURCE == "merge_request_event" && ($CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "develop" || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH)' + - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "develop"' + - changes: + - src/common/**/*.py + - proto/*.proto + - src/$IMAGE_NAME/**/*.{py,in,yml} + - src/$IMAGE_NAME/Dockerfile + - src/$IMAGE_NAME/tests/*.py + - manifests/${IMAGE_NAME}service.yaml + - .gitlab-ci.yml + + artifacts: + when: always + reports: + junit: src/$IMAGE_NAME/tests/${IMAGE_NAME}_report.xml + +## Deployment of the service in Kubernetes Cluster +#deploy service: +# variables: +# IMAGE_NAME: 'service' # name of the microservice +# IMAGE_TAG: 'latest' # tag of the container image (production, development, etc) +# stage: deploy +# needs: +# - unit test service +# # - integ_test execute +# script: +# - 'sed -i "s/$IMAGE_NAME:.*/$IMAGE_NAME:$IMAGE_TAG/" manifests/${IMAGE_NAME}service.yaml' +# - kubectl version +# - kubectl get all +# - kubectl apply -f "manifests/${IMAGE_NAME}service.yaml" +# - kubectl get all +# # environment: +# # name: test +# # url: https://example.com +# # kubernetes: +# # namespace: test +# rules: +# - if: '$CI_PIPELINE_SOURCE == "merge_request_event" && ($CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "develop" || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH)' +# when: manual +# - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "develop"' +# when: manual diff --git a/src/pcep/Config.py b/src/pcep/Config.py new file mode 100644 index 0000000000000000000000000000000000000000..a5ccb6078c2c18285753cacb045f9614017f8485 --- /dev/null +++ b/src/pcep/Config.py @@ -0,0 +1,14 @@ +# Copyright 2022-2024 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# 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/pcep/Dockerfile b/src/pcep/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..ac859cc6604e12faa6b9ac1368fc97be2bf1f51a --- /dev/null +++ b/src/pcep/Dockerfile @@ -0,0 +1,99 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# 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. + +FROM python:3.9-slim + +# Install dependencies +RUN apt-get --yes --quiet --quiet update && \ + apt-get --yes --quiet --quiet install wget g++ libxml2-dev libxslt-dev iputils-ping && \ + rm -rf /var/lib/apt/lists/* + +# Set Python to show logs as they occur +ENV PYTHONUNBUFFERED=0 + +# Download the gRPC health probe +RUN GRPC_HEALTH_PROBE_VERSION=v0.2.0 && \ + wget -qO/bin/grpc_health_probe https://github.com/grpc-ecosystem/grpc-health-probe/releases/download/${GRPC_HEALTH_PROBE_VERSION}/grpc_health_probe-linux-amd64 && \ + chmod +x /bin/grpc_health_probe + +#Ping +RUN apt-get update && apt-get install -y iputils-ping g++ && \ + rm -rf /var/lib/apt/lists/* + +# Get generic Python packages +RUN python3 -m pip install --upgrade pip +RUN python3 -m pip install --upgrade setuptools wheel +RUN python3 -m pip install --upgrade pip-tools + +# Install OpenJDK-21 +RUN apt-get update && \ + apt-get install -y openjdk-21-jre && \ + apt-get clean; + +# Get common Python packages +# Note: this step enables sharing the previous Docker build steps among all the Python components +WORKDIR /var/teraflow +COPY common_requirements.in common_requirements.in +RUN pip-compile --quiet --output-file=common_requirements.txt common_requirements.in +RUN python3 -m pip install -r common_requirements.txt + +# Add common files into working directory +WORKDIR /var/teraflow/common +COPY src/common/. ./ +RUN rm -rf proto + +# Create proto sub-folder, copy .proto files, and generate Python code +RUN mkdir -p /var/teraflow/common/proto +WORKDIR /var/teraflow/common/proto +RUN touch __init__.py +COPY proto/*.proto ./ +RUN python3 -m grpc_tools.protoc -I=. --python_out=. --grpc_python_out=. *.proto +RUN rm *.proto +RUN find . -type f -exec sed -i -E 's/(import\ .*)_pb2/from . \1_pb2/g' {} \; + +# Create component sub-folders, get specific Python packages +RUN mkdir -p /var/teraflow/pcep +WORKDIR /var/teraflow/pcep +COPY src/pcep/requirements.in requirements.in +RUN pip-compile --quiet --output-file=requirements.txt requirements.in +RUN python3 -m pip install -r requirements.txt + +# # Install Kubernetes Python client +# RUN python3 -m pip install kubernetes + +# # Java module necessary config files +# WORKDIR /var/teraflow/pcep +# RUN mkdir -p /resources +# COPY src/pcep/service/resources/. resources/ + +# Add the Tools Module +WORKDIR /var/teraflow/pcep +RUN mkdir -p /tools +COPY src/pcep/service/tools/. resources/ + +# Add component files into working directory +WORKDIR /var/teraflow +COPY src/context/. context/ +COPY src/device/. device/ +COPY src/pathcomp/frontend/. pathcomp/frontend/ +COPY src/service/. service/ +COPY src/pcep/. pcep/ + +#Added +EXPOSE 4189 +EXPOSE 6666 +EXPOSE 10060 + +# Start the service +ENTRYPOINT ["python", "-m", "pcep.service"] diff --git a/src/pcep/README.txt b/src/pcep/README.txt new file mode 100644 index 0000000000000000000000000000000000000000..b1e6954867efe9e2caa8c026424b0ddc6529501c --- /dev/null +++ b/src/pcep/README.txt @@ -0,0 +1,13 @@ +The actual computation logic and PCEP handling is implemented in Java within the [Netphony-PCE repository], specifically in the **new_module_pce** branch. + To execute: + # 1: cd Netphony/netphony-pce/ + # 2: docker build -t netphony-pce . + # 3: docker run -d -p 4189:4189 -p 6666:6666 -p 10060:10060 --name netphony-pce-container netphony-pce + + +This Python module communicates with it via a gRPC interface. + +Current Status: +Fully functional Python gRPC client-server service. +Sends LSP requests to external Java-based PCE via gRPC. +Receives and manages LSP information in CockroachDatabase. \ No newline at end of file diff --git a/src/pcep/__init__.py b/src/pcep/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..a5ccb6078c2c18285753cacb045f9614017f8485 --- /dev/null +++ b/src/pcep/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2022-2024 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# 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/pcep/client/PcepClient.py b/src/pcep/client/PcepClient.py new file mode 100644 index 0000000000000000000000000000000000000000..f4d1b841ced2656fad532951751926b7950131d3 --- /dev/null +++ b/src/pcep/client/PcepClient.py @@ -0,0 +1,149 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# 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. + +import grpc, logging +from common.Constants import ServiceNameEnum +from common.Settings import get_service_host, get_service_port_grpc +from common.proto.context_pb2 import Empty, Service, ServiceId +from common.proto.pcep_pb2_grpc import PcepServiceStub +from common.proto.pcep_pb2 import RequestRq, RequestRp, PceIpRq, PceIpRp, LSPdb_Response, LSPdb_Request, commandResponse +from common.tools.client.RetryDecorator import retry, delay_exponential +from common.tools.grpc.Tools import grpc_message_to_json_string + +from common.proto.pcep_pb2 import Session_Request, commandRequest +from common.proto.pcep_pb2_grpc import PcepServiceStub as pceServiceStub + + + +LOGGER = logging.getLogger(__name__) +MAX_RETRIES = 15 +DELAY_FUNCTION = delay_exponential(initial=0.01, increment=2.0, maximum=5.0) +RETRY_DECORATOR = retry(max_retries=MAX_RETRIES, delay_function=DELAY_FUNCTION, prepare_method_name='connect') + +PORT = 10060 + +class PcepClient: + def __init__(self, host=None, port=None): + if not host: host = get_service_host(ServiceNameEnum.PCEP) + + # if not host: host = PcepClient.get_loadbalancer_ip('pcepservice') + + if not port: port = get_service_port_grpc(ServiceNameEnum.PCEP) + + # if not port: port = port = PcepClient.get_loadbalancer_port('pcepservice', namespace='tfs', target_port_name='grpc') + + self.endpoint = '{:s}:{:s}'.format(str(host), str(port)) + LOGGER.info('Creating channel to {:s}...'.format(str(self.endpoint))) + self.channel = None + self.stub = None + self.connect() + LOGGER.info('Channel created') + + # # # Inicializamos LspDB para acceder a la base de datos + # self.lsp_db = LspDB() + # self.lsp_db.create_database() + # self.lsp_db.create_tables() + # self.lsp_db.verify_tables() + + def connect(self): + LOGGER.debug('Creating channel to {:s}...'.format(str(self.endpoint))) + self.channel = grpc.insecure_channel(self.endpoint) + self.stub = PcepServiceStub(self.channel) + self.host = get_service_host(ServiceNameEnum.PCEP) + LOGGER.debug('Channel created') + + def close(self): + if self.channel is not None: self.channel.close() + self.channel = None + self.stub = None + + + + + + @RETRY_DECORATOR + def sendRequest(self, request : RequestRq) -> commandResponse: + LOGGER.debug('Send request: {:s}'.format(grpc_message_to_json_string(request))) + response = self.stub.sendRequest(request) + LOGGER.debug('Send request result: {:s}'.format(grpc_message_to_json_string(response))) + return response + + @RETRY_DECORATOR + def configuratePCE(self, request : PceIpRq) -> PceIpRp: + LOGGER.debug("Configuring the PCE") + LOGGER.debug('Configurate PCE: {:s}'.format(grpc_message_to_json_string(request))) + response = self.stub.configuratePCE(request) + LOGGER.debug('Configurate PCE result: {:s}'.format(grpc_message_to_json_string(response))) + return response + + + # @RETRY_DECORATOR + # def showLSPDB(self): + # LOGGER.debug("Showing the LSP Paths in the PCE") + # requestlsp = LSPdb_Request() + # channel = grpc.insecure_channel(f'{self.host}:{PORT}') + # stub_lsp = pceServiceStub(channel) + # responselsp = stub_lsp.getLSPdb(requestlsp) + # # responselsp = self.stub.getLSPdb(request) + # LOGGER.warning("IAM IN SHOWLSP: {:s}".format(str(responselsp))) + # return responselsp + + # @RETRY_DECORATOR + # def showLSPDB(self): + # LOGGER.debug("Showing the LSP Paths from the database") + # # Llamamos a LspDB para obtener la lista de LSPs + # try: + # lsp_info = LspDB.show_lsp_db() + # LOGGER.info(f"Información de LSPs: {lsp_info}") + # return lsp_info + # except Exception as e: + # LOGGER.error(f"Error al obtener la información de LSP desde la base de datos: {str(e)}") + # return None + + #EL BUENO + # @RETRY_DECORATOR + # def showLSPDB(self): + # LOGGER.debug("Showing the LSP Paths in the PCE") + # requestlsp = LSPdb_Request() + # responselsp = self.stub.getLSPdb(requestlsp) + # LOGGER.warning("IAM IN SHOWLSP: {:s}".format(str(responselsp))) + # return responselsp + + @RETRY_DECORATOR + def showSessions(self): + requestsessions = Session_Request() + # channel = grpc.insecure_channel(f'{self.host}:{PORT}') + # stub_sessions = pceServiceStub(channel) + responsesessions = self.stub.getSessionsInfo(requestsessions) + LOGGER.warning("IAM IN SHOWSESSIONS: {:s}".format(str(responsesessions))) + return responsesessions + + @RETRY_DECORATOR + def sendUpdate(self, data): + LOGGER.warning("IAM IN SEND UPDATE") + commandrequest = commandRequest() # Create an instance without passing data to __init__ + commandrequest.command = data + + LOGGER.warning("This is Command Request: %s", str(commandrequest)) + + channel = grpc.insecure_channel(f'{self.host}:{PORT}') + stub_update = pceServiceStub(channel) + commandresponse = stub_update.update(commandrequest) + + LOGGER.warning("This is Command Response: %s", str(commandresponse)) + + LOGGER.warning("Success: %s", str(commandresponse.success)) + LOGGER.warning("Error Message: %s", str(commandresponse.error_message)) + return commandresponse + diff --git a/src/pcep/client/__init__.py b/src/pcep/client/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..1549d9811aa5d1c193a44ad45d0d7773236c0612 --- /dev/null +++ b/src/pcep/client/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# 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/pcep/database/LSPEngine.py b/src/pcep/database/LSPEngine.py new file mode 100644 index 0000000000000000000000000000000000000000..cc54b07b6ecfe42cdecf9d1265cfa38913b45a3e --- /dev/null +++ b/src/pcep/database/LSPEngine.py @@ -0,0 +1,27 @@ + +import logging, sqlalchemy +from common.Settings import get_setting + +LOGGER = logging.getLogger(__name__) +CRDB_URI_TEMPLATE = 'cockroachdb://{:s}:{:s}@cockroachdb-public.{:s}.svc.cluster.local:{:s}/{:s}?sslmode={:s}' + +class LSPEngine: + @staticmethod + def get_engine() -> sqlalchemy.engine.Engine: + crdb_uri = get_setting('CRDB_URI', default=None) + if crdb_uri is None: + CRDB_NAMESPACE = get_setting('CRDB_NAMESPACE') + CRDB_SQL_PORT = get_setting('CRDB_SQL_PORT') + CRDB_DATABASE_LSP_MGMT = 'tfs_lsp_mgmt' # TODO: define variable get_setting('CRDB_DATABASE_KPI_MGMT') + CRDB_USERNAME = get_setting('CRDB_USERNAME') + CRDB_PASSWORD = get_setting('CRDB_PASSWORD') + CRDB_SSLMODE = get_setting('CRDB_SSLMODE') + crdb_uri = CRDB_URI_TEMPLATE.format( + CRDB_USERNAME, CRDB_PASSWORD, CRDB_NAMESPACE, CRDB_SQL_PORT, CRDB_DATABASE_LSP_MGMT, CRDB_SSLMODE) + try: + engine = sqlalchemy.create_engine(crdb_uri, echo=False) + LOGGER.info(' LspDB initalized with DB URL: {:}'.format(crdb_uri)) + except: # pylint: disable=bare-except # pragma: no cover + LOGGER.exception('Failed to connect to database: {:s}'.format(str(crdb_uri))) + return None # type: ignore + return engine \ No newline at end of file diff --git a/src/pcep/database/LSPModel.py b/src/pcep/database/LSPModel.py new file mode 100644 index 0000000000000000000000000000000000000000..eb94db9f42cae982dc054074505212d0657c2728 --- /dev/null +++ b/src/pcep/database/LSPModel.py @@ -0,0 +1,81 @@ +import logging +from sqlalchemy.dialects.postgresql import UUID +from sqlalchemy import Column, Integer, String, Text, Boolean +from sqlalchemy.orm import registry, Session +from common.proto.pcep_pb2 import LspDescriptor +import uuid + +# Configuración del logger +logging.basicConfig(level=logging.INFO) +LOGGER = logging.getLogger(__name__) + +# Base para los modelos declarativos +Base = registry().generate_base() +class LspModel(Base): + __tablename__ = 'lsp' + + lsp_uuid = Column(UUID(as_uuid=True), primary_key=True) + srp = Column(Text, nullable=True) # Puede ser null + lsp = Column(Text, nullable=True) # Se almacena en JSON + path = Column(Text, nullable=True) # Se almacena en JSON + associationlist = Column(Text, nullable=True) # Se almacena en JSON + + def __repr__(self): + return (f"") + + @staticmethod + def get_all_columns(): + return LspModel.__table__.columns.keys() + + # @staticmethod + # def get_all_data(): + # """Ejecuta 'SELECT * FROM lsp' y devuelve los resultados.""" + # session = Session() + # try: + # result = session.execute(text("SELECT * FROM lsp")) # Ejecuta la consulta SQL pura + # rows = result.fetchall() # Obtiene todas las filas + # session.close() + # return rows # Devuelve una lista de tuplas con los datos + # except Exception as e: + # session.rollback() + # LOGGER.error(f"Error al obtener los datos de la base de datos: {e}") + # return None + + @classmethod + def convert_LspDescriptor_to_row(cls, request): + """ + Create an instance of Lsp from a request object. + + Args: + request: The request object containing the data. + + Returns: + An instance of Lsp initialized with data from the request. + """ + return cls( + lsp_uuid = uuid.UUID(request.lsp_uuid), # Convertir a UUID de la request + srp = request.srp, + lsp = request.lsp, + path = request.path, + associationlist = request.associationlist + ) + + @classmethod + def convert_row_to_LspDescriptor(cls, row): + """ + Create and return an LspDescriptor object from a Lsp instance. + + Args: + row: The Lsp instance (row) containing the data. + + Returns: + LspDescriptor object + """ + response = LspDescriptor() + response.lsp_uuid = str(row.lsp_uuid) # Si lsp_uuid es UUID, convertir a string + response.srp = row.srp + response.lsp = row.lsp + response.path = row.path + response.associationlist = row.associationlist + return response diff --git a/src/pcep/database/LSP_DB.py b/src/pcep/database/LSP_DB.py new file mode 100644 index 0000000000000000000000000000000000000000..63926a5a39d0547ef629f6cccb2741ac95940bbc --- /dev/null +++ b/src/pcep/database/LSP_DB.py @@ -0,0 +1,181 @@ +import logging +from sqlalchemy import inspect +import sqlalchemy_utils +from sqlalchemy.orm import sessionmaker +from pcep.database.LSPEngine import LSPEngine +from pcep.database.LSPModel import LspModel as LspModel +from common.method_wrappers.ServiceExceptions import ( + AlreadyExistsException, OperationFailedException , NotFoundException) + +LOGGER = logging.getLogger(__name__) +DB_NAME = "tfs_lsp_mgmt" + +class LspDB: + def __init__(self): + self.db_engine = LSPEngine.get_engine() + if self.db_engine is None: + LOGGER.error('Unable to get SQLAlchemy DB Engine...') + return None + #return False + self.db_name = DB_NAME + self.Session = sessionmaker(bind=self.db_engine) + + def create_database(self) -> None: + if not sqlalchemy_utils.database_exists(self.db_engine.url): + sqlalchemy_utils.create_database(self.db_engine.url) + LOGGER.info("Database created. {:}".format(self.db_engine.url)) + + def drop_database(self) -> None: + if sqlalchemy_utils.database_exists(self.db_engine.url): + sqlalchemy_utils.drop_database(self.db_engine.url) + + def create_tables(self): + try: + LspModel.metadata.create_all(self.db_engine) # type: ignore + LOGGER.info("Tables created in the DB Name: {:}".format(self.db_name)) + except Exception as e: + LOGGER.debug("Tables cannot be created in the lsp database. {:s}".format(str(e))) + raise OperationFailedException ("Tables can't be created", extra_details=["unable to create table {:}".format(e)]) + + def verify_tables(self): + try: + with self.db_engine.connect() as connection: + result = connection.execute("SHOW TABLES;") + tables = result.fetchall() # type: ignore + LOGGER.debug("Tables verified: {:}".format(tables)) + except Exception as e: + LOGGER.debug("Unable to fetch Table names. {:s}".format(str(e))) + + def add_row_to_db(self, row): + session = self.Session() + try: + session.add(row) + session.commit() + LOGGER.debug(f"Row inserted into {row.__class__.__name__} table.") + return True + except Exception as e: + session.rollback() + if "psycopg2.errors.UniqueViolation" in str(e): + LOGGER.error(f"Unique key violation: {row.__class__.__name__} table. {str(e)}") + raise AlreadyExistsException(row.__class__.__name__, row, extra_details=["Unique key violation: {:}".format(e)] ) + else: + LOGGER.error(f"Failed to insert new row into {row.__class__.__name__} table. {str(e)}") + raise OperationFailedException ("Insertion failed", extra_details=["unable to insert row {:}".format(e)]) + finally: + session.close() + + def search_db_row_by_id(self, model, col_name, id_to_search): + session = self.Session() + try: + entity = session.query(model).filter_by(**{col_name: id_to_search}).first() + if entity: + return entity + else: + LOGGER.debug(f"{model.__name__} ID not found, No matching row: {str(id_to_search)}") + return None + except Exception as e: + LOGGER.debug(f"Failed to retrieve {model.__name__} ID. {str(e)}") + raise OperationFailedException ("search by column id", extra_details=["unable to search row {:}".format(e)]) + finally: + session.close() + + def delete_db_row_by_id(self, model, col_name, id_to_search): + session = self.Session() + try: + record = session.query(model).filter_by(**{col_name: id_to_search}).first() + if record: + session.delete(record) + session.commit() + LOGGER.debug("Deleted %s with %s: %s", model.__name__, col_name, id_to_search) + else: + LOGGER.debug("%s with %s %s not found", model.__name__, col_name, id_to_search) + return None + except Exception as e: + session.rollback() + LOGGER.error("Error deleting %s with %s %s: %s", model.__name__, col_name, id_to_search, e) + raise OperationFailedException ("Deletion by column id", extra_details=["unable to delete row {:}".format(e)]) + finally: + session.close() + + def select_with_filter(self, model, filter_object): + session = self.Session() + try: + query = session.query(LspModel) + + # Apply filters based on the filter_object + if filter_object.lsp_id: + query = query.filter(LspModel.lsp_id.in_([l.lsp_id.uuid for l in filter_object.lsp_id])) + + if filter_object.source: + query = query.filter(LspModel.source.in_([s.source_uuid.uuid for s in filter_object.source])) + + if filter_object.destination: + query = query.filter(LspModel.destination.in_([d.destination_uuid.uuid for d in filter_object.destination])) + + result = query.all() + + if result: + LOGGER.debug(f"Fetched filtered rows from {model.__name__} table with filters: {filter_object}") + else: + LOGGER.debug(f"No matching row found in {model.__name__} table with filters: {filter_object}") + return result + except Exception as e: + LOGGER.error(f"Error fetching filtered rows from {model.__name__} table with filters {filter_object} ::: {e}") + raise OperationFailedException ("Select by filter", extra_details=["unable to apply the filter {:}".format(e)]) + finally: + session.close() + from sqlalchemy import asc, desc + + @staticmethod + def select_all_as_dict(self): + session = self.Session() + try: + query = session.query(LspModel) + rows = query.all() + + # Obtenemos los nombres de las columnas + columns = [column.name for column in LspModel.__table__.columns] + + # Convertimos las filas en diccionarios usando los nombres de las columnas + result = [dict(zip(columns, row)) for row in rows] + + if result: + LOGGER.debug(f"Fetched all rows from {LspModel.__name__} table as dict.") + else: + LOGGER.debug(f"No rows found in {LspModel.__name__} table.") + + return result + + except Exception as e: + LOGGER.error(f"Error fetching rows from {LspModel.__name__} table: {e}") + raise OperationFailedException("Select all", extra_details=["unable to fetch all rows {:}".format(e)]) + finally: + session.close() + @staticmethod + def get_all_columns(): + """Obtiene todos los nombres de las columnas de la tabla 'lsp'.""" + try: + # Usamos el inspeccionador de SQLAlchemy para obtener la información de la tabla + inspector = inspect(LSPEngine.get_engine()) + columns = inspector.get_columns('lsp') + + column_names = [column['name'] for column in columns] # Extraemos solo los nombres de las columnas + return column_names + + except Exception as e: + LOGGER.error(f"Error al obtener las columnas de la tabla 'lsp': {str(e)}") + return None + @staticmethod + def show_lsp_db(): + """Método estático para obtener los LSP Paths desde la base de datos""" + db_engine = LSPEngine.get_engine() + if db_engine is None: + LOGGER.error("No database engine available.") + return None + try: + lsp_info = db_engine.execute("SELECT * FROM lsp").fetchall() + LOGGER.info(f"Información de LSPs: {lsp_info}") + return lsp_info + except Exception as e: + LOGGER.error(f"Error al obtener la información de LSP desde la base de datos: {str(e)}") + return None \ No newline at end of file diff --git a/src/pcep/database/__init__.py b/src/pcep/database/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..5aa80bdf50186bbca3d3bbd65a3d6f2ca949f67b --- /dev/null +++ b/src/pcep/database/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2022-2025 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# 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/pcep/database/test_variables.py b/src/pcep/database/test_variables.py new file mode 100644 index 0000000000000000000000000000000000000000..aed46cb3b106739dd8aa8a458bb36d5f8d0db666 --- /dev/null +++ b/src/pcep/database/test_variables.py @@ -0,0 +1,41 @@ +import os +import unittest +from sqlalchemy.orm import sessionmaker +from pcep.database.LSP_DB import LspDB, LspModel + +# Establecer la variable de entorno dentro de las pruebas +os.environ['CRDB_SQL_PORT'] = '26257' # Establece el puerto SQL necesario +os.environ['CRDB_SSLMODE'] = 'require' + +class TestLspDatabase(unittest.TestCase): + + @classmethod + def setUpClass(cls): + """ + Esta función se ejecuta una vez antes de todas las pruebas. + Aquí se puede configurar la base de datos. + """ + cls.db = LspDB() # Se conecta a la base de datos real + + # Crear la base de datos y las tablas si es necesario + cls.db.create_database() # Crea la base de datos si no existe + cls.db.create_tables() # Crea las tablas necesarias + + + def test_select_all_lsp(self): + """ + Realiza una prueba de selección de todos los registros de la tabla 'lsp'. + """ + session = self.db.Session() + try: + # Ejecutar la consulta SQL directamente + result = session.execute("SELECT * FROM lsp").fetchall() + print(result) # Para ver los resultados en la consola + self.assertIsInstance(result, list) # Asegura que el resultado es una lista + self.assertGreater(len(result), 0) # Asegura que hay al menos un registro + finally: + session.close() # Cierra la sesión + +# Ejecutar las pruebas +if __name__ == '__main__': + unittest.main() diff --git a/src/pcep/requirements.in b/src/pcep/requirements.in new file mode 100644 index 0000000000000000000000000000000000000000..73b143b05b45197e7655f1629925f870c17847a2 --- /dev/null +++ b/src/pcep/requirements.in @@ -0,0 +1,41 @@ +# Copyright 2022-2024 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# 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. + + +anytree==2.8.0 +APScheduler==3.8.1 +lxml==4.9.3 +#networkx==2.6.3 +#pydot==1.4.2 +#redis==4.1.2 + +#fastcache==1.1.0 +ncclient==0.6.13 +python-json-logger==2.0.2 +pytz==2021.3 +xmltodict==0.12.0 + + +# pip's dependency resolver does not take into account installed packages. +# p4runtime does not specify the version of grpcio/protobuf it needs, so it tries to install latest one +# adding here again grpcio==1.47.* and protobuf==3.20.* with explicit versions to prevent collisions +grpcio==1.47.* +protobuf==3.20.* +prometheus_client==0.13.0 + +#DB +psycopg2-binary==2.9.* +SQLAlchemy==1.4.* +sqlalchemy-cockroachdb==1.4.* +SQLAlchemy-Utils==0.38.* \ No newline at end of file diff --git a/src/pcep/service/PcepService.py b/src/pcep/service/PcepService.py new file mode 100644 index 0000000000000000000000000000000000000000..c0d3052293acbf887b4923748e795316204239f7 --- /dev/null +++ b/src/pcep/service/PcepService.py @@ -0,0 +1,57 @@ +# Copyright 2022-2024 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# 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. + +import logging +from pcep.service.tools.GrpcServer import GrpcServer +from common.Constants import ServiceNameEnum +from common.Settings import get_service_port_grpc, get_service_host +from common.proto.pcep_pb2_grpc import add_PcepServiceServicer_to_server +from common.tools.service.GenericGrpcService import GenericGrpcService +from .PcepServiceServicerImpl import PcepServiceServicerImpl + +LOGGER = logging.getLogger(__name__) + +class PcepService(GenericGrpcService): + def __init__(self, pcepServer : GrpcServer,cls_name: str = __name__) -> None: + port = get_service_port_grpc(ServiceNameEnum.PCEP) #El enum en common.constants + LOGGER.debug('PORT... (PCEP Service)') + LOGGER.debug(port) + + host = get_service_host(ServiceNameEnum.PCEP) #El enum en common.constants + LOGGER.debug('HOST... (PCEP Service)') + LOGGER.debug(host) + + super().__init__(port, cls_name=cls_name) + self.pcep_servicer = PcepServiceServicerImpl(pcepServer) + LOGGER.debug('Creating Servicer... (PCEP Service)') + + def install_servicers(self): + add_PcepServiceServicer_to_server(self.pcep_servicer, self.server) + +# class PcepService(GenericGrpcService): +# def __init__(self, pcepServer: GrpcServer, cls_name: str = __name__) -> None: +# # Direcciones y puerto fijos +# host = '192.168.159.225' # Dirección IP fija +# port = '10060' # Puerto fijo + +# LOGGER.debug(f'HOST... (PCEP Service): {host}') +# LOGGER.debug(f'PORT... (PCEP Service): {port}') + +# # Llamada al constructor de la clase base, pasando el host y el puerto directamente +# super().__init__(port, cls_name=cls_name) +# self.pcep_servicer = PcepServiceServicerImpl(pcepServer) +# LOGGER.debug('Creating Servicer... (PCEP Service)') + +# def install_servicers(self): +# add_PcepServiceServicer_to_server(self.pcep_servicer, self.server) \ No newline at end of file diff --git a/src/pcep/service/PcepServiceServicerImpl.py b/src/pcep/service/PcepServiceServicerImpl.py new file mode 100644 index 0000000000000000000000000000000000000000..af7036a6fbe2f9774ca9e30305ac6984f6b09acc --- /dev/null +++ b/src/pcep/service/PcepServiceServicerImpl.py @@ -0,0 +1,110 @@ +# Copyright 2022-2024 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# 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. + +import grpc, logging +from common.proto.context_pb2 import Empty +from pcep.service.tools.GrpcServer import GrpcServer +from common.method_wrappers.Decorator import MetricsPool, safe_and_metered_rpc_method +from common.proto.pcep_pb2 import RequestRq, RequestRp, PceIpRq, PceIpRp, LSPdb_Request, LSPdb_Response, \ + Session_Request, Session_Response, LspId, LspDescriptor, commandResponse + +from common.proto.pcep_pb2_grpc import PcepServiceServicer +# from pcep.database.LSP_DB import LspDB + +LOGGER = logging.getLogger(__name__) + +METRICS_POOL = MetricsPool('Service', 'RPC') + +class PcepServiceServicerImpl(PcepServiceServicer): + def __init__(self, pcepServer : GrpcServer) -> None: + LOGGER.debug('Creating Servicer...') + self.pcepServer=pcepServer + LOGGER.debug('Servicer Created') + + + @safe_and_metered_rpc_method(METRICS_POOL, LOGGER) + def configuratePCE(self, request : PceIpRq, context : grpc.ServicerContext) -> PceIpRp: + LOGGER.debug("(ConfiguratePCE) Create pce instance %s",request) + # configurateIP=self.pcepServer.connectToJavaPcep(request.address) + #return PceIpRp(addressRp=configurateIP) + return PceIpRp(addressRp="10.95.90.150") + + @safe_and_metered_rpc_method(METRICS_POOL, LOGGER) + def sendRequest(self, request : RequestRq, context : grpc.ServicerContext) -> commandResponse: + LOGGER.debug("(Send Request) Send: %s",request.command) + response =self.pcepServer.request_to_java(request.command) + return commandResponse(success=response.success, error_message=response.error_message) + + @safe_and_metered_rpc_method(METRICS_POOL, LOGGER) + def getLSPdb(self, request: LSPdb_Request, context : grpc.ServicerContext) -> LSPdb_Response: + LOGGER.debug("GET LSPDB") + response = self.pcepServer.get_lspdb_from_java(request) + return response + + @safe_and_metered_rpc_method(METRICS_POOL, LOGGER) + def getSessionsInfo(self, request: Session_Request, context : grpc.ServicerContext) -> Session_Response: + LOGGER.debug("GET SESSIONS INFO") + sessionresponse = self.pcepServer.get_sessions_info_java(request) + return sessionresponse + + + + # @safe_and_metered_rpc_method(METRICS_POOL, LOGGER) + # def GetLSPDescriptor(self, request: LspID, grpc_context: grpc.ServicerContext) -> LspDescriptor: + # response = LspDescriptor() + # LOGGER.info(f"Received gRPC message object: {request}") + + # try: + # # Obtener el identificador del LSP desde la solicitud + # lsp_id_to_search = request.lsp_id.uuid # El LspID contiene el lsp_id que se busca + # row = self.lsp_db_obj.search_db_row_by_id(LspModel, 'lsp_id', lsp_id_to_search) + + # if row is None: + # LOGGER.info(f"No matching row found for LSP id: {lsp_id_to_search}") + # return Empty() # Si no se encuentra el LSP, devolvemos un Empty + + # # Convertir la fila obtenida a un LspDescriptor y devolverla + # response = LspModel.convert_row_to_LspDescriptor(row) + # return response + + # except Exception as e: + # LOGGER.error(f"Unable to search LSP id. Error: {e}") + # raise e + + # @safe_and_metered_rpc_method(METRICS_POOL, LOGGER) + # def SetKpiDescriptor(self, request: LspDescriptor, grpc_context: grpc.ServicerContext # type: ignore + # ) -> LspID: # type: ignore + # response = LspID() + # LOGGER.info("Received gRPC message object: {:}".format(request)) + # try: + # lsp_to_insert = LspModel.convert_LspDescriptor_to_row(request) + # if (self.lsp_db_obj.add_row_to_db(lsp_to_insert)): + # response.lsp_id.uuid = request.lsp_id.uuid + # # LOGGER.info("Added Row: {:}".format(response)) + # return response + # except Exception as e: + # LOGGER.info("Unable to create LspModel class object. {:}".format(e)) + + + # @safe_and_metered_rpc_method(METRICS_POOL, LOGGER) + # def DeleteKpiDescriptor(self, request: LspID, grpc_context: grpc.ServicerContext # type: ignore + # ) -> Empty: # type: ignore + # LOGGER.info("Received gRPC message object: {:}".format(request)) + # try: + # lsp_id_to_search = request.lsp_id.uuid # El LspID contiene el lsp_id que se busca + # self.lsp_db_obj.delete_db_row_by_id(LspModel, 'kpi_id', lsp_id_to_search) + # except Exception as e: + # LOGGER.info('Unable to search kpi id. {:}'.format(e)) + # finally: + # return Empty() \ No newline at end of file diff --git a/src/pcep/service/__init__.py b/src/pcep/service/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..a5ccb6078c2c18285753cacb045f9614017f8485 --- /dev/null +++ b/src/pcep/service/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2022-2024 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# 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/pcep/service/__main__.py b/src/pcep/service/__main__.py new file mode 100644 index 0000000000000000000000000000000000000000..67065d1d6371efe879093c2609a40fd76d400c43 --- /dev/null +++ b/src/pcep/service/__main__.py @@ -0,0 +1,86 @@ +# Copyright 2022-2024 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# 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. + +import logging, signal, sys, threading +from prometheus_client import start_http_server +from common.Settings import get_log_level, get_metrics_port +from .PcepService import PcepService +from .tools.GrpcServer import GrpcServer +import socket +import subprocess +from pcep.database.LSP_DB import LspDB +# from pcep.database.LSPModel import LspModel +# from pcep.client.PcepClient import PcepClient + + + +terminate = threading.Event() +LOGGER = logging.getLogger(__name__) + +def signal_handler(signal, frame): # pylint: disable=redefined-outer-name + LOGGER.warning('Terminate signal received') + LOGGER.warning(signal) + terminate.set() + +def main(): + global LOGGER # pylint: disable=global-statement + log_level = get_log_level() + logging.basicConfig(level=log_level, format="[%(asctime)s] %(levelname)s:%(name)s:%(message)s") + LOGGER = logging.getLogger(__name__) + + signal.signal(signal.SIGINT, signal_handler) + signal.signal(signal.SIGTERM, signal_handler) + + LOGGER.info('Starting... (MAIN.py)') + + # Start metrics server + metrics_port = get_metrics_port() + start_http_server(metrics_port) + + # Initialize ServiceHandler Factory + #service_handler_factory = ServiceHandlerFactory(SERVICE_HANDLERS) + + pcep_server = GrpcServer() #Create instance of the GRPC Server + # pcep_server.Connect() + + LOGGER.info("Init LSP Database service") + lsp_db_obj = LspDB() + lsp_db_obj.create_database() + lsp_db_obj.create_tables() + lsp_db_obj.verify_tables() + + # pcep_client = PcepClient() + + ip_address = socket.gethostbyname(socket.gethostname()) + + LOGGER.debug("IP address of the PCEP POD: %s", ip_address) + LOGGER.debug(ip_address) + + # pcep_server.connectToJavaPcep(ip_address) + + # Starting pcep service + pcep_service = PcepService(pcep_server) + pcep_service.start() + + # Wait for Ctrl+C or termination signal + while not terminate.wait(timeout=0.1): pass + LOGGER.info('Terminating...') + pcep_server.terminateGrpcServer() + pcep_service.stop() + + LOGGER.info('Bye') + return 0 + +if __name__ == '__main__': + sys.exit(main()) diff --git a/src/pcep/service/tools/GrpcServer.py b/src/pcep/service/tools/GrpcServer.py new file mode 100644 index 0000000000000000000000000000000000000000..7f7443be5aa08cd36f0f6ec707589f45466a5721 --- /dev/null +++ b/src/pcep/service/tools/GrpcServer.py @@ -0,0 +1,173 @@ +# Copyright 2022-2024 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# 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. + +import json, logging,threading, queue,time,signal +from datetime import datetime, timedelta +from typing import Any, Iterator, List, Optional, Tuple, Union + +import logging,threading +import grpc + +from .protos.grpcService_pb2_grpc import pceServiceStub, add_pceServiceServicer_to_server +from .protos.grpcService_pb2 import LSPdb_Request, LSPdb_Response, commandRequest, commandResponse, Session_Request, Session_Response +# from .Tools import UpdateRequest + +from concurrent import futures +import os +import subprocess +from multiprocessing import Pool +import logging + +# from .JavaRunner import JavaRunner + +LOGGER = logging.getLogger(__name__) + +_ONE_DAY_IN_SECONDS = 60 * 60 * 24 + + +# SERVER_ADDRESS = 'localhost:10060' + + +SERVER_ADDRESS = '192.168.159.225:10060' + +class GrpcServer(): + + def __init__(self) -> None: # pylint: disable=super-init-not-called + self.__lock = threading.Lock() + self.__started = threading.Event() + self.__terminate = threading.Event() + self.__out_samples = queue.Queue() + self.__server=grpc.aio.server() + self.__runnerList=[] + + # def connectToJavaPcep(self, address): + # runner = JavaRunner(address) + + # # Sets IpAddress in XML config file for java program + # runner.setPeer(address) + + # process_thread = threading.Thread(target=runner.execPcep) + # process_thread.start() + # self.__runnerList.append(runner) + + # return process_thread + + + def ConnectThread(self) -> bool: + # TODO: Metodos necesarios para conectarte al speaker + # If started, assume it is already connected + if self.__started.is_set(): return True + self.__started.set() + self.__server = grpc.server(futures.ThreadPoolExecutor(max_workers=10)) + add_pceServiceServicer_to_server(self, self.__server) + self.__server.add_insecure_port(SERVER_ADDRESS) + LOGGER.info("Starting server on %s", SERVER_ADDRESS) + self.__server.start() + try: + while True: + time.sleep(_ONE_DAY_IN_SECONDS) + except KeyboardInterrupt: + LOGGER.info("DISCONNECT") + self.Disconnect() + return True + + def Connect(self): + grpcThread = threading.Thread(target=self.ConnectThread) + grpcThread.start() + LOGGER.info("Calling the JavaRunner") + return True + + def Disconnect(self) -> bool: + self.__terminate.set() + # If not started, assume it is already disconnected + if not self.__started.is_set(): return True + LOGGER.info("Keyboard interrupt, stop server") + self.__server.stop(0) + # Disconnect triggers deactivation of sampling events + # self.__scheduler.shutdown() + # exit(0) + return True + + def update(): + with grpc.insecure_channel('192.168.159.225:10060') as channel: + n = "initiate lsp directo 10.95.90.56 1.1.1.1 1.1.1.3 m1228800 na192.168.3.11-192.168.3.13" + #n = "terminate lsp 10.95.90.56 0 nombre" + #n="create candidatepath 10.95.90.56 1.1.1.1 4 97 m69644288 nn1.1.1.3 m69640192 nn1.1.1.2" + stub = pceServiceStub(channel) + request = commandRequest(command=n) + print("updateService req: " ,request) + response = stub.update(request) + print("updateService client received: " ,response.commandResp) + + def terminateRunners(self): + for runner in self.__runnerList: + runner.endBGPSpeaker() + return True + + def terminateGrpcServer(self): + LOGGER.debug("Terminating java programs...") + self.terminateRunners() + LOGGER.debug("Disconnecting grpc server...") + self.Disconnect() + return True + + def terminateRunnerById(self,speaker_id): + """ + Disconnect from BGP-LS speaker given an speaker Id. Its the same + as the java running proccess PID. + """ + for runner in self.__runnerList: + if(runner.getPid()==speaker_id): + runner.endBGPSpeaker() + self.__runnerList.remove(runner) + + return True + + + def request_to_java(self,message): + with grpc.insecure_channel('192.168.159.225:10060') as channel: + #n = "initiate lsp largo2 10.95.90.56 1.1.1.1 1.1.1.2 m69644288 nn1.1.1.3 m69640192 nn1.1.1.2" + #n = "initiate lsp directo 10.95.90.56 1.1.1.1 1.1.1.3 m1228800 na192.168.3.11-192.168.3.13" + stub = pceServiceStub(channel) + LOGGER.debug("updateService req 2: %s" ,message) + request = commandRequest(command=message) + LOGGER.debug("updateService req 2: %s" ,request) + response = stub.update(request) + # LOGGER.debug("updateServide client received: %s" ,response) + # LOGGER.debug("updateServide client received IP: %s" ,response) + return response + + + # def get_lspdb_from_java(self, request): + # with grpc.insecure_channel('192.168.159.225:10060') as channel: + # stub = pceServiceStub(channel) + # # Realizar la llamada al servidor Java + # request = LSPdb_Request() + # print("updateService req: " ,request) + # response = stub.getLSPdb(request) + # print("GetLSPDB") + # # Devuelve los datos de LSP obtenidos del servidor Java + # return response + + def get_sessions_info_java(self, request): + with grpc.insecure_channel('192.168.159.225:10060') as channel: + stub = pceServiceStub(channel) + # Realizar la llamada al servidor Java + request = Session_Request() + print("updateService req: " ,request) + response = stub.getSessionsInfo(request) + print("GetSessionsInfo") + # Devuelve los datos de LSP obtenidos del servidor Java + return response + \ No newline at end of file diff --git a/src/pcep/service/tools/JavaRunner.py b/src/pcep/service/tools/JavaRunner.py new file mode 100644 index 0000000000000000000000000000000000000000..71a9515772cc1fd858897c22e82c4a7bdd61b440 --- /dev/null +++ b/src/pcep/service/tools/JavaRunner.py @@ -0,0 +1,147 @@ +# Copyright 2022-2024 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# 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. + +import logging,threading, time +import logging +from lxml import etree +import os +import subprocess + +XML_CONFIG_FILE="/var/teraflow/pcep/service/resources/PCEServerConfiguration.xml" + +LOGGER = logging.getLogger(__name__) + +class JavaRunner: + + def __init__(self,address): + self.__process=None + self.__lock = threading.Lock() + self.__address = address + + def getCurrentLocalPort(self): + with self.__lock: + return self.__localPort + + def getCurrentMngPort(self): + with self.__lock: + return self.__managementPort + def getPid(self): + return self.__process.pid + + def execAndKill(self): + + LOGGER.debug("Before exec and kill") + os.chdir("/var/teraflow/pcep/service/resources/") + cwd = os.getcwd() + LOGGER.info("Current working directory: %s", cwd) + # Security shell=False + self.__process=subprocess.Popen(['java -jar PCE-jar-with-dependencies.jar '],#+ XML_CONFIG_FILE + shell=False,start_new_session=True,stdout=subprocess.PIPE) + LOGGER.debug("Time to sleep") + java_pid = self.__process.pid + print("Java PID:", java_pid) + time.sleep(15) + self.__process.terminate() + + def execPcep(self) -> bool: + """ + Executes java pcep in non-blocking process + """ + LOGGER.debug("Executing JavaRunner") + os.chdir("/var/teraflow/pcep/service/resources/") + try: + #self.__process = subprocess.Popen(['java', '-jar', 'Ejecutable_2.jar'], + # shell=False, start_new_session=True, + # stdout=subprocess.PIPE, stderr=subprocess.PIPE) + + LOGGER.debug("Executing command: %s", ('java', '-Dlog4j.configurationFile=log4j2.xml', '-jar', 'PCE-jar-with-dependencies.jar', 'PCEServerConfiguration.xml')) + self.__process = subprocess.Popen(['java', '-Dlog4j.configurationFile=log4j2.xml', '-jar', 'PCE-jar-with-dependencies.jar', 'PCEServerConfiguration.xml'], + + shell=False, start_new_session=True, + stdout=subprocess.PIPE, stderr=subprocess.PIPE) + + stdout_thread = threading.Thread(target=self.read_stdout) + stderr_thread = threading.Thread(target=self.read_stderr) + + stdout_thread.start() + stderr_thread.start() + + self.__process.wait() + + stdout_thread.join() + stderr_thread.join() + + except subprocess.CalledProcessError as err: + LOGGER.debug('ERROR: %s', err) + + return self.__process + + def read_stdout(self): + try: + for line in iter(self.__process.stdout.readline, b''): + print(f"STDOUT: {line.decode('utf-8')}", flush=True) + except Exception as e: + print(f"Error in read_stdout: {e}") + + def read_stderr(self): + try: + for line in iter(self.__process.stderr.readline, b''): + print(f"STDERR: {line.decode('utf-8')}", flush=True) + except Exception as e: + print(f"Error in read_stderr: {e}") + + def setPort(self,port): + self.__peerPort=port + return True + def setAsNumber(self,asNumber): + self.__asNumber=asNumber + return True + + def setPeer(self, address) -> bool: + """ + Sets XML existing config file with peer address and port. TODO: as_number + """ + XMLParser = etree.XMLParser(remove_blank_text=False) + tree = etree.parse(XML_CONFIG_FILE, parser=XMLParser) + root = tree.getroot() + + # Find the element + pceAddress = root.find(".//LocalPCEAddress") + + #Check if the element is found + if pceAddress is not None: + LOGGER.debug("Old LocalPCEAddress value: %s", pceAddress.text) + # Update the text content of the element with the new address + pceAddress.text = str(address) + LOGGER.debug("New LocalPCEAddress value: %s", pceAddress.text) + # Save the modified XML back to the file + tree.write(XML_CONFIG_FILE, pretty_print=True) + + return True # Return True to indicate success + + return False # Return False if the element is not found + + #return True + + def endBGPSpeaker(self) -> bool: + """ + Kills java program connected to BGPLS Speaker with SIGKILL signal + """ + LOGGER.debug("sending kill signal to process %s",self.__process.pid) + LOGGER.debug("PID: %d",self.__process.pid) + self.__process.kill() + return True + + def getRunnerInfo(self): + return self.__address,self.__asNumber,self.__peerPort diff --git a/src/pcep/service/tools/PCEServerConfiguration.xml b/src/pcep/service/tools/PCEServerConfiguration.xml new file mode 100644 index 0000000000000000000000000000000000000000..a48b4c03bc0a512555dba403c2a63432ef65acc2 --- /dev/null +++ b/src/pcep/service/tools/PCEServerConfiguration.xml @@ -0,0 +1,114 @@ + + + 4189 + 6666 + + + + 10.95.43.150 + + + + 60 + + + 30 + + + 120 + + + + 5 + + + + 60 + + + + + + + + + + + + + PCEServer.log + PCEPParserServer.log + OSPFParser.log + true + true + 1 + 1 + + + + topologia_ifusion.xml + + false + BGP4Parameters_2.xml + + 1000 + true + false + false + true + false + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/pcep/service/tools/__init__.py b/src/pcep/service/tools/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..a5ccb6078c2c18285753cacb045f9614017f8485 --- /dev/null +++ b/src/pcep/service/tools/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2022-2024 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# 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/pcep/service/tools/protos/grpcService.proto b/src/pcep/service/tools/protos/grpcService.proto new file mode 100644 index 0000000000000000000000000000000000000000..1da1ab3efed07da3fa11eb18abbc809adfcd0df4 --- /dev/null +++ b/src/pcep/service/tools/protos/grpcService.proto @@ -0,0 +1,60 @@ +// Copyright 2022-2024 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +// +// 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 src.main.proto; + +//el modulo python abre la comunicacion +//el servidor java responde con un ACK (En caso de que se haya mandado un comando) o con la informacion de la LSPDB (En caso de peticion de LSPDB) + +// Command request from the client +message commandRequest{ + string command = 1; +} + +// Response after a Command Request (If bad request show error log) +message commandResponse{ + bool success = 1; + string error_message = 2; +} + +// LSP database request from the client +message LSPdb_Request{ +} + +// Response containing LSP database information +message LSPdb_Response{ + string LSPdb_data = 2; +} + +// Active PCEP sessions request from the client +message Session_Request{ +} + +// Response containing LSP database information +message Session_Response{ + string Session_data = 2; +} + +// Defining a Service, a Service can have multiple RPC operations +service pceService { + // RPC method for command execution + rpc update(commandRequest) returns (commandResponse); + + // RPC method for retrieving LSP database + rpc getLSPdb(LSPdb_Request) returns (LSPdb_Response); + + // RPC method for retrieving LSP database + rpc getSessionsInfo(Session_Request) returns (Session_Response); +} diff --git a/src/pcep/service/tools/protos/grpcService_pb2.py b/src/pcep/service/tools/protos/grpcService_pb2.py new file mode 100644 index 0000000000000000000000000000000000000000..f36920a1f490d4740bfcd5fc4eef566bf0c0cccb --- /dev/null +++ b/src/pcep/service/tools/protos/grpcService_pb2.py @@ -0,0 +1,96 @@ +# Copyright 2022-2024 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# 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. + +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: grpcService.proto +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x11grpcService.proto\x12\x0esrc.main.proto\"!\n\x0e\x63ommandRequest\x12\x0f\n\x07\x63ommand\x18\x01 \x01(\t\"9\n\x0f\x63ommandResponse\x12\x0f\n\x07success\x18\x01 \x01(\x08\x12\x15\n\rerror_message\x18\x02 \x01(\t\"\x0f\n\rLSPdb_Request\"$\n\x0eLSPdb_Response\x12\x12\n\nLSPdb_data\x18\x02 \x01(\t\"\x11\n\x0fSession_Request\"(\n\x10Session_Response\x12\x14\n\x0cSession_data\x18\x02 \x01(\t2\xf8\x01\n\npceService\x12I\n\x06update\x12\x1e.src.main.proto.commandRequest\x1a\x1f.src.main.proto.commandResponse\x12I\n\x08getLSPdb\x12\x1d.src.main.proto.LSPdb_Request\x1a\x1e.src.main.proto.LSPdb_Response\x12T\n\x0fgetSessionsInfo\x12\x1f.src.main.proto.Session_Request\x1a .src.main.proto.Session_Responseb\x06proto3') + +_COMMANDREQUEST = DESCRIPTOR.message_types_by_name['commandRequest'] +_COMMANDRESPONSE = DESCRIPTOR.message_types_by_name['commandResponse'] +_LSPDB_REQUEST = DESCRIPTOR.message_types_by_name['LSPdb_Request'] +_LSPDB_RESPONSE = DESCRIPTOR.message_types_by_name['LSPdb_Response'] +_SESSION_REQUEST = DESCRIPTOR.message_types_by_name['Session_Request'] +_SESSION_RESPONSE = DESCRIPTOR.message_types_by_name['Session_Response'] +commandRequest = _reflection.GeneratedProtocolMessageType('commandRequest', (_message.Message,), { + 'DESCRIPTOR' : _COMMANDREQUEST, + '__module__' : 'grpcService_pb2' + # @@protoc_insertion_point(class_scope:src.main.proto.commandRequest) + }) +_sym_db.RegisterMessage(commandRequest) + +commandResponse = _reflection.GeneratedProtocolMessageType('commandResponse', (_message.Message,), { + 'DESCRIPTOR' : _COMMANDRESPONSE, + '__module__' : 'grpcService_pb2' + # @@protoc_insertion_point(class_scope:src.main.proto.commandResponse) + }) +_sym_db.RegisterMessage(commandResponse) + +LSPdb_Request = _reflection.GeneratedProtocolMessageType('LSPdb_Request', (_message.Message,), { + 'DESCRIPTOR' : _LSPDB_REQUEST, + '__module__' : 'grpcService_pb2' + # @@protoc_insertion_point(class_scope:src.main.proto.LSPdb_Request) + }) +_sym_db.RegisterMessage(LSPdb_Request) + +LSPdb_Response = _reflection.GeneratedProtocolMessageType('LSPdb_Response', (_message.Message,), { + 'DESCRIPTOR' : _LSPDB_RESPONSE, + '__module__' : 'grpcService_pb2' + # @@protoc_insertion_point(class_scope:src.main.proto.LSPdb_Response) + }) +_sym_db.RegisterMessage(LSPdb_Response) + +Session_Request = _reflection.GeneratedProtocolMessageType('Session_Request', (_message.Message,), { + 'DESCRIPTOR' : _SESSION_REQUEST, + '__module__' : 'grpcService_pb2' + # @@protoc_insertion_point(class_scope:src.main.proto.Session_Request) + }) +_sym_db.RegisterMessage(Session_Request) + +Session_Response = _reflection.GeneratedProtocolMessageType('Session_Response', (_message.Message,), { + 'DESCRIPTOR' : _SESSION_RESPONSE, + '__module__' : 'grpcService_pb2' + # @@protoc_insertion_point(class_scope:src.main.proto.Session_Response) + }) +_sym_db.RegisterMessage(Session_Response) + +_PCESERVICE = DESCRIPTOR.services_by_name['pceService'] +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + _COMMANDREQUEST._serialized_start=37 + _COMMANDREQUEST._serialized_end=70 + _COMMANDRESPONSE._serialized_start=72 + _COMMANDRESPONSE._serialized_end=129 + _LSPDB_REQUEST._serialized_start=131 + _LSPDB_REQUEST._serialized_end=146 + _LSPDB_RESPONSE._serialized_start=148 + _LSPDB_RESPONSE._serialized_end=184 + _SESSION_REQUEST._serialized_start=186 + _SESSION_REQUEST._serialized_end=203 + _SESSION_RESPONSE._serialized_start=205 + _SESSION_RESPONSE._serialized_end=245 + _PCESERVICE._serialized_start=248 + _PCESERVICE._serialized_end=496 +# @@protoc_insertion_point(module_scope) diff --git a/src/pcep/service/tools/protos/grpcService_pb2_grpc.py b/src/pcep/service/tools/protos/grpcService_pb2_grpc.py new file mode 100644 index 0000000000000000000000000000000000000000..b9a6601458beb484ae461e87d9b8e9949c6577ad --- /dev/null +++ b/src/pcep/service/tools/protos/grpcService_pb2_grpc.py @@ -0,0 +1,146 @@ +# Copyright 2022-2024 ETSI TeraFlowSDN - TFS OSG (https:..tfs.etsi.org.) +# +# 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. + +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" +# import sys +# sys.path.append('.home.ubuntu.tfs-ctrl.src.') + +import grpc + +import pcep.service.tools.protos.grpcService_pb2 as grpcService__pb2 + + +class pceServiceStub(object): + """Defining a Service, a Service can have multiple RPC operations""" + + def __init__(self, channel): + """Constructor. + + Args: + channel: A grpc.Channel. + """ + self.update = channel.unary_unary( + '.src.main.proto.pceService.update', + request_serializer=grpcService__pb2.commandRequest.SerializeToString, + response_deserializer=grpcService__pb2.commandResponse.FromString, + ) + self.getLSPdb = channel.unary_unary( + '.src.main.proto.pceService.getLSPdb', + request_serializer=grpcService__pb2.LSPdb_Request.SerializeToString, + response_deserializer=grpcService__pb2.LSPdb_Response.FromString, + ) + self.getSessionsInfo = channel.unary_unary( + '.src.main.proto.pceService.getSessionsInfo', + request_serializer=grpcService__pb2.Session_Request.SerializeToString, + response_deserializer=grpcService__pb2.Session_Response.FromString, + ) + +class pceServiceServicer(object): + """Defining a Service, a Service can have multiple RPC operations""" + + def update(self, request, context): + """RPC method for command execution""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def getLSPdb(self, request, context): + """RPC method for retrieving LSP database""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def getSessionsInfo(self, request, context): + """RPC method for retrieving LSP database""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + +def add_pceServiceServicer_to_server(servicer, server): + rpc_method_handlers = { + 'update': grpc.unary_unary_rpc_method_handler( + servicer.update, + request_deserializer=grpcService__pb2.commandRequest.FromString, + response_serializer=grpcService__pb2.commandResponse.SerializeToString, + ), + 'getLSPdb': grpc.unary_unary_rpc_method_handler( + servicer.getLSPdb, + request_deserializer=grpcService__pb2.LSPdb_Request.FromString, + response_serializer=grpcService__pb2.LSPdb_Response.SerializeToString, + ), + 'getSessionsInfo': grpc.unary_unary_rpc_method_handler( + servicer.getSessionsInfo, + request_deserializer=grpcService__pb2.Session_Request.FromString, + response_serializer=grpcService__pb2.Session_Response.SerializeToString, + ), + } + generic_handler = grpc.method_handlers_generic_handler( + 'src.main.proto.pceService', rpc_method_handlers) + server.add_generic_rpc_handlers((generic_handler,)) + + # This class is part of an EXPERIMENTAL API. +class pceService(object): + """Defining a Service, a Service can have multiple RPC operations""" + + @staticmethod + def update(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '.src.main.proto.pceService.update', + grpcService__pb2.commandRequest.SerializeToString, + grpcService__pb2.commandResponse.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + + @staticmethod + def getLSPdb(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '.src.main.proto.pceService.getLSPdb', + grpcService__pb2.LSPdb_Request.SerializeToString, + grpcService__pb2.LSPdb_Response.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + + @staticmethod + def getSessionsInfo(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '.src.main.proto.pceService.getSessionsInfo', + grpcService__pb2.Session_Request.SerializeToString, + grpcService__pb2.Session_Response.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) diff --git a/src/pcep/tests/.gitignore b/src/pcep/tests/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..6b97d6fe3ad32f39097745229ab7f547f26ecb12 --- /dev/null +++ b/src/pcep/tests/.gitignore @@ -0,0 +1 @@ +# Add here your files containing confidential testbed details such as IP addresses, ports, usernames, passwords, etc. diff --git a/src/pcep/tests/Grpc_TestClient/gRPC_PCEPClient.py b/src/pcep/tests/Grpc_TestClient/gRPC_PCEPClient.py new file mode 100644 index 0000000000000000000000000000000000000000..3212bc9916b421c757d0cede70974eb4f57f5cdc --- /dev/null +++ b/src/pcep/tests/Grpc_TestClient/gRPC_PCEPClient.py @@ -0,0 +1,79 @@ +# Copyright 2022-2024 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# 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. + +import grpc, logging +from common.Constants import ServiceNameEnum +from common.Settings import get_service_host, get_service_port_grpc +from common.tools.client.RetryDecorator import retry, delay_exponential +from pcep.service.tools.protos.grpcService_pb2 import LSPdb_Request, Session_Request, commandRequest +from pcep.service.tools.protos.grpcService_pb2_grpc import pceServiceStub + +LOGGER = logging.getLogger(__name__) +MAX_RETRIES = 15 +DELAY_FUNCTION = delay_exponential(initial=0.01, increment=2.0, maximum=5.0) +RETRY_DECORATOR = retry(max_retries=MAX_RETRIES, delay_function=DELAY_FUNCTION, prepare_method_name='connect') +PORT = 10060 + +class GrpcPcepClient: + def __init__(self, host="192.168.159.225", port=None): + if not host: host = get_service_host(ServiceNameEnum.PCEP) + #if not port: port = get_service_port_grpc(ServiceNameEnum.PCEP) + if not port: port = PORT #Maybe should not be hardcoded + self.endpoint = '{:s}:{:s}'.format(str(host), str(port)) + LOGGER.warning('Creating channel to {:s}...'.format(str(self.endpoint))) + self.channel = None + self.stub = None + self.connect() + LOGGER.warning('Channel created') + + def connect(self): + #LOGGER.warning('IAM IN CONNECT') + LOGGER.warning('Creating channel to {:s}...'.format(str(self.endpoint))) + self.channel = grpc.insecure_channel(self.endpoint) + self.stub = pceServiceStub(self.channel) + LOGGER.warning('Channel created') + + def close(self): + #LOGGER.warning('IAM IN CLOSE') + if self.channel is not None: self.channel.close() + self.channel = None + self.stub = None + + @RETRY_DECORATOR + def showSessions(self): + requestsessions = Session_Request() + responsesessions = self.stub.getSessionsInfo(requestsessions) + LOGGER.warning("IAM IN SHOWSESSIONS: {:s}".format(str(responsesessions))) + return responsesessions + + @RETRY_DECORATOR + def showLSPDB(self): + LOGGER.info("IAM IN SHOWLSPDB") + requestlsp = LSPdb_Request() + LOGGER.info("LSPDB REQUEST") + responselsp = self.stub.getLSPdb(requestlsp) + LOGGER.warning("IAM IN SHOWREQUEST: {:s}".format(str(responselsp))) + return responselsp + + @RETRY_DECORATOR + def sendUpdate(self, data): + #LOGGER.warning("IAM IN SEND UPDATE") + commandrequest = commandRequest() # Create an instance without passing data to __init__ + commandrequest.command = data + #LOGGER.warning("This is Command Request: %s", str(commandrequest)) + commandresponse = self.stub.update(commandrequest) + #LOGGER.warning("This is Command Response: %s", str(commandresponse)) + #LOGGER.warning("Success: %s", str(commandresponse.success)) + #LOGGER.warning("Error Message: %s", str(commandresponse.error_message)) + return commandresponse diff --git a/src/pcep/tests/Grpc_TestClient/test_gRPC_client.py b/src/pcep/tests/Grpc_TestClient/test_gRPC_client.py new file mode 100644 index 0000000000000000000000000000000000000000..22e2d74dda5e716637a78a100c91bdf110fbdeff --- /dev/null +++ b/src/pcep/tests/Grpc_TestClient/test_gRPC_client.py @@ -0,0 +1,51 @@ +# Copyright 2022-2024 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) + +# 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. + +import grpc +import logging +import sys + +sys.path.append('/home/ubuntu/tfs-ctrl/src') + + +from pcep.service.tools.protos.grpcService_pb2 import LSPdb_Request, Session_Request +from pcep.service.tools.protos.grpcService_pb2_grpc import pceServiceStub +def run(): + # Create a gRPC channel + # channel = grpc.insecure_channel('localhost:31816') + channel = grpc.insecure_channel('192.168.159.225:10060') + + # Create a gRPC stub + stub = pceServiceStub(channel) + + + #LSPDB + # Construct a request (LSPDB Request) + requestlsp = LSPdb_Request() + # Make the gRPC call + responselsp = stub.getLSPdb(requestlsp) + # Print the received response + print("\nRESPUESTA RECIBIDA") + print(responselsp) + + # Construct a request (Session Request) + sessionrequest = Session_Request() + # Make the gRPC call + sessionresponse = stub.getSessionsInfo(sessionrequest) + # Print the received response + print("\nRESPUESTA RECIBIDA") + print(sessionresponse) +if __name__ == '__main__': + logging.basicConfig() + run() diff --git a/src/pcep/tests/__init__.py b/src/pcep/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..a5ccb6078c2c18285753cacb045f9614017f8485 --- /dev/null +++ b/src/pcep/tests/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2022-2024 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# 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/pcep/tests/test_Cliente_grpc.py b/src/pcep/tests/test_Cliente_grpc.py new file mode 100644 index 0000000000000000000000000000000000000000..5f180577fc232bb00e7f679179d081287507a8c7 --- /dev/null +++ b/src/pcep/tests/test_Cliente_grpc.py @@ -0,0 +1,12 @@ +import sys +sys.path.append('/home/ubuntu/tfs-ctrl/src') + +# import pcep.tests.Grpc_TestClient.gRPC_PCEPClient as PcepClient +from pcep.client.PcepClient import PcepClient + +cliente = PcepClient() +cliente.connect() +print(cliente.showLSPDB()) +print(cliente.showSessions()) + +cliente.close() \ No newline at end of file diff --git a/src/policy/target/generated-sources/grpc/context/ContextOuterClass.java b/src/policy/target/generated-sources/grpc/context/ContextOuterClass.java index 126133075cf1a9f74b2547efb5f803300c55abac..d94b10a81e7f5190c1d36faabd046b884e873de7 100644 --- a/src/policy/target/generated-sources/grpc/context/ContextOuterClass.java +++ b/src/policy/target/generated-sources/grpc/context/ContextOuterClass.java @@ -23674,6 +23674,30 @@ public final class ContextOuterClass { * @return The usedCapacityGbps. */ float getUsedCapacityGbps(); + + /** + * float available_bw = 3; + * @return The availableBw. + */ + float getAvailableBw(); + + /** + * float link_delay = 5; + * @return The linkDelay. + */ + float getLinkDelay(); + + /** + * float min_max_link_delay = 6; + * @return The minMaxLinkDelay. + */ + float getMinMaxLinkDelay(); + + /** + * float delay_variation = 7; + * @return The delayVariation. + */ + float getDelayVariation(); } /** @@ -23733,6 +23757,58 @@ public final class ContextOuterClass { return usedCapacityGbps_; } + public static final int AVAILABLE_BW_FIELD_NUMBER = 3; + + private float availableBw_ = 0F; + + /** + * float available_bw = 3; + * @return The availableBw. + */ + @java.lang.Override + public float getAvailableBw() { + return availableBw_; + } + + public static final int LINK_DELAY_FIELD_NUMBER = 5; + + private float linkDelay_ = 0F; + + /** + * float link_delay = 5; + * @return The linkDelay. + */ + @java.lang.Override + public float getLinkDelay() { + return linkDelay_; + } + + public static final int MIN_MAX_LINK_DELAY_FIELD_NUMBER = 6; + + private float minMaxLinkDelay_ = 0F; + + /** + * float min_max_link_delay = 6; + * @return The minMaxLinkDelay. + */ + @java.lang.Override + public float getMinMaxLinkDelay() { + return minMaxLinkDelay_; + } + + public static final int DELAY_VARIATION_FIELD_NUMBER = 7; + + private float delayVariation_ = 0F; + + /** + * float delay_variation = 7; + * @return The delayVariation. + */ + @java.lang.Override + public float getDelayVariation() { + return delayVariation_; + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -23754,6 +23830,18 @@ public final class ContextOuterClass { if (java.lang.Float.floatToRawIntBits(usedCapacityGbps_) != 0) { output.writeFloat(2, usedCapacityGbps_); } + if (java.lang.Float.floatToRawIntBits(availableBw_) != 0) { + output.writeFloat(3, availableBw_); + } + if (java.lang.Float.floatToRawIntBits(linkDelay_) != 0) { + output.writeFloat(5, linkDelay_); + } + if (java.lang.Float.floatToRawIntBits(minMaxLinkDelay_) != 0) { + output.writeFloat(6, minMaxLinkDelay_); + } + if (java.lang.Float.floatToRawIntBits(delayVariation_) != 0) { + output.writeFloat(7, delayVariation_); + } getUnknownFields().writeTo(output); } @@ -23769,6 +23857,18 @@ public final class ContextOuterClass { if (java.lang.Float.floatToRawIntBits(usedCapacityGbps_) != 0) { size += com.google.protobuf.CodedOutputStream.computeFloatSize(2, usedCapacityGbps_); } + if (java.lang.Float.floatToRawIntBits(availableBw_) != 0) { + size += com.google.protobuf.CodedOutputStream.computeFloatSize(3, availableBw_); + } + if (java.lang.Float.floatToRawIntBits(linkDelay_) != 0) { + size += com.google.protobuf.CodedOutputStream.computeFloatSize(5, linkDelay_); + } + if (java.lang.Float.floatToRawIntBits(minMaxLinkDelay_) != 0) { + size += com.google.protobuf.CodedOutputStream.computeFloatSize(6, minMaxLinkDelay_); + } + if (java.lang.Float.floatToRawIntBits(delayVariation_) != 0) { + size += com.google.protobuf.CodedOutputStream.computeFloatSize(7, delayVariation_); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -23787,6 +23887,14 @@ public final class ContextOuterClass { return false; if (java.lang.Float.floatToIntBits(getUsedCapacityGbps()) != java.lang.Float.floatToIntBits(other.getUsedCapacityGbps())) return false; + if (java.lang.Float.floatToIntBits(getAvailableBw()) != java.lang.Float.floatToIntBits(other.getAvailableBw())) + return false; + if (java.lang.Float.floatToIntBits(getLinkDelay()) != java.lang.Float.floatToIntBits(other.getLinkDelay())) + return false; + if (java.lang.Float.floatToIntBits(getMinMaxLinkDelay()) != java.lang.Float.floatToIntBits(other.getMinMaxLinkDelay())) + return false; + if (java.lang.Float.floatToIntBits(getDelayVariation()) != java.lang.Float.floatToIntBits(other.getDelayVariation())) + return false; if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; @@ -23803,6 +23911,14 @@ public final class ContextOuterClass { hash = (53 * hash) + java.lang.Float.floatToIntBits(getTotalCapacityGbps()); hash = (37 * hash) + USED_CAPACITY_GBPS_FIELD_NUMBER; hash = (53 * hash) + java.lang.Float.floatToIntBits(getUsedCapacityGbps()); + hash = (37 * hash) + AVAILABLE_BW_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits(getAvailableBw()); + hash = (37 * hash) + LINK_DELAY_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits(getLinkDelay()); + hash = (37 * hash) + MIN_MAX_LINK_DELAY_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits(getMinMaxLinkDelay()); + hash = (37 * hash) + DELAY_VARIATION_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits(getDelayVariation()); hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -23909,6 +24025,10 @@ public final class ContextOuterClass { bitField0_ = 0; totalCapacityGbps_ = 0F; usedCapacityGbps_ = 0F; + availableBw_ = 0F; + linkDelay_ = 0F; + minMaxLinkDelay_ = 0F; + delayVariation_ = 0F; return this; } @@ -23949,6 +24069,18 @@ public final class ContextOuterClass { if (((from_bitField0_ & 0x00000002) != 0)) { result.usedCapacityGbps_ = usedCapacityGbps_; } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.availableBw_ = availableBw_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.linkDelay_ = linkDelay_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.minMaxLinkDelay_ = minMaxLinkDelay_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.delayVariation_ = delayVariation_; + } } @java.lang.Override @@ -23970,6 +24102,18 @@ public final class ContextOuterClass { if (other.getUsedCapacityGbps() != 0F) { setUsedCapacityGbps(other.getUsedCapacityGbps()); } + if (other.getAvailableBw() != 0F) { + setAvailableBw(other.getAvailableBw()); + } + if (other.getLinkDelay() != 0F) { + setLinkDelay(other.getLinkDelay()); + } + if (other.getMinMaxLinkDelay() != 0F) { + setMinMaxLinkDelay(other.getMinMaxLinkDelay()); + } + if (other.getDelayVariation() != 0F) { + setDelayVariation(other.getDelayVariation()); + } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -24007,6 +24151,34 @@ public final class ContextOuterClass { break; } // case 21 + case 29: + { + availableBw_ = input.readFloat(); + bitField0_ |= 0x00000004; + break; + } + // case 29 + case 45: + { + linkDelay_ = input.readFloat(); + bitField0_ |= 0x00000008; + break; + } + // case 45 + case 53: + { + minMaxLinkDelay_ = input.readFloat(); + bitField0_ |= 0x00000010; + break; + } + // case 53 + case 61: + { + delayVariation_ = input.readFloat(); + bitField0_ |= 0x00000020; + break; + } + // case 61 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -24098,6 +24270,142 @@ public final class ContextOuterClass { return this; } + private float availableBw_; + + /** + * float available_bw = 3; + * @return The availableBw. + */ + @java.lang.Override + public float getAvailableBw() { + return availableBw_; + } + + /** + * float available_bw = 3; + * @param value The availableBw to set. + * @return This builder for chaining. + */ + public Builder setAvailableBw(float value) { + availableBw_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * float available_bw = 3; + * @return This builder for chaining. + */ + public Builder clearAvailableBw() { + bitField0_ = (bitField0_ & ~0x00000004); + availableBw_ = 0F; + onChanged(); + return this; + } + + private float linkDelay_; + + /** + * float link_delay = 5; + * @return The linkDelay. + */ + @java.lang.Override + public float getLinkDelay() { + return linkDelay_; + } + + /** + * float link_delay = 5; + * @param value The linkDelay to set. + * @return This builder for chaining. + */ + public Builder setLinkDelay(float value) { + linkDelay_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * float link_delay = 5; + * @return This builder for chaining. + */ + public Builder clearLinkDelay() { + bitField0_ = (bitField0_ & ~0x00000008); + linkDelay_ = 0F; + onChanged(); + return this; + } + + private float minMaxLinkDelay_; + + /** + * float min_max_link_delay = 6; + * @return The minMaxLinkDelay. + */ + @java.lang.Override + public float getMinMaxLinkDelay() { + return minMaxLinkDelay_; + } + + /** + * float min_max_link_delay = 6; + * @param value The minMaxLinkDelay to set. + * @return This builder for chaining. + */ + public Builder setMinMaxLinkDelay(float value) { + minMaxLinkDelay_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * float min_max_link_delay = 6; + * @return This builder for chaining. + */ + public Builder clearMinMaxLinkDelay() { + bitField0_ = (bitField0_ & ~0x00000010); + minMaxLinkDelay_ = 0F; + onChanged(); + return this; + } + + private float delayVariation_; + + /** + * float delay_variation = 7; + * @return The delayVariation. + */ + @java.lang.Override + public float getDelayVariation() { + return delayVariation_; + } + + /** + * float delay_variation = 7; + * @param value The delayVariation to set. + * @return This builder for chaining. + */ + public Builder setDelayVariation(float value) { + delayVariation_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * float delay_variation = 7; + * @return This builder for chaining. + */ + public Builder clearDelayVariation() { + bitField0_ = (bitField0_ & ~0x00000020); + delayVariation_ = 0F; + onChanged(); + return this; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); @@ -81248,7 +81556,7 @@ public final class ContextOuterClass { internal_static_context_LinkId_descriptor = getDescriptor().getMessageTypes().get(23); internal_static_context_LinkId_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(internal_static_context_LinkId_descriptor, new java.lang.String[] { "LinkUuid" }); internal_static_context_LinkAttributes_descriptor = getDescriptor().getMessageTypes().get(24); - internal_static_context_LinkAttributes_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(internal_static_context_LinkAttributes_descriptor, new java.lang.String[] { "TotalCapacityGbps", "UsedCapacityGbps" }); + internal_static_context_LinkAttributes_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(internal_static_context_LinkAttributes_descriptor, new java.lang.String[] { "TotalCapacityGbps", "UsedCapacityGbps", "AvailableBw", "LinkDelay", "MinMaxLinkDelay", "DelayVariation" }); internal_static_context_Link_descriptor = getDescriptor().getMessageTypes().get(25); internal_static_context_Link_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(internal_static_context_Link_descriptor, new java.lang.String[] { "LinkId", "Name", "LinkType", "LinkEndpointIds", "Attributes" }); internal_static_context_LinkIdList_descriptor = getDescriptor().getMessageTypes().get(26); diff --git a/src/resource_manager/Dockerfile b/src/resource_manager/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..3d68292a79bd7fc9ac42728d80c2ea74d4aeece2 --- /dev/null +++ b/src/resource_manager/Dockerfile @@ -0,0 +1,74 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# 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. + +FROM python:3.9-slim + +# Actualizar e instalar wget para grpc_health_probe y compiladores si se necesitan +RUN apt-get update && \ + apt-get install -y wget g++ && \ + rm -rf /var/lib/apt/lists/* + +# Variable para logs Python no bufferizados +ENV PYTHONUNBUFFERED=0 + +# Descargar grpc_health_probe para readiness y liveness +RUN GRPC_HEALTH_PROBE_VERSION=v0.2.0 && \ + wget -qO/bin/grpc_health_probe https://github.com/grpc-ecosystem/grpc-health-probe/releases/download/${GRPC_HEALTH_PROBE_VERSION}/grpc_health_probe-linux-amd64 && \ + chmod +x /bin/grpc_health_probe + +# Instalar pip y herramientas necesarias +RUN python3 -m pip install --upgrade pip setuptools wheel pip-tools + +# Establecer directorio de trabajo +WORKDIR /var/teraflow + +COPY common_requirements.in common_requirements.in +RUN pip-compile --quiet --output-file=common_requirements.txt common_requirements.in +RUN python3 -m pip install -r common_requirements.txt + +# Add common files into working directory +WORKDIR /var/teraflow/common +COPY src/common/. ./ +RUN rm -rf proto + +# Create proto sub-folder, copy .proto files, and generate Python code +RUN mkdir -p /var/teraflow/common/proto +WORKDIR /var/teraflow/common/proto +RUN touch __init__.py +COPY proto/*.proto ./ +RUN python3 -m grpc_tools.protoc -I=. --python_out=. --grpc_python_out=. *.proto +RUN rm *.proto +RUN find . -type f -exec sed -i -E 's/(import\ .*)_pb2/from . \1_pb2/g' {} \; + + +# Create component sub-folders, get specific Python packages +RUN mkdir -p /var/teraflow/resource_manager +WORKDIR /var/teraflow/resource_manager +COPY src/resource_manager/requirements.in requirements.in +RUN pip-compile --quiet --output-file=requirements.txt requirements.in +RUN python3 -m pip install -r requirements.txt + +# Add component files into working directory +WORKDIR /var/teraflow +COPY src/context/. context/ +COPY src/device/. device/ +COPY src/pathcomp/frontend/. pathcomp/frontend/ +COPY src/service/. service/ +COPY src/resource_manager/. resource_manager/ + +# Exponer el puerto de gRPC +EXPOSE 40010 + +# Comando para arrancar el servicio +CMD ["python", "-m", "resource_manager.service"] diff --git a/src/resource_manager/README.txt b/src/resource_manager/README.txt new file mode 100644 index 0000000000000000000000000000000000000000..e330f158731308e243349c8fcae5bc58a80f2f21 --- /dev/null +++ b/src/resource_manager/README.txt @@ -0,0 +1,33 @@ +Overview: + +ResourceManager is a supporting microservice designed to manage network resources (IP and VLAN) within the SDN controller TFS. +Its main purpose is to verify the availability of such resources before deploying L2 or L3 services, acting as a safeguard to prevent conflicts or duplicate assignments. + +Current Status: + +The gRPC service has been implemented in Python. +The current logic supports: + Checking whether an IP or VLAN is already assigned on the router. + Assigning a new IP or VLAN (in-memory) if available. +Resource state is maintained in memory only, with no persistence. +The module is already integrated with the TFS controller, and is called before generating services for the NBI. + +Structure: + +├── Dockerfile # Docker image definition for the service +├── README.txt +├── requirements.in # Service dependencies (e.g., gRPC) +├── __init__.py +├── client/ +│ ├── ResourceManagerClient.py # gRPC client to test the service +│ └── __init__.py +└── service/ + ├── ResourceManagerService.py # gRPC service logic + ├── ResourceManagerServicerImpl.py # gRPC server implementation + ├── __init__.py + └── __main__.py # Main entry point (launches the server) + +proto/ +│ └── resource_manager.proto # gRPC service definition (messages & service interface) +manifest/ +│ └── resource-manager-deployment.yaml # Kubernetes Deployment & Service definition \ No newline at end of file diff --git a/src/resource_manager/__init__.py b/src/resource_manager/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/resource_manager/client/ResourceManagerClient.py b/src/resource_manager/client/ResourceManagerClient.py new file mode 100644 index 0000000000000000000000000000000000000000..b37190eb16f1bef548e2da7ec8df474ec6153bea --- /dev/null +++ b/src/resource_manager/client/ResourceManagerClient.py @@ -0,0 +1,50 @@ +import grpc, logging +from common.Constants import ServiceNameEnum +from common.Settings import get_service_host, get_service_port_grpc +from common.proto.resource_manager_pb2 import L2Request, L2Response, L3Request, L3Response +from common.proto.resource_manager_pb2_grpc import ResourceManagerStub +from common.tools.client.RetryDecorator import retry, delay_exponential +from common.tools.grpc.Tools import grpc_message_to_json_string + +LOGGER = logging.getLogger(__name__) +MAX_RETRIES = 15 +DELAY_FUNCTION = delay_exponential(initial=0.01, increment=2.0, maximum=5.0) +RETRY_DECORATOR = retry(max_retries=MAX_RETRIES, delay_function=DELAY_FUNCTION, prepare_method_name='connect') + + +class ResourceManagerClient: + def __init__(self, host=None, port=None): + if not host: + host = get_service_host(ServiceNameEnum.RESOURCE_MANAGER) + if not port: + port = get_service_port_grpc(ServiceNameEnum.RESOURCE_MANAGER) + self.endpoint = f"{host}:{port}" + LOGGER.info(f"Creating channel to {self.endpoint}...") + self.channel = None + self.stub = None + self.connect() + LOGGER.info("Channel created") + + def connect(self): + self.channel = grpc.insecure_channel(self.endpoint) + self.stub = ResourceManagerStub(self.channel) + + def close(self): + if self.channel is not None: + self.channel.close() + self.channel = None + self.stub = None + + @RETRY_DECORATOR + def VerifyAndAssignL2(self, request: L2Request) -> L2Response: + LOGGER.info(f"VerifyAndAssignL2 request: {grpc_message_to_json_string(request)}") + response = self.stub.VerifyAndAssignL2(request) + LOGGER.info(f"VerifyAndAssignL2 response: {grpc_message_to_json_string(response)}") + return response + + @RETRY_DECORATOR + def VerifyAndAssignL3(self, request: L3Request) -> L3Response: + LOGGER.info(f"VerifyAndAssignL3 request: {grpc_message_to_json_string(request)}") + response = self.stub.VerifyAndAssignL3(request) + LOGGER.info(f"VerifyAndAssignL3 response: {grpc_message_to_json_string(response)}") + return response \ No newline at end of file diff --git a/src/resource_manager/client/__init__.py b/src/resource_manager/client/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/resource_manager/requirements.in b/src/resource_manager/requirements.in new file mode 100644 index 0000000000000000000000000000000000000000..3ccbed1e2cf63dbf06c55eb8015fcb8589598de5 --- /dev/null +++ b/src/resource_manager/requirements.in @@ -0,0 +1,17 @@ +# Copyright 2022-2024 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# 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. + + +grpcio==1.47.* +protobuf==3.20.* \ No newline at end of file diff --git a/src/resource_manager/service/ResourceManagerService.py b/src/resource_manager/service/ResourceManagerService.py new file mode 100644 index 0000000000000000000000000000000000000000..b70310679663cd3f7e4ed1bd2f729f651088566d --- /dev/null +++ b/src/resource_manager/service/ResourceManagerService.py @@ -0,0 +1,35 @@ +# Copyright 2022-2024 ETSI OSG/SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/) +# +# 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. + +import logging +from common.Constants import ServiceNameEnum +from common.Settings import get_service_port_grpc +from common.tools.service.GenericGrpcService import GenericGrpcService +from common.proto.resource_manager_pb2_grpc import add_ResourceManagerServicer_to_server +from .ResourceManagerServicerImpl import ResourceManagerServicerImpl + + +LOGGER = logging.getLogger(__name__) + + +class ResourceManagerService(GenericGrpcService): + def __init__(self, cls_name: str = __name__) -> None: + port = get_service_port_grpc(ServiceNameEnum.RESOURCEMANAGER) + super().__init__(port, cls_name=cls_name) + self.servicer = ResourceManagerServicerImpl() + + def install_servicers(self): + add_ResourceManagerServicer_to_server(self.servicer, self.server) + + diff --git a/src/resource_manager/service/ResourceManagerServicerImpl.py b/src/resource_manager/service/ResourceManagerServicerImpl.py new file mode 100644 index 0000000000000000000000000000000000000000..0f1006b79b8b1f1ec39eb0b91f8fd3684093f7e4 --- /dev/null +++ b/src/resource_manager/service/ResourceManagerServicerImpl.py @@ -0,0 +1,75 @@ +# Copyright 2022-2024 ETSI OSG/SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/) +# +# 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. + +import grpc, logging +from common.method_wrappers.Decorator import MetricsPool, safe_and_metered_rpc_method + +from common.proto.resource_manager_pb2_grpc import ResourceManagerServicer +from common.proto.resource_manager_pb2 import ( + L2Request, L2Response, + L3Request, L3Response +) + +# Métricas +RESOURCE_POOL = MetricsPool('ResourceManager', 'RPC') +LOGGER = logging.getLogger(__name__) + + +class ResourceManagerServicerImpl(ResourceManagerServicer): + def __init__(self): + LOGGER.info("Initializing ResourceManagerServicerImpl") + + self.assigned_vlans = {} # (device_uuid, endpoint_uuid) -> vlan_id + self.assigned_ips = {} # (device_uuid, endpoint_uuid) -> ip_address + + @safe_and_metered_rpc_method(RESOURCE_POOL, LOGGER) + def VerifyAndAssignL2(self, request: L2Request, context: grpc.ServicerContext) -> L2Response: + key = (request.device_uuid, request.endpoint_uuid) + LOGGER.info("Vlanid: %s, Endpoint: %s", request.vlan_id, key) + if key in self.assigned_vlans: + assigned_vlan = self.assigned_vlans[key] + if assigned_vlan == request.vlan_id: + msg = f"VLAN {request.vlan_id} already assigned to endpoint {key}." + LOGGER.info(msg) + return L2Response(success=True, message=msg) + else: + msg = f"Conflict: endpoint {key} already has VLAN {assigned_vlan} assigned." + LOGGER.warning(msg) + return L2Response(success=False, message=msg) + else: + self.assigned_vlans[key] = request.vlan_id + msg = f"Assigned VLAN {request.vlan_id} to endpoint {key}." + LOGGER.info(msg) + return L2Response(success=True, message=msg) + + + @safe_and_metered_rpc_method(RESOURCE_POOL, LOGGER) + def VerifyAndAssignL3(self, request: L3Request, context: grpc.ServicerContext) -> L3Response: + key = (request.device_uuid, request.endpoint_uuid) + + if key in self.assigned_ips: + assigned_ip = self.assigned_ips[key] + if assigned_ip == request.ip_address: + msg = f"IP {request.ip_address} already assigned to endpoint {key}." + LOGGER.info(msg) + return L3Response(success=True, message=msg) + else: + msg = f"Conflict: endpoint {key} already has IP {assigned_ip} assigned." + LOGGER.warning(msg) + return L3Response(success=False, message=msg) + else: + self.assigned_ips[key] = request.ip_address + msg = f"Assigned IP {request.ip_address} to endpoint {key}." + LOGGER.info(msg) + return L3Response(success=True, message=msg) \ No newline at end of file diff --git a/src/resource_manager/service/__init__.py b/src/resource_manager/service/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..3ee6f7071f145e06c3aeaefc09a43ccd88e619e3 --- /dev/null +++ b/src/resource_manager/service/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2022-2024 ETSI OSG/SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/) +# +# 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/resource_manager/service/__main__.py b/src/resource_manager/service/__main__.py new file mode 100644 index 0000000000000000000000000000000000000000..e26477627e854da08f5e1214dda3942b5cee5996 --- /dev/null +++ b/src/resource_manager/service/__main__.py @@ -0,0 +1,53 @@ +# Copyright 2022-2024 ETSI OSG/SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/) +# +# 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. + +import logging, signal, sys, threading +from common.Settings import get_log_level +from .ResourceManagerService import ResourceManagerService + +terminate = threading.Event() +LOGGER = logging.getLogger(__name__) + +def signal_handler(signal, frame): # pylint: disable=redefined-outer-name + LOGGER.warning('Terminate signal received') + LOGGER.warning(signal) + terminate.set() + +def main(): + global LOGGER # pylint: disable=global-statement + + log_level = get_log_level() + logging.basicConfig(level=log_level) + LOGGER = logging.getLogger(__name__) + + signal.signal(signal.SIGINT, signal_handler) + signal.signal(signal.SIGTERM, signal_handler) + + LOGGER.debug('Starting...') + + grpc_service = ResourceManagerService() #Create instance of the GRPC Server + grpc_service.start() + + + # Wait for Ctrl+C or termination signal + while not terminate.wait(timeout=1.0): pass + + LOGGER.debug('Terminating...') + grpc_service.stop() + + LOGGER.debug('Bye') + return 0 + +if __name__ == '__main__': + sys.exit(main()) \ No newline at end of file diff --git a/src/service/Dockerfile b/src/service/Dockerfile index 49efe9829d63f1923b3bb271c66a05b02bd8e499..8ff3bf8d7937c760a4dae6e8478504b8e1fff338 100644 --- a/src/service/Dockerfile +++ b/src/service/Dockerfile @@ -76,6 +76,8 @@ COPY src/e2e_orchestrator/__init__.py e2e_orchestrator/__init__.py COPY src/e2e_orchestrator/client/. e2e_orchestrator/client/ COPY src/qkd_app/__init__.py qkd_app/__init__.py COPY src/qkd_app/client/. qkd_app/client/ +COPY src/resource_manager/__init__.py resource_manager/__init__.py +COPY src/resource_manager/client/. resource_manager/client/ COPY src/service/. service/ # Start the service diff --git a/src/service/service/service_handlers/l2nm_openconfig/L2NMOpenConfigServiceHandler.py b/src/service/service/service_handlers/l2nm_openconfig/L2NMOpenConfigServiceHandler.py index 2f41a414d4cf8ba1a72b5f5debecccc493186e36..8d72a04cb40544b36f7f76ffac7c1af5e2eb6ee2 100644 --- a/src/service/service/service_handlers/l2nm_openconfig/L2NMOpenConfigServiceHandler.py +++ b/src/service/service/service_handlers/l2nm_openconfig/L2NMOpenConfigServiceHandler.py @@ -23,6 +23,7 @@ from service.service.service_handler_api._ServiceHandler import _ServiceHandler from service.service.service_handler_api.SettingsHandler import SettingsHandler from service.service.task_scheduler.TaskExecutor import TaskExecutor from .ConfigRules import setup_config_rules, teardown_config_rules +from resource_manager.client.ResourceManagerClient import ResourceManagerClient LOGGER = logging.getLogger(__name__) @@ -35,7 +36,8 @@ class L2NMOpenConfigServiceHandler(_ServiceHandler): self.__service = service self.__task_executor = task_executor self.__settings_handler = SettingsHandler(service.service_config, **settings) - + self.__resource_manager = ResourceManagerClient() + @metered_subclass_method(METRICS_POOL) def SetEndpoint( self, endpoints : List[Tuple[str, str, Optional[str]]], connection_uuid : Optional[str] = None @@ -57,6 +59,20 @@ class L2NMOpenConfigServiceHandler(_ServiceHandler): endpoint_acls = self.__settings_handler.get_endpoint_acls(device_obj, endpoint_obj) endpoint_name = endpoint_obj.name + + vlan_id = endpoint_settings.value('vlan_id') + resp = self.__resource_manager.verify_and_assign_l2( + device_uuid=device_uuid, + endpoint_uuid=endpoint_uuid, + vlan_id=vlan_id, + service_uuid=service_uuid, + connection_uuid=connection_uuid or 'default', + endpoint_name=endpoint_name + ) + + if not resp.success: + raise Exception(f"ResourceManager L2 error: {resp.message}") + json_config_rules = setup_config_rules( service_uuid, connection_uuid, device_uuid, endpoint_uuid, endpoint_name, settings, endpoint_settings, endpoint_acls) diff --git a/src/service/service/service_handlers/qkd/qkd_service_handler.py b/src/service/service/service_handlers/qkd/qkd_service_handler.py index 24ca2a88703d58131bb9c8033357cc4c2b344eb2..a700535847cd7e45643822f398ae1121f025b591 100644 --- a/src/service/service/service_handlers/qkd/qkd_service_handler.py +++ b/src/service/service/service_handlers/qkd/qkd_service_handler.py @@ -57,7 +57,7 @@ class QKDServiceHandler(_ServiceHandler): if len(endpoints) < 2 or len(endpoints) % 2: return [] LOGGER.info('Endpoints: ' + str(endpoints)) - + service_uuid = self.__service.service_id.service_uuid.uuid settings = self.__settings_handler.get('/settings') @@ -71,7 +71,7 @@ class QKDServiceHandler(_ServiceHandler): is_virtual = True else: is_virtual = False - + devices = [] qkdn_ids = [] interfaces = [] @@ -99,7 +99,7 @@ class QKDServiceHandler(_ServiceHandler): if resource_key == '__node__': value = json.loads(config_rule.custom.resource_value) qkdn_ids.append(value['qkdn_id']) - + elif resource_key.startswith('/interface'): value = json.loads(config_rule.custom.resource_value) try: @@ -112,11 +112,11 @@ class QKDServiceHandler(_ServiceHandler): interfaces[idx][1] = value['qkdi_id'] except KeyError: pass - + elif resource_key.startswith('/link'): value = json.loads(config_rule.custom.resource_value) links[idx].append(( value['uuid'], - (value['src_qkdn_id'], value['src_interface_id']), + (value['src_qkdn_id'], value['src_interface_id']), (value['dst_qkdn_id'], value['dst_interface_id']) )) @@ -145,7 +145,7 @@ class QKDServiceHandler(_ServiceHandler): service_qkdl_id_src_dst = str(uuid.uuid4()) service_qkdl_id_dst_src = str(uuid.uuid4()) - + for idx, device in enumerate(devices): # Even though we always create them together. There is a chance the admin deletes one of the rules manually @@ -208,7 +208,7 @@ class QKDServiceHandler(_ServiceHandler): }) device.device_config.config_rules.append(ConfigRule(**json_config_rule)) - + if is_virtual: @@ -269,7 +269,7 @@ class QKDServiceHandler(_ServiceHandler): } self.__task_executor.register_qkd_app(App(**internal_app_src_dst)) - + # Register App internal_app_dst_src = { @@ -364,7 +364,7 @@ class QKDServiceHandler(_ServiceHandler): LOGGER.info(f"Apps retrieved: {apps}") except grpc.RpcError as e: LOGGER.error(f"gRPC error while fetching apps: {e.details()}") - if e.code() != grpc.StatusCode.NOT_FOUND: + if e.code() != grpc.StatusCode.NOT_FOUND: raise apps = list() # If an error occurs, ensure `apps` is still an empty list @@ -394,17 +394,17 @@ class QKDServiceHandler(_ServiceHandler): try: context_id = ContextId(context_uuid=Uuid(uuid=context_uuid)) apps_response = self.qkd_app_client.ListApps(context_id) - + # Log the apps retrieved to ensure they exist and have a status LOGGER.info(f"Apps retrieved: {apps_response.apps}") - + internal_apps = [ app for app in apps_response.apps - if app.app_type == QKDAppTypesEnum.QKDAPPTYPES_INTERNAL + if app.app_type == QKDAppTypesEnum.QKDAPPTYPES_INTERNAL and app.server_app_id == service_uuid and app.app_status == QKDAppStatusEnum.ACTIVE # Ensure you are checking status ] - + LOGGER.info(f"Filtered internal apps: {internal_apps}") return internal_apps diff --git a/src/webui/Dockerfile b/src/webui/Dockerfile index 167280d6890613bd623053e9699ec7ea4a225554..18a59f1c905cfa5695c60a0e77ab9438629424b7 100644 --- a/src/webui/Dockerfile +++ b/src/webui/Dockerfile @@ -90,7 +90,10 @@ COPY --chown=webui:webui src/bgpls_speaker/__init__.py bgpls_speaker/__init__.py COPY --chown=webui:webui src/bgpls_speaker/client/. bgpls_speaker/client/ COPY --chown=webui:webui src/vnt_manager/__init__.py vnt_manager/__init__.py COPY --chown=webui:webui src/vnt_manager/client/. vnt_manager/client/ +COPY --chown=webui:webui src/pcep/__init__.py pcep/__init__.py +COPY --chown=webui:webui src/pcep/client/. pcep/client/ COPY --chown=webui:webui src/webui/. webui/ + # Start the service ENTRYPOINT ["python", "-m", "webui.service"] diff --git a/src/webui/requirements.in b/src/webui/requirements.in index 8da0e74b6d269abde797a9b9460f34cf04213ae9..c26ec426e3c941a01b7d6224564e1c4f0d331a89 100644 --- a/src/webui/requirements.in +++ b/src/webui/requirements.in @@ -18,3 +18,11 @@ flask-healthz<2 flask-unittest==0.1.3 lorem-text==2.1 werkzeug==2.3.7 + + + +#DB +psycopg2-binary==2.9.* +SQLAlchemy==1.4.* +sqlalchemy-cockroachdb==1.4.* +SQLAlchemy-Utils==0.38.* diff --git a/src/webui/service/__init__.py b/src/webui/service/__init__.py index bfdfbb9fbafa6fd9e48c7714e8e34407505a21e9..eec91b97496233b24446d891d1bf5364ddf968f5 100644 --- a/src/webui/service/__init__.py +++ b/src/webui/service/__init__.py @@ -121,6 +121,9 @@ def create_app(use_config=None, web_app_root=None): from webui.service.policy_rule.routes import policy_rule # pylint: disable=import-outside-toplevel app.register_blueprint(policy_rule) + from webui.service.pcep.routes import pcep # pylint: disable=import-outside-toplevel + app.register_blueprint(pcep) + app.jinja_env.globals.update({ # pylint: disable=no-member 'enumerate' : enumerate, 'grpc_message_to_json': grpc_message_to_json, diff --git a/src/webui/service/pcep/__init__.py b/src/webui/service/pcep/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..1549d9811aa5d1c193a44ad45d0d7773236c0612 --- /dev/null +++ b/src/webui/service/pcep/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# 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/webui/service/pcep/forms.py b/src/webui/service/pcep/forms.py new file mode 100644 index 0000000000000000000000000000000000000000..3b4008cd66755f22c7bf27ac33e892e4bf35a579 --- /dev/null +++ b/src/webui/service/pcep/forms.py @@ -0,0 +1,67 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# 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. + +# external imports +#TIPOS DE FORMULARIO + +from flask_wtf import FlaskForm +from wtforms import SelectField, SubmitField +from wtforms import StringField, SelectField, TextAreaField, SubmitField, BooleanField +from wtforms.validators import DataRequired, Length, NumberRange, ValidationError +from common.proto.context_pb2 import DeviceOperationalStatusEnum + +class AddDeviceForm(FlaskForm): + device_id = StringField('ID', + validators=[DataRequired(), Length(min=5)]) + device_type = SelectField('Type', choices = []) + operational_status = SelectField('Operational Status', + # choices=[(-1, 'Select...'), (0, 'Undefined'), (1, 'Disabled'), (2, 'Enabled')], + coerce=int, + validators=[NumberRange(min=0)]) + device_drivers_undefined = BooleanField('UNDEFINED / EMULATED') + device_drivers_openconfig = BooleanField('OPENCONFIG') + device_drivers_transport_api = BooleanField('TRANSPORT_API') + device_drivers_p4 = BooleanField('P4') + device_drivers_ietf_network_topology = BooleanField('IETF_NETWORK_TOPOLOGY') + device_drivers_onf_tr_352 = BooleanField('ONF_TR_352') + device_drivers_xr = BooleanField('XR') + device_config_address = StringField('connect/address',default='127.0.0.1',validators=[DataRequired(), Length(min=5)]) + device_config_port = StringField('connect/port',default='0',validators=[DataRequired(), Length(min=1)]) + device_config_settings = TextAreaField('connect/settings',default='{}',validators=[DataRequired(), Length(min=2)]) + submit = SubmitField('Add') + + def validate_operational_status(form, field): + if field.data not in DeviceOperationalStatusEnum.DESCRIPTOR.values_by_number: + raise ValidationError('The operational status value selected is incorrect!') + +class ConfigForm(FlaskForm): + device_key_config = StringField('Key configuration') + device_value_config = StringField('Value configuration') + submit = SubmitField('Add') + +class UpdateDeviceForm(FlaskForm): + update_operational_status = SelectField('Operational Status', + choices=[(-1, 'Select...'), (0, 'Undefined'), (1, 'Disabled'), (2, 'Enabled')], + coerce=int, + validators=[NumberRange(min=0)]) + + submit = SubmitField('Update') + +class ConfigIpPCEForm(FlaskForm): + pce_address = StringField('ip',default='127.0.0.1',validators=[DataRequired(), Length(min=5)]) + submit = SubmitField('Submit') + +class SendPathForm(FlaskForm): + command = StringField('command',render_kw={"placeholder": "initiate lsp nombre_lsp 10.95.90.56 1.1.1.1 1.1.1.2 m1228800 na192.168.3.11-192.168.3.13 m819200 na192.168.2.13-192.168.2.12"},validators=[DataRequired(), Length(min=5)]) + submit = SubmitField('Submit') diff --git a/src/webui/service/pcep/routes.py b/src/webui/service/pcep/routes.py new file mode 100644 index 0000000000000000000000000000000000000000..4afb99aadc306ae659becf802cd34ecf501b09fb --- /dev/null +++ b/src/webui/service/pcep/routes.py @@ -0,0 +1,265 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# 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. + +import json,logging +from flask import render_template, Blueprint, flash, session, redirect, url_for, request +from common.proto.context_pb2 import ( + ConfigActionEnum, Device, DeviceDriverEnum, DeviceId, DeviceList, DeviceOperationalStatusEnum, + Empty, TopologyId) +from common.tools.object_factory.Context import json_context_id +from common.tools.object_factory.Topology import json_topology_id +from context.client.ContextClient import ContextClient +from device.client.DeviceClient import DeviceClient +from webui.service.pcep.forms import ConfigIpPCEForm, SendPathForm + +from pcep.client.PcepClient import PcepClient +#from pcep.service.tools.Grpc_TestClient.gRPC_PCEPClient import GrpcPcepClient + +from webui.service.device.forms import AddDeviceForm +from common.DeviceTypes import DeviceTypeEnum + +from common.proto.pcep_pb2 import (PceIpRq, RequestRq) + +pcep = Blueprint('pcep', __name__, url_prefix='/pcep') +context_client = ContextClient() +device_client = DeviceClient() +pcep_client = PcepClient() +#grpc_pcep_client = GrpcPcepClient() +logger = logging.getLogger(__name__) + +@pcep.get('/') +def home(): + if 'context_uuid' not in session or 'topology_uuid' not in session: + flash("Please select a context!", "warning") + return redirect(url_for("main.home")) + + context_uuid = session['context_uuid'] + topology_uuid = session['topology_uuid'] + + context_client.connect() + json_topo_id = json_topology_id(topology_uuid, context_id=json_context_id(context_uuid)) + grpc_topology = context_client.GetTopology(TopologyId(**json_topo_id)) + topo_device_uuids = {device_id.device_uuid.uuid for device_id in grpc_topology.device_ids} + + if grpc_topology is None: + flash('Context({:s})/Topology({:s}) not found'.format(str(context_uuid), str(topology_uuid)), 'danger') + devices = [] + else: + topo_device_uuids = {device_id.device_uuid.uuid for device_id in grpc_topology.device_ids} + grpc_devices: DeviceList = context_client.ListDevices(Empty()) + devices = [ + device for device in grpc_devices.devices + if device.device_id.device_uuid.uuid in topo_device_uuids + ] + + # ListNewDevices discovered from bgpls + logger.info('pcep/home') + pcep_client.connect() + logger.info('pcep_client.connect %s',pcep_client) + + context_client.close() + pcep_client.close() + + return render_template( + 'pcep/home.html', devices=devices, dde=DeviceDriverEnum, + dose=DeviceOperationalStatusEnum) + +@pcep.route('managePCEP', methods=['GET', 'POST']) +def managePCEP(): + pcep_manage_form = SendPathForm() + if pcep_manage_form.validate_on_submit(): + pcep_client.connect() + logger.info('Send Path ip:%s',pcep_manage_form.command.data) + command_response = pcep_client.sendRequest(RequestRq(command=pcep_manage_form.command.data)) + #logger.info('THIS IS THE RESPONSE:%s',command_response) + #logger.info('THIS IS THE RESPONSE BOOL:%s',command_response.success) + #logger.info('THIS IS THE RESPONSE ERROR:%s',command_response.error_message) + if command_response.success: + flash(f'Command: "{pcep_manage_form.command.data}" was executed sucesfully!', 'success') + else: + flash(f'Command "{pcep_manage_form.command.data}" was not executed sucesfully', 'danger') + flash(f'Error Information: "{command_response.error_message}"', 'warning') + pcep_client.close() + + pcep_client.connect() + sessions = pcep_client.showSessions() + pcep_client.close() + + return render_template('pcep/managePCEP.html', pcep_manage_form=pcep_manage_form, sessions=sessions) + +@pcep.route('lspdbPCEP', methods=['GET', 'POST']) +def lspdbPCEP(): + pcep_client.connect() + logger.info('pcep_client.connect %s',pcep_client) + + lspdb = pcep_client.showLSPDB() + if lspdb: + flash(f'LSPDB data retrieved', 'success') + pcep_client.close() + return render_template('pcep/lspdb.html', lspdb=lspdb) + +@pcep.route('sendPath', methods=['GET', 'POST']) +def sendPath(): + pcep_client.connect() + form = SendPathForm() + response = None + if form.validate_on_submit(): + logger.info('Send Path ip:%s',form.command.data) + response = pcep_client.sendRequest(RequestRq(command=form.command.data)) + flash(f'Command "{form.command.data}" added successfully!', 'success') + pcep_client.close() + return render_template('pcep/sendPath.html',form=form,response=response) + + +@pcep.route('add/', methods=['GET', 'POST']) +def add(device_name): + """" + Add a discovered device from bgpls protocol. Populate form from + existent info in bgpls. + """ + # TODO: Conect to device and get necessary info + form = AddDeviceForm() + + logger.info('pcep/add') + + # listing enum values + form.operational_status.choices = [] + for key, _ in DeviceOperationalStatusEnum.DESCRIPTOR.values_by_name.items(): + form.operational_status.choices.append( + (DeviceOperationalStatusEnum.Value(key), key.replace('DEVICEOPERATIONALSTATUS_', ''))) + + form.device_type.choices = [] + # items for Device Type field + for device_type in DeviceTypeEnum: + form.device_type.choices.append((device_type.value,device_type.value)) + + if form.validate_on_submit(): + device_obj = Device() + # Device UUID: + device_obj.device_id.device_uuid.uuid = form.device_id.data # pylint: disable=no-member + + # Device type: + device_obj.device_type = str(form.device_type.data) + + # Device configurations: + config_rule = device_obj.device_config.config_rules.add() # pylint: disable=no-member + config_rule.action = ConfigActionEnum.CONFIGACTION_SET + config_rule.custom.resource_key = '_connect/address' + config_rule.custom.resource_value = form.device_config_address.data + + config_rule = device_obj.device_config.config_rules.add() # pylint: disable=no-member + config_rule.action = ConfigActionEnum.CONFIGACTION_SET + config_rule.custom.resource_key = '_connect/port' + config_rule.custom.resource_value = form.device_config_port.data + + config_rule = device_obj.device_config.config_rules.add() # pylint: disable=no-member + config_rule.action = ConfigActionEnum.CONFIGACTION_SET + config_rule.custom.resource_key = '_connect/settings' + + try: + device_config_settings = json.loads(form.device_config_settings.data) + except: # pylint: disable=bare-except + device_config_settings = form.device_config_settings.data + + if isinstance(device_config_settings, dict): + config_rule.custom.resource_value = json.dumps(device_config_settings) + else: + config_rule.custom.resource_value = str(device_config_settings) + + # Device status: + device_obj.device_operational_status = form.operational_status.data + + # Device drivers: + if form.device_drivers_undefined.data: + device_obj.device_drivers.append(DeviceDriverEnum.DEVICEDRIVER_UNDEFINED) + if form.device_drivers_openconfig.data: + device_obj.device_drivers.append(DeviceDriverEnum.DEVICEDRIVER_OPENCONFIG) + if form.device_drivers_transport_api.data: + device_obj.device_drivers.append(DeviceDriverEnum.DEVICEDRIVER_TRANSPORT_API) + if form.device_drivers_p4.data: + device_obj.device_drivers.append(DeviceDriverEnum.DEVICEDRIVER_P4) + if form.device_drivers_ietf_network_topology.data: + device_obj.device_drivers.append(DeviceDriverEnum.DEVICEDRIVER_IETF_NETWORK_TOPOLOGY) + if form.device_drivers_onf_tr_352.data: + device_obj.device_drivers.append(DeviceDriverEnum.DEVICEDRIVER_ONF_TR_352) + if form.device_drivers_xr.data: + device_obj.device_drivers.append(DeviceDriverEnum.DEVICEDRIVER_XR) + + try: + device_client.connect() + logger.info('add device from pcep:%s',device_obj) + response: DeviceId = device_client.AddDevice(device_obj) + device_client.close() + flash(f'New device was created with ID "{response.device_uuid.uuid}".', 'success') + #pcep_client.connect() + #pcep_client.configuratePCE(PceIpRq(address=device_obj.device_id.device_uuid.uuid)) + #pcep_client.close() + return redirect(url_for('device.home')) + except Exception as e: + flash(f'Problem adding the device. {e.details()}', 'danger') + + # Prefill data with discovered info from speaker + # Device Name from bgpls + form.device_name=device_name + device=device_name + form.device_id.data=device_name + # Default values (TODO: NOT WORKING) + form.device_type.data=DeviceTypeEnum.EMULATED_PACKET_ROUTER + form.device_config_settings.data=str('{"username": "admin", "password": "admin"}') + + return render_template('pcep/add.html', form=form, device=device, + submit_text='Add New Device') + +@pcep.route('detail/', methods=['GET', 'POST']) +def detail(device_uuid: str): + request = DeviceId() + request.device_uuid.uuid = device_uuid + context_client.connect() + response = context_client.GetDevice(request) + context_client.close() + return render_template('pcep/detail.html', device=response, + dde=DeviceDriverEnum, + dose=DeviceOperationalStatusEnum) + +@pcep.route('addPcep', methods=['GET', 'POST']) +def addPcep(): + + pcep_client.connect() + form = ConfigIpPCEForm() + if form.validate_on_submit(): + pcep_client.connect() + logger.info('addPcep ip:%s',form.pce_address.data) + pcep_client.configuratePCE(PceIpRq(address=form.pce_address.data)) + logger.info('Prueba 1') + flash(f'Pcep "{form.pce_address.data}" added successfully!', 'success') + logger.info('Prueba 2') + pcep_client.close() + logger.info('Prueba 3') + return render_template('pcep/addPcep.html',form=form) + + + + +@pcep.route('formPcep', methods=['GET','POST']) +def formPcep(): + #conectar con pcep? + form = ConfigIpPCEForm() + if request.method=="POST": + address = form.pce_address.data + logger.info("FORM formPcep: %s ", address) + + flash(f'Pcep "{address}" added successfully!', 'success') + + return redirect(url_for('pcep.home')) + diff --git a/src/webui/service/templates/base.html b/src/webui/service/templates/base.html index 8b7a6d90a514fb372cd1808653d09c737de0a940..d60ce11045f605cfbaba711b0cf9be7402f20b85 100644 --- a/src/webui/service/templates/base.html +++ b/src/webui/service/templates/base.html @@ -2,41 +2,41 @@ - + - + - + - + ETSI TeraFlowSDN Controller - + - -
+ + + +
+
+
+ {% with messages = get_flashed_messages(with_categories=true) %} + {% if messages %} + {% for category, message in messages %} + + + {% endfor %} + {% endif %} + {% endwith %} +
+
+
+
+ {% block content %}{% endblock %} +
+
+
+ +
+
- {% with messages = get_flashed_messages(with_categories=true) %} - {% if messages %} - {% for category, message in messages %} - - - {% endfor %} - {% endif %} - {% endwith %} +

© 2022-2024 ETSI OSG/SDG TeraFlowSDN (TFS)

-
- {% block content %}{% endblock %} +
+

This project has received funding from the European Union's Horizon 2020 research and innovation programme under grant agreement No 101015857.

+
+
+ 5g ppp EU logo
- +
@@ -194,9 +212,9 @@
- + - + diff --git a/src/webui/service/templates/pcep/add.html b/src/webui/service/templates/pcep/add.html new file mode 100644 index 0000000000000000000000000000000000000000..6b76cedd2ab7aefbc257863c8e20a09e17a4c6ac --- /dev/null +++ b/src/webui/service/templates/pcep/add.html @@ -0,0 +1,160 @@ + + +{% extends 'base.html' %} +{% block content %} +

Add New Device

+

Node name: {{form.device_name}}

+
+ {{ form.hidden_tag() }} +
+
+ {{ form.device_id.label(class="col-sm-2 col-form-label") }} +
+ {% if form.device_id.errors %} + {{ form.device_id(class="form-control is-invalid") }} +
+ {% for error in form.device_id.errors %} + {{ error }} + {% endfor %} +
+ {% else %} + {{ form.device_id(class="form-control") }} + {% endif %} +
+
+
+
+ {{ form.device_type.label(class="col-sm-2 col-form-label") }} +
+ {% if form.device_type.errors %} + {{ form.device_type(class="form-control is-invalid") }} +
+ {% for error in form.device_type.errors %} + {{ error }} + {% endfor %} +
+ {% else %} + {{ form.device_type(class="form-select")}} + {% endif %} +
+
+
+
+ {{ form.operational_status.label(class="col-sm-2 col-form-label") }} +
+ {% if form.operational_status.errors %} + {{ form.operational_status(class="form-control is-invalid") }} +
+ {% for error in form.operational_status.errors %} + {{ error }} + {% endfor %} +
+ {% else %} + {{ form.operational_status(class="form-select") }} + {% endif %} +
+
+
+
+
Drivers
+
+ {% if form.device_drivers_undefined.errors %} + {{ form.device_drivers_undefined(class="form-control is-invalid") }} +
+ {% for error in form.device_drivers_undefined.errors %} + {{ error }} + {% endfor %} +
+ {% else %} + {{ form.device_drivers_undefined }} {{ form.device_drivers_undefined.label(class="col-sm-3 + col-form-label") }} + {{ form.device_drivers_openconfig }} {{ form.device_drivers_openconfig.label(class="col-sm-3 + col-form-label") }} + {{ form.device_drivers_transport_api }} {{ form.device_drivers_transport_api.label(class="col-sm-3 + col-form-label") }} +
{{ form.device_drivers_p4 }} {{ form.device_drivers_p4.label(class="col-sm-3 col-form-label") }} + {{ form.device_drivers_ietf_network_topology }} {{ + form.device_drivers_ietf_network_topology.label(class="col-sm-3 + col-form-label") }} + {{ form.device_drivers_onf_tr_352 }} {{ form.device_drivers_onf_tr_352.label(class="col-sm-3 + col-form-label") }}
+ {{ form.device_drivers_xr }} {{ form.device_drivers_xr.label(class="col-sm-3 + col-form-label") }} + {% endif %} +
+
+
+ Configuration Rules
+
+ {{ form.device_config_address.label(class="col-sm-2 col-form-label") }} +
+ {% if form.device_config_address.errors %} + {{ form.device_config_address(class="form-control is-invalid", rows=5) }} +
+ {% for error in form.device_config_address.errors %} + {{ error }} + {% endfor %} +
+ {% else %} + {{ form.device_config_address(class="form-control", rows=5) }} + {% endif %} +
+
+
+ {{ form.device_config_port.label(class="col-sm-2 col-form-label") }} +
+ {% if form.device_config_port.errors %} + {{ form.device_config_port(class="form-control is-invalid", rows=5) }} +
+ {% for error in form.device_config_port.errors %} + {{ error }} + {% endfor %} +
+ {% else %} + {{ form.device_config_port(class="form-control", rows=5) }} + {% endif %} +
+
+
+ {{ form.device_config_settings.label(class="col-sm-2 col-form-label") }} +
+ {% if form.device_config_settings.errors %} + {{ form.device_config_settings(class="form-control is-invalid", rows=5) }} +
+ {% for error in form.device_config_settings.errors %} + {{ error }} + {% endfor %} +
+ {% else %} + {{ form.device_config_settings(class="form-control", rows=5) }} + {% endif %} +
+
+
+
+ + +
+
+
+{% endblock %} \ No newline at end of file diff --git a/src/webui/service/templates/pcep/addPcep.html b/src/webui/service/templates/pcep/addPcep.html new file mode 100644 index 0000000000000000000000000000000000000000..1a04c9af56baad623dccf6464be424a51e37f1d1 --- /dev/null +++ b/src/webui/service/templates/pcep/addPcep.html @@ -0,0 +1,49 @@ + + + {% extends 'base.html' %} + {% block content %} +

Pcep

+ +
Configure PCE IP
+
+
+ {{ form.hidden_tag() }} +
+
+ {{ form.pce_address.label(class="col-sm-2 col-form-label") }} +
+ {% if form.pce_address.errors %} + {{ form.pce_address(class="form-control is-invalid") }} +
+ {% for error in form.pce_address.errors %} + {{ error }} + {% endfor %} +
+ {% else %} + {{ form.pce_address(class="form-control") }} + {% endif %} +
+
+
+ +
+
+ {% endblock %} + \ No newline at end of file diff --git a/src/webui/service/templates/pcep/home.html b/src/webui/service/templates/pcep/home.html new file mode 100644 index 0000000000000000000000000000000000000000..7fde0c7d9e9835ff543b788f0c7793808b520655 --- /dev/null +++ b/src/webui/service/templates/pcep/home.html @@ -0,0 +1,55 @@ + +{% extends 'base.html' %} + +{% block content %} + +

Path Computation Element Protocol (PCEP)

+ + + + +
+ + + +{% endblock %} diff --git a/src/webui/service/templates/pcep/lspdb.html b/src/webui/service/templates/pcep/lspdb.html new file mode 100644 index 0000000000000000000000000000000000000000..1fcf31bcd2fbeb4ec4427d0bba6b5afccb448874 --- /dev/null +++ b/src/webui/service/templates/pcep/lspdb.html @@ -0,0 +1,94 @@ + +{% extends 'base.html' %} + +{% block content %} +

Label Switched Paths Database (LSPDB)

+
+ + {% if lspdb %} + + + + + + + + + + + + {% for lsp in lspdb %} + + + + + + + + {% endfor %} + +
LSP UUIDSRPLSPPathAssociation List
{{ lsp.lsp_uuid }}{{ lsp.srp }} +
+ {{ lsp.lsp.split('[')[1].split(']')[0].split(',')[0] }} +
+ {% set before_lsp_identifiers = lsp.lsp[5:].split('lspIdentifiers_tlv=')[0] %}{# Remove "LSP [" from the beginning #} + {% for subfield in before_lsp_identifiers.split(',') %} +
{{ subfield }}
+ {% endfor %} + {% set lsp_content = lsp.lsp[:-1].split('IPv4LSPIdentifiersTLV ')[1] %} +
lspIdentifiers_tlv=IPv4LSPIdentifiersTLV:
+ {% for subfield in lsp_content.split(',') %} +
{{ subfield }}
+ {% endfor %} +
+
+
+
+ {{ lsp.path.split('[')[1].split(']')[0].split(',')[0] }} +
+ {% set path_content = lsp.path[6:-1] %} {# Remove "Path [" from the beginning and "]" from the end #} + {% for subfield in path_content.split(',') %} +
{{ subfield }}
+ {% endfor %} +
+
+
+
+ Association List +
{{ lsp.associationlist }}
+
+
+ {% else %} +

No LSP data available.

+ {% endif %} +{% endblock %} + \ No newline at end of file diff --git a/src/webui/service/templates/pcep/managePCEP.html b/src/webui/service/templates/pcep/managePCEP.html new file mode 100644 index 0000000000000000000000000000000000000000..a62113031c92050da529a4c0b884d7105c6c4041 --- /dev/null +++ b/src/webui/service/templates/pcep/managePCEP.html @@ -0,0 +1,62 @@ + + +{% extends 'base.html' %} +{% block content %} +

Path Computation Element (PCE)

+
+
+

Active Sessions in the PCE: {{ sessions }}

+
+
+ {{ pcep_manage_form.hidden_tag() }} +
+ Input the desired command to manage the PCE +
+
+ {{ pcep_manage_form.command(class="form-control") }} +
+
+ {{ pcep_manage_form.submit(class='btn btn-primary') }} +
+
+
+
+
+
+

Available commands:

+
    +
  • + Initiate + The "Initiate" command is used to request the PCE (Path Computation Element) to compute a new path for a specific Label Switched Path (LSP). It initiates the process of establishing a new path for network traffic based on specified constraints and requirements. + Example of use "initiate lsp nombre_lsp 10.95.90.56 1.1.1.1 1.1.1.2 m1228800 na192.168.3.11-192.168.3.13 m819200 na192.168.2.13-192.168.2.12" +
  • +
  • + Update + The "Update" command is used to inform the PCE about modifications or updates to an existing LSP. It allows the Path Computation Client (PCC) to request changes to the parameters or attributes of an LSP, such as bandwidth requirements or path constraints. + Example of use "update lsp 3 m1228800 na192.168.3.11-192.168.3.13" + +
  • +
  • + Terminate + The "Terminate" command is used to request the termination or removal of an existing LSP. It signals to the PCE that the specified LSP should be torn down, freeing up network resources and terminating the path for the associated traffic. + Example of use "terminate lsp 16 nombreLSP16" +
  • +
+
+
+ +{% endblock %} \ No newline at end of file diff --git a/src/webui/service/templates/pcep/sendPath.html b/src/webui/service/templates/pcep/sendPath.html new file mode 100644 index 0000000000000000000000000000000000000000..ae4b45b97a03af44a9f8547bfa01c1369624d4a5 --- /dev/null +++ b/src/webui/service/templates/pcep/sendPath.html @@ -0,0 +1,153 @@ + +{% extends 'base.html' %} +{% block content %} +

Send Path

+
Create, delete or modify paths
+
+
+ {{ form.hidden_tag() }} +
+
+ {{ form.command.label(class="col-sm-2 col-form-label") }} +
+ {% if form.command.errors %} + {{ form.command(class="form-control is-invalid") }} +
+ {% for error in form.command.errors %} + {{ error }} + {% endfor %} +
+ {% else %} + {{ form.command(class="form-control") }} + {% endif %} +
+
+
+ +
+ +
+
+
+ + +
+ +
+
+ + {% if response %} +
+
Response
+

Success: {{ response.success }}

+

Error Message: {{ response.error_message }}

+
+ {% endif %} + + +{% endblock %} \ No newline at end of file diff --git a/src/ztp/target/generated-sources/grpc/context/ContextOuterClass.java b/src/ztp/target/generated-sources/grpc/context/ContextOuterClass.java index d85f89f6f073f375fa6dd80496de7020c4af98a7..0a7670c301cc68f5bae96890e85bba6d49bdc794 100644 --- a/src/ztp/target/generated-sources/grpc/context/ContextOuterClass.java +++ b/src/ztp/target/generated-sources/grpc/context/ContextOuterClass.java @@ -215,6 +215,14 @@ public final class ContextOuterClass { * DEVICEDRIVER_SMARTNIC = 16; */ DEVICEDRIVER_SMARTNIC(16), + /** + * DEVICEDRIVER_MORPHEUS = 17; + */ + DEVICEDRIVER_MORPHEUS(17), + /** + * DEVICEDRIVER_RYU = 18; + */ + DEVICEDRIVER_RYU(18), UNRECOGNIZED(-1); /** @@ -306,6 +314,16 @@ public final class ContextOuterClass { */ public static final int DEVICEDRIVER_SMARTNIC_VALUE = 16; + /** + * DEVICEDRIVER_MORPHEUS = 17; + */ + public static final int DEVICEDRIVER_MORPHEUS_VALUE = 17; + + /** + * DEVICEDRIVER_RYU = 18; + */ + public static final int DEVICEDRIVER_RYU_VALUE = 18; + public final int getNumber() { if (this == UNRECOGNIZED) { throw new java.lang.IllegalArgumentException("Can't get the number of an unknown enum value."); @@ -363,6 +381,10 @@ public final class ContextOuterClass { return DEVICEDRIVER_NCE; case 16: return DEVICEDRIVER_SMARTNIC; + case 17: + return DEVICEDRIVER_MORPHEUS; + case 18: + return DEVICEDRIVER_RYU; default: return null; } @@ -551,6 +573,10 @@ public final class ContextOuterClass { * LINKTYPE_VIRTUAL = 4; */ LINKTYPE_VIRTUAL(4), + /** + * LINKTYPE_MANAGEMENT = 5; + */ + LINKTYPE_MANAGEMENT(5), UNRECOGNIZED(-1); /** @@ -578,6 +604,11 @@ public final class ContextOuterClass { */ public static final int LINKTYPE_VIRTUAL_VALUE = 4; + /** + * LINKTYPE_MANAGEMENT = 5; + */ + public static final int LINKTYPE_MANAGEMENT_VALUE = 5; + public final int getNumber() { if (this == UNRECOGNIZED) { throw new java.lang.IllegalArgumentException("Can't get the number of an unknown enum value."); @@ -611,6 +642,8 @@ public final class ContextOuterClass { return LINKTYPE_RADIO; case 4: return LINKTYPE_VIRTUAL; + case 5: + return LINKTYPE_MANAGEMENT; default: return null; } @@ -698,6 +731,18 @@ public final class ContextOuterClass { * SERVICETYPE_QKD = 7; */ SERVICETYPE_QKD(7), + /** + * SERVICETYPE_L1NM = 8; + */ + SERVICETYPE_L1NM(8), + /** + * SERVICETYPE_INT = 9; + */ + SERVICETYPE_INT(9), + /** + * SERVICETYPE_ACL = 10; + */ + SERVICETYPE_ACL(10), UNRECOGNIZED(-1); /** @@ -740,6 +785,21 @@ public final class ContextOuterClass { */ public static final int SERVICETYPE_QKD_VALUE = 7; + /** + * SERVICETYPE_L1NM = 8; + */ + public static final int SERVICETYPE_L1NM_VALUE = 8; + + /** + * SERVICETYPE_INT = 9; + */ + public static final int SERVICETYPE_INT_VALUE = 9; + + /** + * SERVICETYPE_ACL = 10; + */ + public static final int SERVICETYPE_ACL_VALUE = 10; + public final int getNumber() { if (this == UNRECOGNIZED) { throw new java.lang.IllegalArgumentException("Can't get the number of an unknown enum value."); @@ -779,6 +839,12 @@ public final class ContextOuterClass { return SERVICETYPE_OPTICAL_CONNECTIVITY; case 7: return SERVICETYPE_QKD; + case 8: + return SERVICETYPE_L1NM; + case 9: + return SERVICETYPE_INT; + case 10: + return SERVICETYPE_ACL; default: return null; } @@ -17947,11 +18013,11 @@ public final class ContextOuterClass { } /** - *
-     * Defined previously to this section - Tested OK
-     *  
+ *
+     * Defined previously in this section
+     * 
* - * Protobuf type {@code context.Component} + * Protobuf type {@code context.Component} */ public static final class Component extends com.google.protobuf.GeneratedMessageV3 implements // @@protoc_insertion_point(message_implements:context.Component) ComponentOrBuilder { @@ -18418,11 +18484,11 @@ public final class ContextOuterClass { } /** - *
-         * Defined previously to this section - Tested OK
-         *  
+ *
+         * Defined previously in this section
+         * 
* - * Protobuf type {@code context.Component} + * Protobuf type {@code context.Component} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements // @@protoc_insertion_point(builder_implements:context.Component) context.ContextOuterClass.ComponentOrBuilder { @@ -23619,6 +23685,30 @@ public final class ContextOuterClass { * @return The usedCapacityGbps. */ float getUsedCapacityGbps(); + + /** + * float available_bw = 3; + * @return The availableBw. + */ + float getAvailableBw(); + + /** + * float link_delay = 5; + * @return The linkDelay. + */ + float getLinkDelay(); + + /** + * float min_max_link_delay = 6; + * @return The minMaxLinkDelay. + */ + float getMinMaxLinkDelay(); + + /** + * float delay_variation = 7; + * @return The delayVariation. + */ + float getDelayVariation(); } /** @@ -23678,6 +23768,58 @@ public final class ContextOuterClass { return usedCapacityGbps_; } + public static final int AVAILABLE_BW_FIELD_NUMBER = 3; + + private float availableBw_ = 0F; + + /** + * float available_bw = 3; + * @return The availableBw. + */ + @java.lang.Override + public float getAvailableBw() { + return availableBw_; + } + + public static final int LINK_DELAY_FIELD_NUMBER = 5; + + private float linkDelay_ = 0F; + + /** + * float link_delay = 5; + * @return The linkDelay. + */ + @java.lang.Override + public float getLinkDelay() { + return linkDelay_; + } + + public static final int MIN_MAX_LINK_DELAY_FIELD_NUMBER = 6; + + private float minMaxLinkDelay_ = 0F; + + /** + * float min_max_link_delay = 6; + * @return The minMaxLinkDelay. + */ + @java.lang.Override + public float getMinMaxLinkDelay() { + return minMaxLinkDelay_; + } + + public static final int DELAY_VARIATION_FIELD_NUMBER = 7; + + private float delayVariation_ = 0F; + + /** + * float delay_variation = 7; + * @return The delayVariation. + */ + @java.lang.Override + public float getDelayVariation() { + return delayVariation_; + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -23699,6 +23841,18 @@ public final class ContextOuterClass { if (java.lang.Float.floatToRawIntBits(usedCapacityGbps_) != 0) { output.writeFloat(2, usedCapacityGbps_); } + if (java.lang.Float.floatToRawIntBits(availableBw_) != 0) { + output.writeFloat(3, availableBw_); + } + if (java.lang.Float.floatToRawIntBits(linkDelay_) != 0) { + output.writeFloat(5, linkDelay_); + } + if (java.lang.Float.floatToRawIntBits(minMaxLinkDelay_) != 0) { + output.writeFloat(6, minMaxLinkDelay_); + } + if (java.lang.Float.floatToRawIntBits(delayVariation_) != 0) { + output.writeFloat(7, delayVariation_); + } getUnknownFields().writeTo(output); } @@ -23714,6 +23868,18 @@ public final class ContextOuterClass { if (java.lang.Float.floatToRawIntBits(usedCapacityGbps_) != 0) { size += com.google.protobuf.CodedOutputStream.computeFloatSize(2, usedCapacityGbps_); } + if (java.lang.Float.floatToRawIntBits(availableBw_) != 0) { + size += com.google.protobuf.CodedOutputStream.computeFloatSize(3, availableBw_); + } + if (java.lang.Float.floatToRawIntBits(linkDelay_) != 0) { + size += com.google.protobuf.CodedOutputStream.computeFloatSize(5, linkDelay_); + } + if (java.lang.Float.floatToRawIntBits(minMaxLinkDelay_) != 0) { + size += com.google.protobuf.CodedOutputStream.computeFloatSize(6, minMaxLinkDelay_); + } + if (java.lang.Float.floatToRawIntBits(delayVariation_) != 0) { + size += com.google.protobuf.CodedOutputStream.computeFloatSize(7, delayVariation_); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -23732,6 +23898,14 @@ public final class ContextOuterClass { return false; if (java.lang.Float.floatToIntBits(getUsedCapacityGbps()) != java.lang.Float.floatToIntBits(other.getUsedCapacityGbps())) return false; + if (java.lang.Float.floatToIntBits(getAvailableBw()) != java.lang.Float.floatToIntBits(other.getAvailableBw())) + return false; + if (java.lang.Float.floatToIntBits(getLinkDelay()) != java.lang.Float.floatToIntBits(other.getLinkDelay())) + return false; + if (java.lang.Float.floatToIntBits(getMinMaxLinkDelay()) != java.lang.Float.floatToIntBits(other.getMinMaxLinkDelay())) + return false; + if (java.lang.Float.floatToIntBits(getDelayVariation()) != java.lang.Float.floatToIntBits(other.getDelayVariation())) + return false; if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; @@ -23748,6 +23922,14 @@ public final class ContextOuterClass { hash = (53 * hash) + java.lang.Float.floatToIntBits(getTotalCapacityGbps()); hash = (37 * hash) + USED_CAPACITY_GBPS_FIELD_NUMBER; hash = (53 * hash) + java.lang.Float.floatToIntBits(getUsedCapacityGbps()); + hash = (37 * hash) + AVAILABLE_BW_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits(getAvailableBw()); + hash = (37 * hash) + LINK_DELAY_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits(getLinkDelay()); + hash = (37 * hash) + MIN_MAX_LINK_DELAY_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits(getMinMaxLinkDelay()); + hash = (37 * hash) + DELAY_VARIATION_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits(getDelayVariation()); hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -23854,6 +24036,10 @@ public final class ContextOuterClass { bitField0_ = 0; totalCapacityGbps_ = 0F; usedCapacityGbps_ = 0F; + availableBw_ = 0F; + linkDelay_ = 0F; + minMaxLinkDelay_ = 0F; + delayVariation_ = 0F; return this; } @@ -23894,6 +24080,18 @@ public final class ContextOuterClass { if (((from_bitField0_ & 0x00000002) != 0)) { result.usedCapacityGbps_ = usedCapacityGbps_; } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.availableBw_ = availableBw_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.linkDelay_ = linkDelay_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.minMaxLinkDelay_ = minMaxLinkDelay_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.delayVariation_ = delayVariation_; + } } @java.lang.Override @@ -23915,6 +24113,18 @@ public final class ContextOuterClass { if (other.getUsedCapacityGbps() != 0F) { setUsedCapacityGbps(other.getUsedCapacityGbps()); } + if (other.getAvailableBw() != 0F) { + setAvailableBw(other.getAvailableBw()); + } + if (other.getLinkDelay() != 0F) { + setLinkDelay(other.getLinkDelay()); + } + if (other.getMinMaxLinkDelay() != 0F) { + setMinMaxLinkDelay(other.getMinMaxLinkDelay()); + } + if (other.getDelayVariation() != 0F) { + setDelayVariation(other.getDelayVariation()); + } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -23952,6 +24162,34 @@ public final class ContextOuterClass { break; } // case 21 + case 29: + { + availableBw_ = input.readFloat(); + bitField0_ |= 0x00000004; + break; + } + // case 29 + case 45: + { + linkDelay_ = input.readFloat(); + bitField0_ |= 0x00000008; + break; + } + // case 45 + case 53: + { + minMaxLinkDelay_ = input.readFloat(); + bitField0_ |= 0x00000010; + break; + } + // case 53 + case 61: + { + delayVariation_ = input.readFloat(); + bitField0_ |= 0x00000020; + break; + } + // case 61 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -24043,6 +24281,142 @@ public final class ContextOuterClass { return this; } + private float availableBw_; + + /** + * float available_bw = 3; + * @return The availableBw. + */ + @java.lang.Override + public float getAvailableBw() { + return availableBw_; + } + + /** + * float available_bw = 3; + * @param value The availableBw to set. + * @return This builder for chaining. + */ + public Builder setAvailableBw(float value) { + availableBw_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * float available_bw = 3; + * @return This builder for chaining. + */ + public Builder clearAvailableBw() { + bitField0_ = (bitField0_ & ~0x00000004); + availableBw_ = 0F; + onChanged(); + return this; + } + + private float linkDelay_; + + /** + * float link_delay = 5; + * @return The linkDelay. + */ + @java.lang.Override + public float getLinkDelay() { + return linkDelay_; + } + + /** + * float link_delay = 5; + * @param value The linkDelay to set. + * @return This builder for chaining. + */ + public Builder setLinkDelay(float value) { + linkDelay_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * float link_delay = 5; + * @return This builder for chaining. + */ + public Builder clearLinkDelay() { + bitField0_ = (bitField0_ & ~0x00000008); + linkDelay_ = 0F; + onChanged(); + return this; + } + + private float minMaxLinkDelay_; + + /** + * float min_max_link_delay = 6; + * @return The minMaxLinkDelay. + */ + @java.lang.Override + public float getMinMaxLinkDelay() { + return minMaxLinkDelay_; + } + + /** + * float min_max_link_delay = 6; + * @param value The minMaxLinkDelay to set. + * @return This builder for chaining. + */ + public Builder setMinMaxLinkDelay(float value) { + minMaxLinkDelay_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * float min_max_link_delay = 6; + * @return This builder for chaining. + */ + public Builder clearMinMaxLinkDelay() { + bitField0_ = (bitField0_ & ~0x00000010); + minMaxLinkDelay_ = 0F; + onChanged(); + return this; + } + + private float delayVariation_; + + /** + * float delay_variation = 7; + * @return The delayVariation. + */ + @java.lang.Override + public float getDelayVariation() { + return delayVariation_; + } + + /** + * float delay_variation = 7; + * @param value The delayVariation to set. + * @return This builder for chaining. + */ + public Builder setDelayVariation(float value) { + delayVariation_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * float delay_variation = 7; + * @return This builder for chaining. + */ + public Builder clearDelayVariation() { + bitField0_ = (bitField0_ & ~0x00000020); + delayVariation_ = 0F; + onChanged(); + return this; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); @@ -81140,8 +81514,8 @@ public final class ContextOuterClass { private static com.google.protobuf.Descriptors.FileDescriptor descriptor; static { - java.lang.String[] descriptorData = { "\n\rcontext.proto\022\007context\032\031google/protobu" + "f/any.proto\032\tacl.proto\032\026kpi_sample_types" + ".proto\"\007\n\005Empty\"\024\n\004Uuid\022\014\n\004uuid\030\001 \001(\t\"\036\n" + "\tTimestamp\022\021\n\ttimestamp\030\001 \001(\001\"Z\n\005Event\022%" + "\n\ttimestamp\030\001 \001(\0132\022.context.Timestamp\022*\n" + "\nevent_type\030\002 \001(\0162\026.context.EventTypeEnu" + "m\"0\n\tContextId\022#\n\014context_uuid\030\001 \001(\0132\r.c" + "ontext.Uuid\"\351\001\n\007Context\022&\n\ncontext_id\030\001 " + "\001(\0132\022.context.ContextId\022\014\n\004name\030\002 \001(\t\022)\n" + "\014topology_ids\030\003 \003(\0132\023.context.TopologyId" + "\022\'\n\013service_ids\030\004 \003(\0132\022.context.ServiceI" + "d\022#\n\tslice_ids\030\005 \003(\0132\020.context.SliceId\022/" + "\n\ncontroller\030\006 \001(\0132\033.context.TeraFlowCon" + "troller\"8\n\rContextIdList\022\'\n\013context_ids\030" + "\001 \003(\0132\022.context.ContextId\"1\n\013ContextList" + "\022\"\n\010contexts\030\001 \003(\0132\020.context.Context\"U\n\014" + "ContextEvent\022\035\n\005event\030\001 \001(\0132\016.context.Ev" + "ent\022&\n\ncontext_id\030\002 \001(\0132\022.context.Contex" + "tId\"Z\n\nTopologyId\022&\n\ncontext_id\030\001 \001(\0132\022." + "context.ContextId\022$\n\rtopology_uuid\030\002 \001(\013" + "2\r.context.Uuid\"\267\001\n\010Topology\022(\n\013topology" + "_id\030\001 \001(\0132\023.context.TopologyId\022\014\n\004name\030\002" + " \001(\t\022%\n\ndevice_ids\030\003 \003(\0132\021.context.Devic" + "eId\022!\n\010link_ids\030\004 \003(\0132\017.context.LinkId\022)" + "\n\020optical_link_ids\030\005 \003(\0132\017.context.LinkI" + "d\"\266\001\n\017TopologyDetails\022(\n\013topology_id\030\001 \001" + "(\0132\023.context.TopologyId\022\014\n\004name\030\002 \001(\t\022 \n" + "\007devices\030\003 \003(\0132\017.context.Device\022\034\n\005links" + "\030\004 \003(\0132\r.context.Link\022+\n\roptical_links\030\005" + " \003(\0132\024.context.OpticalLink\";\n\016TopologyId" + "List\022)\n\014topology_ids\030\001 \003(\0132\023.context.Top" + "ologyId\"5\n\014TopologyList\022%\n\ntopologies\030\001 " + "\003(\0132\021.context.Topology\"X\n\rTopologyEvent\022" + "\035\n\005event\030\001 \001(\0132\016.context.Event\022(\n\013topolo" + "gy_id\030\002 \001(\0132\023.context.TopologyId\".\n\010Devi" + "ceId\022\"\n\013device_uuid\030\001 \001(\0132\r.context.Uuid" + "\"\372\002\n\006Device\022$\n\tdevice_id\030\001 \001(\0132\021.context" + ".DeviceId\022\014\n\004name\030\002 \001(\t\022\023\n\013device_type\030\003" + " \001(\t\022,\n\rdevice_config\030\004 \001(\0132\025.context.De" + "viceConfig\022G\n\031device_operational_status\030" + "\005 \001(\0162$.context.DeviceOperationalStatusE" + "num\0221\n\016device_drivers\030\006 \003(\0162\031.context.De" + "viceDriverEnum\022+\n\020device_endpoints\030\007 \003(\013" + "2\021.context.EndPoint\022&\n\ncomponents\030\010 \003(\0132" + "\022.context.Component\022(\n\rcontroller_id\030\t \001" + "(\0132\021.context.DeviceId\"\311\001\n\tComponent\022%\n\016c" + "omponent_uuid\030\001 \001(\0132\r.context.Uuid\022\014\n\004na" + "me\030\002 \001(\t\022\014\n\004type\030\003 \001(\t\0226\n\nattributes\030\004 \003" + "(\0132\".context.Component.AttributesEntry\022\016" + "\n\006parent\030\005 \001(\t\0321\n\017AttributesEntry\022\013\n\003key" + "\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"9\n\014DeviceConfi" + "g\022)\n\014config_rules\030\001 \003(\0132\023.context.Config" + "Rule\"5\n\014DeviceIdList\022%\n\ndevice_ids\030\001 \003(\013" + "2\021.context.DeviceId\".\n\nDeviceList\022 \n\007dev" + "ices\030\001 \003(\0132\017.context.Device\"\216\001\n\014DeviceFi" + "lter\022)\n\ndevice_ids\030\001 \001(\0132\025.context.Devic" + "eIdList\022\031\n\021include_endpoints\030\002 \001(\010\022\034\n\024in" + "clude_config_rules\030\003 \001(\010\022\032\n\022include_comp" + "onents\030\004 \001(\010\"\200\001\n\013DeviceEvent\022\035\n\005event\030\001 " + "\001(\0132\016.context.Event\022$\n\tdevice_id\030\002 \001(\0132\021" + ".context.DeviceId\022,\n\rdevice_config\030\003 \001(\013" + "2\025.context.DeviceConfig\"*\n\006LinkId\022 \n\tlin" + "k_uuid\030\001 \001(\0132\r.context.Uuid\"I\n\016LinkAttri" + "butes\022\033\n\023total_capacity_gbps\030\001 \001(\002\022\032\n\022us" + "ed_capacity_gbps\030\002 \001(\002\"\275\001\n\004Link\022 \n\007link_" + "id\030\001 \001(\0132\017.context.LinkId\022\014\n\004name\030\002 \001(\t\022" + "(\n\tlink_type\030\003 \001(\0162\025.context.LinkTypeEnu" + "m\022.\n\021link_endpoint_ids\030\004 \003(\0132\023.context.E" + "ndPointId\022+\n\nattributes\030\005 \001(\0132\027.context." + "LinkAttributes\"/\n\nLinkIdList\022!\n\010link_ids" + "\030\001 \003(\0132\017.context.LinkId\"(\n\010LinkList\022\034\n\005l" + "inks\030\001 \003(\0132\r.context.Link\"L\n\tLinkEvent\022\035" + "\n\005event\030\001 \001(\0132\016.context.Event\022 \n\007link_id" + "\030\002 \001(\0132\017.context.LinkId\"X\n\tServiceId\022&\n\n" + "context_id\030\001 \001(\0132\022.context.ContextId\022#\n\014" + "service_uuid\030\002 \001(\0132\r.context.Uuid\"\333\002\n\007Se" + "rvice\022&\n\nservice_id\030\001 \001(\0132\022.context.Serv" + "iceId\022\014\n\004name\030\002 \001(\t\022.\n\014service_type\030\003 \001(" + "\0162\030.context.ServiceTypeEnum\0221\n\024service_e" + "ndpoint_ids\030\004 \003(\0132\023.context.EndPointId\0220" + "\n\023service_constraints\030\005 \003(\0132\023.context.Co" + "nstraint\022.\n\016service_status\030\006 \001(\0132\026.conte" + "xt.ServiceStatus\022.\n\016service_config\030\007 \001(\013" + "2\026.context.ServiceConfig\022%\n\ttimestamp\030\010 " + "\001(\0132\022.context.Timestamp\"C\n\rServiceStatus" + "\0222\n\016service_status\030\001 \001(\0162\032.context.Servi" + "ceStatusEnum\":\n\rServiceConfig\022)\n\014config_" + "rules\030\001 \003(\0132\023.context.ConfigRule\"8\n\rServ" + "iceIdList\022\'\n\013service_ids\030\001 \003(\0132\022.context" + ".ServiceId\"1\n\013ServiceList\022\"\n\010services\030\001 " + "\003(\0132\020.context.Service\"\225\001\n\rServiceFilter\022" + "+\n\013service_ids\030\001 \001(\0132\026.context.ServiceId" + "List\022\034\n\024include_endpoint_ids\030\002 \001(\010\022\033\n\023in" + "clude_constraints\030\003 \001(\010\022\034\n\024include_confi" + "g_rules\030\004 \001(\010\"U\n\014ServiceEvent\022\035\n\005event\030\001" + " \001(\0132\016.context.Event\022&\n\nservice_id\030\002 \001(\013" + "2\022.context.ServiceId\"T\n\007SliceId\022&\n\nconte" + "xt_id\030\001 \001(\0132\022.context.ContextId\022!\n\nslice" + "_uuid\030\002 \001(\0132\r.context.Uuid\"\240\003\n\005Slice\022\"\n\010" + "slice_id\030\001 \001(\0132\020.context.SliceId\022\014\n\004name" + "\030\002 \001(\t\022/\n\022slice_endpoint_ids\030\003 \003(\0132\023.con" + "text.EndPointId\022.\n\021slice_constraints\030\004 \003" + "(\0132\023.context.Constraint\022-\n\021slice_service" + "_ids\030\005 \003(\0132\022.context.ServiceId\022,\n\022slice_" + "subslice_ids\030\006 \003(\0132\020.context.SliceId\022*\n\014" + "slice_status\030\007 \001(\0132\024.context.SliceStatus" + "\022*\n\014slice_config\030\010 \001(\0132\024.context.SliceCo" + "nfig\022(\n\013slice_owner\030\t \001(\0132\023.context.Slic" + "eOwner\022%\n\ttimestamp\030\n \001(\0132\022.context.Time" + "stamp\"E\n\nSliceOwner\022!\n\nowner_uuid\030\001 \001(\0132" + "\r.context.Uuid\022\024\n\014owner_string\030\002 \001(\t\"=\n\013" + "SliceStatus\022.\n\014slice_status\030\001 \001(\0162\030.cont" + "ext.SliceStatusEnum\"8\n\013SliceConfig\022)\n\014co" + "nfig_rules\030\001 \003(\0132\023.context.ConfigRule\"2\n" + "\013SliceIdList\022#\n\tslice_ids\030\001 \003(\0132\020.contex" + "t.SliceId\"+\n\tSliceList\022\036\n\006slices\030\001 \003(\0132\016" + ".context.Slice\"\312\001\n\013SliceFilter\022\'\n\tslice_" + "ids\030\001 \001(\0132\024.context.SliceIdList\022\034\n\024inclu" + "de_endpoint_ids\030\002 \001(\010\022\033\n\023include_constra" + "ints\030\003 \001(\010\022\033\n\023include_service_ids\030\004 \001(\010\022" + "\034\n\024include_subslice_ids\030\005 \001(\010\022\034\n\024include" + "_config_rules\030\006 \001(\010\"O\n\nSliceEvent\022\035\n\005eve" + "nt\030\001 \001(\0132\016.context.Event\022\"\n\010slice_id\030\002 \001" + "(\0132\020.context.SliceId\"6\n\014ConnectionId\022&\n\017" + "connection_uuid\030\001 \001(\0132\r.context.Uuid\"2\n\025" + "ConnectionSettings_L0\022\031\n\021lsp_symbolic_na" + "me\030\001 \001(\t\"\236\001\n\025ConnectionSettings_L2\022\027\n\017sr" + "c_mac_address\030\001 \001(\t\022\027\n\017dst_mac_address\030\002" + " \001(\t\022\022\n\nether_type\030\003 \001(\r\022\017\n\007vlan_id\030\004 \001(" + "\r\022\022\n\nmpls_label\030\005 \001(\r\022\032\n\022mpls_traffic_cl" + "ass\030\006 \001(\r\"t\n\025ConnectionSettings_L3\022\026\n\016sr" + "c_ip_address\030\001 \001(\t\022\026\n\016dst_ip_address\030\002 \001" + "(\t\022\014\n\004dscp\030\003 \001(\r\022\020\n\010protocol\030\004 \001(\r\022\013\n\003tt" + "l\030\005 \001(\r\"[\n\025ConnectionSettings_L4\022\020\n\010src_" + "port\030\001 \001(\r\022\020\n\010dst_port\030\002 \001(\r\022\021\n\ttcp_flag" + "s\030\003 \001(\r\022\013\n\003ttl\030\004 \001(\r\"\304\001\n\022ConnectionSetti" + "ngs\022*\n\002l0\030\001 \001(\0132\036.context.ConnectionSett" + "ings_L0\022*\n\002l2\030\002 \001(\0132\036.context.Connection" + "Settings_L2\022*\n\002l3\030\003 \001(\0132\036.context.Connec" + "tionSettings_L3\022*\n\002l4\030\004 \001(\0132\036.context.Co" + "nnectionSettings_L4\"\363\001\n\nConnection\022,\n\rco" + "nnection_id\030\001 \001(\0132\025.context.ConnectionId" + "\022&\n\nservice_id\030\002 \001(\0132\022.context.ServiceId" + "\0223\n\026path_hops_endpoint_ids\030\003 \003(\0132\023.conte" + "xt.EndPointId\022+\n\017sub_service_ids\030\004 \003(\0132\022" + ".context.ServiceId\022-\n\010settings\030\005 \001(\0132\033.c" + "ontext.ConnectionSettings\"A\n\020ConnectionI" + "dList\022-\n\016connection_ids\030\001 \003(\0132\025.context." + "ConnectionId\":\n\016ConnectionList\022(\n\013connec" + "tions\030\001 \003(\0132\023.context.Connection\"^\n\017Conn" + "ectionEvent\022\035\n\005event\030\001 \001(\0132\016.context.Eve" + "nt\022,\n\rconnection_id\030\002 \001(\0132\025.context.Conn" + "ectionId\"\202\001\n\nEndPointId\022(\n\013topology_id\030\001" + " \001(\0132\023.context.TopologyId\022$\n\tdevice_id\030\002" + " \001(\0132\021.context.DeviceId\022$\n\rendpoint_uuid" + "\030\003 \001(\0132\r.context.Uuid\"\310\002\n\010EndPoint\022(\n\013en" + "dpoint_id\030\001 \001(\0132\023.context.EndPointId\022\014\n\004" + "name\030\002 \001(\t\022\025\n\rendpoint_type\030\003 \001(\t\0229\n\020kpi" + "_sample_types\030\004 \003(\0162\037.kpi_sample_types.K" + "piSampleType\022,\n\021endpoint_location\030\005 \001(\0132" + "\021.context.Location\0229\n\014capabilities\030\006 \003(\013" + "2#.context.EndPoint.CapabilitiesEntry\032I\n" + "\021CapabilitiesEntry\022\013\n\003key\030\001 \001(\t\022#\n\005value" + "\030\002 \001(\0132\024.google.protobuf.Any:\0028\001\"{\n\014EndP" + "ointName\022(\n\013endpoint_id\030\001 \001(\0132\023.context." + "EndPointId\022\023\n\013device_name\030\002 \001(\t\022\025\n\rendpo" + "int_name\030\003 \001(\t\022\025\n\rendpoint_type\030\004 \001(\t\";\n" + "\016EndPointIdList\022)\n\014endpoint_ids\030\001 \003(\0132\023." + "context.EndPointId\"A\n\020EndPointNameList\022-" + "\n\016endpoint_names\030\001 \003(\0132\025.context.EndPoin" + "tName\"A\n\021ConfigRule_Custom\022\024\n\014resource_k" + "ey\030\001 \001(\t\022\026\n\016resource_value\030\002 \001(\t\"]\n\016Conf" + "igRule_ACL\022(\n\013endpoint_id\030\001 \001(\0132\023.contex" + "t.EndPointId\022!\n\010rule_set\030\002 \001(\0132\017.acl.Acl" + "RuleSet\"\234\001\n\nConfigRule\022)\n\006action\030\001 \001(\0162\031" + ".context.ConfigActionEnum\022,\n\006custom\030\002 \001(" + "\0132\032.context.ConfigRule_CustomH\000\022&\n\003acl\030\003" + " \001(\0132\027.context.ConfigRule_ACLH\000B\r\n\013confi" + "g_rule\"F\n\021Constraint_Custom\022\027\n\017constrain" + "t_type\030\001 \001(\t\022\030\n\020constraint_value\030\002 \001(\t\"E" + "\n\023Constraint_Schedule\022\027\n\017start_timestamp" + "\030\001 \001(\001\022\025\n\rduration_days\030\002 \001(\002\"3\n\014GPS_Pos" + "ition\022\020\n\010latitude\030\001 \001(\002\022\021\n\tlongitude\030\002 \001" + "(\002\"\204\001\n\010Location\022\020\n\006region\030\001 \001(\tH\000\022-\n\014gps" + "_position\030\002 \001(\0132\025.context.GPS_PositionH\000" + "\022\023\n\tinterface\030\003 \001(\tH\000\022\026\n\014circuit_pack\030\004 " + "\001(\tH\000B\n\n\010location\"l\n\033Constraint_EndPoint" + "Location\022(\n\013endpoint_id\030\001 \001(\0132\023.context." + "EndPointId\022#\n\010location\030\002 \001(\0132\021.context.L" + "ocation\"Y\n\033Constraint_EndPointPriority\022(" + "\n\013endpoint_id\030\001 \001(\0132\023.context.EndPointId" + "\022\020\n\010priority\030\002 \001(\r\"0\n\026Constraint_SLA_Lat" + "ency\022\026\n\016e2e_latency_ms\030\001 \001(\002\"0\n\027Constrai" + "nt_SLA_Capacity\022\025\n\rcapacity_gbps\030\001 \001(\002\"c" + "\n\033Constraint_SLA_Availability\022\032\n\022num_dis" + "joint_paths\030\001 \001(\r\022\022\n\nall_active\030\002 \001(\010\022\024\n" + "\014availability\030\003 \001(\002\"V\n\036Constraint_SLA_Is" + "olation_level\0224\n\017isolation_level\030\001 \003(\0162\033" + ".context.IsolationLevelEnum\"\242\001\n\025Constrai" + "nt_Exclusions\022\024\n\014is_permanent\030\001 \001(\010\022%\n\nd" + "evice_ids\030\002 \003(\0132\021.context.DeviceId\022)\n\014en" + "dpoint_ids\030\003 \003(\0132\023.context.EndPointId\022!\n" + "\010link_ids\030\004 \003(\0132\017.context.LinkId\"5\n\014QoSP" + "rofileId\022%\n\016qos_profile_id\030\001 \001(\0132\r.conte" + "xt.Uuid\"`\n\025Constraint_QoSProfile\022-\n\016qos_" + "profile_id\030\001 \001(\0132\025.context.QoSProfileId\022" + "\030\n\020qos_profile_name\030\002 \001(\t\"\222\005\n\nConstraint" + "\022-\n\006action\030\001 \001(\0162\035.context.ConstraintAct" + "ionEnum\022,\n\006custom\030\002 \001(\0132\032.context.Constr" + "aint_CustomH\000\0220\n\010schedule\030\003 \001(\0132\034.contex" + "t.Constraint_ScheduleH\000\022A\n\021endpoint_loca" + "tion\030\004 \001(\0132$.context.Constraint_EndPoint" + "LocationH\000\022A\n\021endpoint_priority\030\005 \001(\0132$." + "context.Constraint_EndPointPriorityH\000\0228\n" + "\014sla_capacity\030\006 \001(\0132 .context.Constraint" + "_SLA_CapacityH\000\0226\n\013sla_latency\030\007 \001(\0132\037.c" + "ontext.Constraint_SLA_LatencyH\000\022@\n\020sla_a" + "vailability\030\010 \001(\0132$.context.Constraint_S" + "LA_AvailabilityH\000\022@\n\rsla_isolation\030\t \001(\013" + "2\'.context.Constraint_SLA_Isolation_leve" + "lH\000\0224\n\nexclusions\030\n \001(\0132\036.context.Constr" + "aint_ExclusionsH\000\0225\n\013qos_profile\030\013 \001(\0132\036" + ".context.Constraint_QoSProfileH\000B\014\n\ncons" + "traint\"^\n\022TeraFlowController\022&\n\ncontext_" + "id\030\001 \001(\0132\022.context.ContextId\022\022\n\nip_addre" + "ss\030\002 \001(\t\022\014\n\004port\030\003 \001(\r\"U\n\024Authentication" + "Result\022&\n\ncontext_id\030\001 \001(\0132\022.context.Con" + "textId\022\025\n\rauthenticated\030\002 \001(\010\"-\n\017Optical" + "ConfigId\022\032\n\022opticalconfig_uuid\030\001 \001(\t\"y\n\r" + "OpticalConfig\0222\n\020opticalconfig_id\030\001 \001(\0132" + "\030.context.OpticalConfigId\022\016\n\006config\030\002 \001(" + "\t\022$\n\tdevice_id\030\003 \001(\0132\021.context.DeviceId\"" + "C\n\021OpticalConfigList\022.\n\016opticalconfigs\030\001" + " \003(\0132\026.context.OpticalConfig\"g\n\022OpticalC" + "onfigEvent\022\035\n\005event\030\001 \001(\0132\016.context.Even" + "t\0222\n\020opticalconfig_id\030\002 \001(\0132\030.context.Op" + "ticalConfigId\"_\n\021OpticalEndPointId\022$\n\tde" + "vice_id\030\002 \001(\0132\021.context.DeviceId\022$\n\rendp" + "oint_uuid\030\003 \001(\0132\r.context.Uuid\">\n\017Optica" + "lLinkList\022+\n\roptical_links\030\001 \003(\0132\024.conte" + "xt.OpticalLink\"\304\003\n\022OpticalLinkDetails\022\016\n" + "\006length\030\001 \001(\002\022\020\n\010src_port\030\002 \001(\t\022\020\n\010dst_p" + "ort\030\003 \001(\t\022\027\n\017local_peer_port\030\004 \001(\t\022\030\n\020re" + "mote_peer_port\030\005 \001(\t\022\014\n\004used\030\006 \001(\010\0228\n\007c_" + "slots\030\007 \003(\0132\'.context.OpticalLinkDetails" + ".CSlotsEntry\0228\n\007l_slots\030\010 \003(\0132\'.context." + "OpticalLinkDetails.LSlotsEntry\0228\n\007s_slot" + "s\030\t \003(\0132\'.context.OpticalLinkDetails.SSl" + "otsEntry\032-\n\013CSlotsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005" + "value\030\002 \001(\005:\0028\001\032-\n\013LSlotsEntry\022\013\n\003key\030\001 " + "\001(\t\022\r\n\005value\030\002 \001(\005:\0028\001\032-\n\013SSlotsEntry\022\013\n" + "\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\005:\0028\001\"\243\001\n\013Optica" + "lLink\022\014\n\004name\030\001 \001(\t\0224\n\017optical_details\030\002" + " \001(\0132\033.context.OpticalLinkDetails\022 \n\007lin" + "k_id\030\003 \001(\0132\017.context.LinkId\022.\n\021link_endp" + "oint_ids\030\004 \003(\0132\023.context.EndPointId\"r\n\021S" + "erviceConfigRule\022&\n\nservice_id\030\001 \001(\0132\022.c" + "ontext.ServiceId\0225\n\021configrule_custom\030\002 " + "\001(\0132\032.context.ConfigRule_Custom*j\n\rEvent" + "TypeEnum\022\027\n\023EVENTTYPE_UNDEFINED\020\000\022\024\n\020EVE" + "NTTYPE_CREATE\020\001\022\024\n\020EVENTTYPE_UPDATE\020\002\022\024\n" + "\020EVENTTYPE_REMOVE\020\003*\351\003\n\020DeviceDriverEnum" + "\022\032\n\026DEVICEDRIVER_UNDEFINED\020\000\022\033\n\027DEVICEDR" + "IVER_OPENCONFIG\020\001\022\036\n\032DEVICEDRIVER_TRANSP" + "ORT_API\020\002\022\023\n\017DEVICEDRIVER_P4\020\003\022&\n\"DEVICE" + "DRIVER_IETF_NETWORK_TOPOLOGY\020\004\022\033\n\027DEVICE" + "DRIVER_ONF_TR_532\020\005\022\023\n\017DEVICEDRIVER_XR\020\006" + "\022\033\n\027DEVICEDRIVER_IETF_L2VPN\020\007\022 \n\034DEVICED" + "RIVER_GNMI_OPENCONFIG\020\010\022\034\n\030DEVICEDRIVER_" + "OPTICAL_TFS\020\t\022\032\n\026DEVICEDRIVER_IETF_ACTN\020" + "\n\022\023\n\017DEVICEDRIVER_OC\020\013\022\024\n\020DEVICEDRIVER_Q" + "KD\020\014\022\033\n\027DEVICEDRIVER_IETF_L3VPN\020\r\022\033\n\027DEV" + "ICEDRIVER_IETF_SLICE\020\016\022\024\n\020DEVICEDRIVER_N" + "CE\020\017\022\031\n\025DEVICEDRIVER_SMARTNIC\020\020*\217\001\n\033Devi" + "ceOperationalStatusEnum\022%\n!DEVICEOPERATI" + "ONALSTATUS_UNDEFINED\020\000\022$\n DEVICEOPERATIO" + "NALSTATUS_DISABLED\020\001\022#\n\037DEVICEOPERATIONA" + "LSTATUS_ENABLED\020\002*w\n\014LinkTypeEnum\022\024\n\020LIN" + "KTYPE_UNKNOWN\020\000\022\023\n\017LINKTYPE_COPPER\020\001\022\022\n\016" + "LINKTYPE_FIBER\020\002\022\022\n\016LINKTYPE_RADIO\020\003\022\024\n\020" + "LINKTYPE_VIRTUAL\020\004*\345\001\n\017ServiceTypeEnum\022\027" + "\n\023SERVICETYPE_UNKNOWN\020\000\022\024\n\020SERVICETYPE_L" + "3NM\020\001\022\024\n\020SERVICETYPE_L2NM\020\002\022)\n%SERVICETY" + "PE_TAPI_CONNECTIVITY_SERVICE\020\003\022\022\n\016SERVIC" + "ETYPE_TE\020\004\022\023\n\017SERVICETYPE_E2E\020\005\022$\n SERVI" + "CETYPE_OPTICAL_CONNECTIVITY\020\006\022\023\n\017SERVICE" + "TYPE_QKD\020\007*\304\001\n\021ServiceStatusEnum\022\033\n\027SERV" + "ICESTATUS_UNDEFINED\020\000\022\031\n\025SERVICESTATUS_P" + "LANNED\020\001\022\030\n\024SERVICESTATUS_ACTIVE\020\002\022\032\n\026SE" + "RVICESTATUS_UPDATING\020\003\022!\n\035SERVICESTATUS_" + "PENDING_REMOVAL\020\004\022\036\n\032SERVICESTATUS_SLA_V" + "IOLATED\020\005*\251\001\n\017SliceStatusEnum\022\031\n\025SLICEST" + "ATUS_UNDEFINED\020\000\022\027\n\023SLICESTATUS_PLANNED\020" + "\001\022\024\n\020SLICESTATUS_INIT\020\002\022\026\n\022SLICESTATUS_A" + "CTIVE\020\003\022\026\n\022SLICESTATUS_DEINIT\020\004\022\034\n\030SLICE" + "STATUS_SLA_VIOLATED\020\005*]\n\020ConfigActionEnu" + "m\022\032\n\026CONFIGACTION_UNDEFINED\020\000\022\024\n\020CONFIGA" + "CTION_SET\020\001\022\027\n\023CONFIGACTION_DELETE\020\002*m\n\024" + "ConstraintActionEnum\022\036\n\032CONSTRAINTACTION" + "_UNDEFINED\020\000\022\030\n\024CONSTRAINTACTION_SET\020\001\022\033" + "\n\027CONSTRAINTACTION_DELETE\020\002*\203\002\n\022Isolatio" + "nLevelEnum\022\020\n\014NO_ISOLATION\020\000\022\026\n\022PHYSICAL" + "_ISOLATION\020\001\022\025\n\021LOGICAL_ISOLATION\020\002\022\025\n\021P" + "ROCESS_ISOLATION\020\003\022\035\n\031PHYSICAL_MEMORY_IS" + "OLATION\020\004\022\036\n\032PHYSICAL_NETWORK_ISOLATION\020" + "\005\022\036\n\032VIRTUAL_RESOURCE_ISOLATION\020\006\022\037\n\033NET" + "WORK_FUNCTIONS_ISOLATION\020\007\022\025\n\021SERVICE_IS" + "OLATION\020\0102\202\034\n\016ContextService\022:\n\016ListCont" + "extIds\022\016.context.Empty\032\026.context.Context" + "IdList\"\000\0226\n\014ListContexts\022\016.context.Empty" + "\032\024.context.ContextList\"\000\0224\n\nGetContext\022\022" + ".context.ContextId\032\020.context.Context\"\000\0224" + "\n\nSetContext\022\020.context.Context\032\022.context" + ".ContextId\"\000\0225\n\rRemoveContext\022\022.context." + "ContextId\032\016.context.Empty\"\000\022=\n\020GetContex" + "tEvents\022\016.context.Empty\032\025.context.Contex" + "tEvent\"\0000\001\022@\n\017ListTopologyIds\022\022.context." + "ContextId\032\027.context.TopologyIdList\"\000\022=\n\016" + "ListTopologies\022\022.context.ContextId\032\025.con" + "text.TopologyList\"\000\0227\n\013GetTopology\022\023.con" + "text.TopologyId\032\021.context.Topology\"\000\022E\n\022" + "GetTopologyDetails\022\023.context.TopologyId\032" + "\030.context.TopologyDetails\"\000\0227\n\013SetTopolo" + "gy\022\021.context.Topology\032\023.context.Topology" + "Id\"\000\0227\n\016RemoveTopology\022\023.context.Topolog" + "yId\032\016.context.Empty\"\000\022?\n\021GetTopologyEven" + "ts\022\016.context.Empty\032\026.context.TopologyEve" + "nt\"\0000\001\0228\n\rListDeviceIds\022\016.context.Empty\032" + "\025.context.DeviceIdList\"\000\0224\n\013ListDevices\022" + "\016.context.Empty\032\023.context.DeviceList\"\000\0221" + "\n\tGetDevice\022\021.context.DeviceId\032\017.context" + ".Device\"\000\0221\n\tSetDevice\022\017.context.Device\032" + "\021.context.DeviceId\"\000\0223\n\014RemoveDevice\022\021.c" + "ontext.DeviceId\032\016.context.Empty\"\000\022;\n\017Get" + "DeviceEvents\022\016.context.Empty\032\024.context.D" + "eviceEvent\"\0000\001\022<\n\014SelectDevice\022\025.context" + ".DeviceFilter\032\023.context.DeviceList\"\000\022I\n\021" + "ListEndPointNames\022\027.context.EndPointIdLi" + "st\032\031.context.EndPointNameList\"\000\0224\n\013ListL" + "inkIds\022\016.context.Empty\032\023.context.LinkIdL" + "ist\"\000\0220\n\tListLinks\022\016.context.Empty\032\021.con" + "text.LinkList\"\000\022+\n\007GetLink\022\017.context.Lin" + "kId\032\r.context.Link\"\000\022+\n\007SetLink\022\r.contex" + "t.Link\032\017.context.LinkId\"\000\022/\n\nRemoveLink\022" + "\017.context.LinkId\032\016.context.Empty\"\000\0227\n\rGe" + "tLinkEvents\022\016.context.Empty\032\022.context.Li" + "nkEvent\"\0000\001\022>\n\016ListServiceIds\022\022.context." + "ContextId\032\026.context.ServiceIdList\"\000\022:\n\014L" + "istServices\022\022.context.ContextId\032\024.contex" + "t.ServiceList\"\000\0224\n\nGetService\022\022.context." + "ServiceId\032\020.context.Service\"\000\0224\n\nSetServ" + "ice\022\020.context.Service\032\022.context.ServiceI" + "d\"\000\0226\n\014UnsetService\022\020.context.Service\032\022." + "context.ServiceId\"\000\0225\n\rRemoveService\022\022.c" + "ontext.ServiceId\032\016.context.Empty\"\000\022=\n\020Ge" + "tServiceEvents\022\016.context.Empty\032\025.context" + ".ServiceEvent\"\0000\001\022?\n\rSelectService\022\026.con" + "text.ServiceFilter\032\024.context.ServiceList" + "\"\000\022:\n\014ListSliceIds\022\022.context.ContextId\032\024" + ".context.SliceIdList\"\000\0226\n\nListSlices\022\022.c" + "ontext.ContextId\032\022.context.SliceList\"\000\022." + "\n\010GetSlice\022\020.context.SliceId\032\016.context.S" + "lice\"\000\022.\n\010SetSlice\022\016.context.Slice\032\020.con" + "text.SliceId\"\000\0220\n\nUnsetSlice\022\016.context.S" + "lice\032\020.context.SliceId\"\000\0221\n\013RemoveSlice\022" + "\020.context.SliceId\032\016.context.Empty\"\000\0229\n\016G" + "etSliceEvents\022\016.context.Empty\032\023.context." + "SliceEvent\"\0000\001\0229\n\013SelectSlice\022\024.context." + "SliceFilter\032\022.context.SliceList\"\000\022D\n\021Lis" + "tConnectionIds\022\022.context.ServiceId\032\031.con" + "text.ConnectionIdList\"\000\022@\n\017ListConnectio" + "ns\022\022.context.ServiceId\032\027.context.Connect" + "ionList\"\000\022=\n\rGetConnection\022\025.context.Con" + "nectionId\032\023.context.Connection\"\000\022=\n\rSetC" + "onnection\022\023.context.Connection\032\025.context" + ".ConnectionId\"\000\022;\n\020RemoveConnection\022\025.co" + "ntext.ConnectionId\032\016.context.Empty\"\000\022C\n\023" + "GetConnectionEvents\022\016.context.Empty\032\030.co" + "ntext.ConnectionEvent\"\0000\001\022@\n\020GetOpticalC" + "onfig\022\016.context.Empty\032\032.context.OpticalC" + "onfigList\"\000\022F\n\020SetOpticalConfig\022\026.contex" + "t.OpticalConfig\032\030.context.OpticalConfigI" + "d\"\000\022I\n\023UpdateOpticalConfig\022\026.context.Opt" + "icalConfig\032\030.context.OpticalConfigId\"\000\022I" + "\n\023SelectOpticalConfig\022\030.context.OpticalC" + "onfigId\032\026.context.OpticalConfig\"\000\022A\n\023Del" + "eteOpticalConfig\022\030.context.OpticalConfig" + "Id\032\016.context.Empty\"\000\022@\n\024DeleteOpticalCha" + "nnel\022\026.context.OpticalConfig\032\016.context.E" + "mpty\"\000\0228\n\016SetOpticalLink\022\024.context.Optic" + "alLink\032\016.context.Empty\"\000\0229\n\016GetOpticalLi" + "nk\022\017.context.LinkId\032\024.context.OpticalLin" + "k\"\000\0226\n\021DeleteOpticalLink\022\017.context.LinkI" + "d\032\016.context.Empty\"\000\022@\n\022GetOpticalLinkLis" + "t\022\016.context.Empty\032\030.context.OpticalLinkL" + "ist\"\000\022G\n\027DeleteServiceConfigRule\022\032.conte" + "xt.ServiceConfigRule\032\016.context.Empty\"\000b\006" + "proto3" }; - descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom(descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] { com.google.protobuf.AnyProto.getDescriptor(), acl.Acl.getDescriptor(), kpi_sample_types.KpiSampleTypes.getDescriptor() }); + java.lang.String[] descriptorData = { "\n\rcontext.proto\022\007context\032\tacl.proto\032\026kpi" + "_sample_types.proto\"\007\n\005Empty\"\024\n\004Uuid\022\014\n\004" + "uuid\030\001 \001(\t\"\036\n\tTimestamp\022\021\n\ttimestamp\030\001 \001" + "(\001\"Z\n\005Event\022%\n\ttimestamp\030\001 \001(\0132\022.context" + ".Timestamp\022*\n\nevent_type\030\002 \001(\0162\026.context" + ".EventTypeEnum\"0\n\tContextId\022#\n\014context_u" + "uid\030\001 \001(\0132\r.context.Uuid\"\351\001\n\007Context\022&\n\n" + "context_id\030\001 \001(\0132\022.context.ContextId\022\014\n\004" + "name\030\002 \001(\t\022)\n\014topology_ids\030\003 \003(\0132\023.conte" + "xt.TopologyId\022\'\n\013service_ids\030\004 \003(\0132\022.con" + "text.ServiceId\022#\n\tslice_ids\030\005 \003(\0132\020.cont" + "ext.SliceId\022/\n\ncontroller\030\006 \001(\0132\033.contex" + "t.TeraFlowController\"8\n\rContextIdList\022\'\n" + "\013context_ids\030\001 \003(\0132\022.context.ContextId\"1" + "\n\013ContextList\022\"\n\010contexts\030\001 \003(\0132\020.contex" + "t.Context\"U\n\014ContextEvent\022\035\n\005event\030\001 \001(\013" + "2\016.context.Event\022&\n\ncontext_id\030\002 \001(\0132\022.c" + "ontext.ContextId\"Z\n\nTopologyId\022&\n\ncontex" + "t_id\030\001 \001(\0132\022.context.ContextId\022$\n\rtopolo" + "gy_uuid\030\002 \001(\0132\r.context.Uuid\"\214\001\n\010Topolog" + "y\022(\n\013topology_id\030\001 \001(\0132\023.context.Topolog" + "yId\022\014\n\004name\030\002 \001(\t\022%\n\ndevice_ids\030\003 \003(\0132\021." + "context.DeviceId\022!\n\010link_ids\030\004 \003(\0132\017.con" + "text.LinkId\"\211\001\n\017TopologyDetails\022(\n\013topol" + "ogy_id\030\001 \001(\0132\023.context.TopologyId\022\014\n\004nam" + "e\030\002 \001(\t\022 \n\007devices\030\003 \003(\0132\017.context.Devic" + "e\022\034\n\005links\030\004 \003(\0132\r.context.Link\";\n\016Topol" + "ogyIdList\022)\n\014topology_ids\030\001 \003(\0132\023.contex" + "t.TopologyId\"5\n\014TopologyList\022%\n\ntopologi" + "es\030\001 \003(\0132\021.context.Topology\"X\n\rTopologyE" + "vent\022\035\n\005event\030\001 \001(\0132\016.context.Event\022(\n\013t" + "opology_id\030\002 \001(\0132\023.context.TopologyId\".\n" + "\010DeviceId\022\"\n\013device_uuid\030\001 \001(\0132\r.context" + ".Uuid\"\372\002\n\006Device\022$\n\tdevice_id\030\001 \001(\0132\021.co" + "ntext.DeviceId\022\014\n\004name\030\002 \001(\t\022\023\n\013device_t" + "ype\030\003 \001(\t\022,\n\rdevice_config\030\004 \001(\0132\025.conte" + "xt.DeviceConfig\022G\n\031device_operational_st" + "atus\030\005 \001(\0162$.context.DeviceOperationalSt" + "atusEnum\0221\n\016device_drivers\030\006 \003(\0162\031.conte" + "xt.DeviceDriverEnum\022+\n\020device_endpoints\030" + "\007 \003(\0132\021.context.EndPoint\022&\n\ncomponents\030\010" + " \003(\0132\022.context.Component\022(\n\rcontroller_i" + "d\030\t \001(\0132\021.context.DeviceId\"\311\001\n\tComponent" + "\022%\n\016component_uuid\030\001 \001(\0132\r.context.Uuid\022" + "\014\n\004name\030\002 \001(\t\022\014\n\004type\030\003 \001(\t\0226\n\nattribute" + "s\030\004 \003(\0132\".context.Component.AttributesEn" + "try\022\016\n\006parent\030\005 \001(\t\0321\n\017AttributesEntry\022\013" + "\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"9\n\014Device" + "Config\022)\n\014config_rules\030\001 \003(\0132\023.context.C" + "onfigRule\"5\n\014DeviceIdList\022%\n\ndevice_ids\030" + "\001 \003(\0132\021.context.DeviceId\".\n\nDeviceList\022 " + "\n\007devices\030\001 \003(\0132\017.context.Device\"\216\001\n\014Dev" + "iceFilter\022)\n\ndevice_ids\030\001 \001(\0132\025.context." + "DeviceIdList\022\031\n\021include_endpoints\030\002 \001(\010\022" + "\034\n\024include_config_rules\030\003 \001(\010\022\032\n\022include" + "_components\030\004 \001(\010\"\200\001\n\013DeviceEvent\022\035\n\005eve" + "nt\030\001 \001(\0132\016.context.Event\022$\n\tdevice_id\030\002 " + "\001(\0132\021.context.DeviceId\022,\n\rdevice_config\030" + "\003 \001(\0132\025.context.DeviceConfig\"*\n\006LinkId\022 " + "\n\tlink_uuid\030\001 \001(\0132\r.context.Uuid\"\250\001\n\016Lin" + "kAttributes\022\033\n\023total_capacity_gbps\030\001 \001(\002" + "\022\032\n\022used_capacity_gbps\030\002 \001(\002\022\024\n\014availabl" + "e_bw\030\003 \001(\002\022\022\n\nlink_delay\030\005 \001(\002\022\032\n\022min_ma" + "x_link_delay\030\006 \001(\002\022\027\n\017delay_variation\030\007 " + "\001(\002\"\223\001\n\004Link\022 \n\007link_id\030\001 \001(\0132\017.context." + "LinkId\022\014\n\004name\030\002 \001(\t\022.\n\021link_endpoint_id" + "s\030\003 \003(\0132\023.context.EndPointId\022+\n\nattribut" + "es\030\004 \001(\0132\027.context.LinkAttributes\"/\n\nLin" + "kIdList\022!\n\010link_ids\030\001 \003(\0132\017.context.Link" + "Id\"(\n\010LinkList\022\034\n\005links\030\001 \003(\0132\r.context." + "Link\"L\n\tLinkEvent\022\035\n\005event\030\001 \001(\0132\016.conte" + "xt.Event\022 \n\007link_id\030\002 \001(\0132\017.context.Link" + "Id\"X\n\tServiceId\022&\n\ncontext_id\030\001 \001(\0132\022.co" + "ntext.ContextId\022#\n\014service_uuid\030\002 \001(\0132\r." + "context.Uuid\"\333\002\n\007Service\022&\n\nservice_id\030\001" + " \001(\0132\022.context.ServiceId\022\014\n\004name\030\002 \001(\t\022." + "\n\014service_type\030\003 \001(\0162\030.context.ServiceTy" + "peEnum\0221\n\024service_endpoint_ids\030\004 \003(\0132\023.c" + "ontext.EndPointId\0220\n\023service_constraints" + "\030\005 \003(\0132\023.context.Constraint\022.\n\016service_s" + "tatus\030\006 \001(\0132\026.context.ServiceStatus\022.\n\016s" + "ervice_config\030\007 \001(\0132\026.context.ServiceCon" + "fig\022%\n\ttimestamp\030\010 \001(\0132\022.context.Timesta" + "mp\"C\n\rServiceStatus\0222\n\016service_status\030\001 " + "\001(\0162\032.context.ServiceStatusEnum\":\n\rServi" + "ceConfig\022)\n\014config_rules\030\001 \003(\0132\023.context" + ".ConfigRule\"8\n\rServiceIdList\022\'\n\013service_" + "ids\030\001 \003(\0132\022.context.ServiceId\"1\n\013Service" + "List\022\"\n\010services\030\001 \003(\0132\020.context.Service" + "\"\225\001\n\rServiceFilter\022+\n\013service_ids\030\001 \001(\0132" + "\026.context.ServiceIdList\022\034\n\024include_endpo" + "int_ids\030\002 \001(\010\022\033\n\023include_constraints\030\003 \001" + "(\010\022\034\n\024include_config_rules\030\004 \001(\010\"U\n\014Serv" + "iceEvent\022\035\n\005event\030\001 \001(\0132\016.context.Event\022" + "&\n\nservice_id\030\002 \001(\0132\022.context.ServiceId\"" + "T\n\007SliceId\022&\n\ncontext_id\030\001 \001(\0132\022.context" + ".ContextId\022!\n\nslice_uuid\030\002 \001(\0132\r.context" + ".Uuid\"\240\003\n\005Slice\022\"\n\010slice_id\030\001 \001(\0132\020.cont" + "ext.SliceId\022\014\n\004name\030\002 \001(\t\022/\n\022slice_endpo" + "int_ids\030\003 \003(\0132\023.context.EndPointId\022.\n\021sl" + "ice_constraints\030\004 \003(\0132\023.context.Constrai" + "nt\022-\n\021slice_service_ids\030\005 \003(\0132\022.context." + "ServiceId\022,\n\022slice_subslice_ids\030\006 \003(\0132\020." + "context.SliceId\022*\n\014slice_status\030\007 \001(\0132\024." + "context.SliceStatus\022*\n\014slice_config\030\010 \001(" + "\0132\024.context.SliceConfig\022(\n\013slice_owner\030\t" + " \001(\0132\023.context.SliceOwner\022%\n\ttimestamp\030\n" + " \001(\0132\022.context.Timestamp\"E\n\nSliceOwner\022!" + "\n\nowner_uuid\030\001 \001(\0132\r.context.Uuid\022\024\n\014own" + "er_string\030\002 \001(\t\"=\n\013SliceStatus\022.\n\014slice_" + "status\030\001 \001(\0162\030.context.SliceStatusEnum\"8" + "\n\013SliceConfig\022)\n\014config_rules\030\001 \003(\0132\023.co" + "ntext.ConfigRule\"2\n\013SliceIdList\022#\n\tslice" + "_ids\030\001 \003(\0132\020.context.SliceId\"+\n\tSliceLis" + "t\022\036\n\006slices\030\001 \003(\0132\016.context.Slice\"\312\001\n\013Sl" + "iceFilter\022\'\n\tslice_ids\030\001 \001(\0132\024.context.S" + "liceIdList\022\034\n\024include_endpoint_ids\030\002 \001(\010" + "\022\033\n\023include_constraints\030\003 \001(\010\022\033\n\023include" + "_service_ids\030\004 \001(\010\022\034\n\024include_subslice_i" + "ds\030\005 \001(\010\022\034\n\024include_config_rules\030\006 \001(\010\"O" + "\n\nSliceEvent\022\035\n\005event\030\001 \001(\0132\016.context.Ev" + "ent\022\"\n\010slice_id\030\002 \001(\0132\020.context.SliceId\"" + "6\n\014ConnectionId\022&\n\017connection_uuid\030\001 \001(\013" + "2\r.context.Uuid\"2\n\025ConnectionSettings_L0" + "\022\031\n\021lsp_symbolic_name\030\001 \001(\t\"\236\001\n\025Connecti" + "onSettings_L2\022\027\n\017src_mac_address\030\001 \001(\t\022\027" + "\n\017dst_mac_address\030\002 \001(\t\022\022\n\nether_type\030\003 " + "\001(\r\022\017\n\007vlan_id\030\004 \001(\r\022\022\n\nmpls_label\030\005 \001(\r" + "\022\032\n\022mpls_traffic_class\030\006 \001(\r\"t\n\025Connecti" + "onSettings_L3\022\026\n\016src_ip_address\030\001 \001(\t\022\026\n" + "\016dst_ip_address\030\002 \001(\t\022\014\n\004dscp\030\003 \001(\r\022\020\n\010p" + "rotocol\030\004 \001(\r\022\013\n\003ttl\030\005 \001(\r\"[\n\025Connection" + "Settings_L4\022\020\n\010src_port\030\001 \001(\r\022\020\n\010dst_por" + "t\030\002 \001(\r\022\021\n\ttcp_flags\030\003 \001(\r\022\013\n\003ttl\030\004 \001(\r\"" + "\304\001\n\022ConnectionSettings\022*\n\002l0\030\001 \001(\0132\036.con" + "text.ConnectionSettings_L0\022*\n\002l2\030\002 \001(\0132\036" + ".context.ConnectionSettings_L2\022*\n\002l3\030\003 \001" + "(\0132\036.context.ConnectionSettings_L3\022*\n\002l4" + "\030\004 \001(\0132\036.context.ConnectionSettings_L4\"\363" + "\001\n\nConnection\022,\n\rconnection_id\030\001 \001(\0132\025.c" + "ontext.ConnectionId\022&\n\nservice_id\030\002 \001(\0132" + "\022.context.ServiceId\0223\n\026path_hops_endpoin" + "t_ids\030\003 \003(\0132\023.context.EndPointId\022+\n\017sub_" + "service_ids\030\004 \003(\0132\022.context.ServiceId\022-\n" + "\010settings\030\005 \001(\0132\033.context.ConnectionSett" + "ings\"A\n\020ConnectionIdList\022-\n\016connection_i" + "ds\030\001 \003(\0132\025.context.ConnectionId\":\n\016Conne" + "ctionList\022(\n\013connections\030\001 \003(\0132\023.context" + ".Connection\"^\n\017ConnectionEvent\022\035\n\005event\030" + "\001 \001(\0132\016.context.Event\022,\n\rconnection_id\030\002" + " \001(\0132\025.context.ConnectionId\"\202\001\n\nEndPoint" + "Id\022(\n\013topology_id\030\001 \001(\0132\023.context.Topolo" + "gyId\022$\n\tdevice_id\030\002 \001(\0132\021.context.Device" + "Id\022$\n\rendpoint_uuid\030\003 \001(\0132\r.context.Uuid" + "\"\302\001\n\010EndPoint\022(\n\013endpoint_id\030\001 \001(\0132\023.con" + "text.EndPointId\022\014\n\004name\030\002 \001(\t\022\025\n\rendpoin" + "t_type\030\003 \001(\t\0229\n\020kpi_sample_types\030\004 \003(\0162\037" + ".kpi_sample_types.KpiSampleType\022,\n\021endpo" + "int_location\030\005 \001(\0132\021.context.Location\"{\n" + "\014EndPointName\022(\n\013endpoint_id\030\001 \001(\0132\023.con" + "text.EndPointId\022\023\n\013device_name\030\002 \001(\t\022\025\n\r" + "endpoint_name\030\003 \001(\t\022\025\n\rendpoint_type\030\004 \001" + "(\t\";\n\016EndPointIdList\022)\n\014endpoint_ids\030\001 \003" + "(\0132\023.context.EndPointId\"A\n\020EndPointNameL" + "ist\022-\n\016endpoint_names\030\001 \003(\0132\025.context.En" + "dPointName\"A\n\021ConfigRule_Custom\022\024\n\014resou" + "rce_key\030\001 \001(\t\022\026\n\016resource_value\030\002 \001(\t\"]\n" + "\016ConfigRule_ACL\022(\n\013endpoint_id\030\001 \001(\0132\023.c" + "ontext.EndPointId\022!\n\010rule_set\030\002 \001(\0132\017.ac" + "l.AclRuleSet\"\234\001\n\nConfigRule\022)\n\006action\030\001 " + "\001(\0162\031.context.ConfigActionEnum\022,\n\006custom" + "\030\002 \001(\0132\032.context.ConfigRule_CustomH\000\022&\n\003" + "acl\030\003 \001(\0132\027.context.ConfigRule_ACLH\000B\r\n\013" + "config_rule\"F\n\021Constraint_Custom\022\027\n\017cons" + "traint_type\030\001 \001(\t\022\030\n\020constraint_value\030\002 " + "\001(\t\"E\n\023Constraint_Schedule\022\027\n\017start_time" + "stamp\030\001 \001(\002\022\025\n\rduration_days\030\002 \001(\002\"3\n\014GP" + "S_Position\022\020\n\010latitude\030\001 \001(\002\022\021\n\tlongitud" + "e\030\002 \001(\002\"W\n\010Location\022\020\n\006region\030\001 \001(\tH\000\022-\n" + "\014gps_position\030\002 \001(\0132\025.context.GPS_Positi" + "onH\000B\n\n\010location\"l\n\033Constraint_EndPointL" + "ocation\022(\n\013endpoint_id\030\001 \001(\0132\023.context.E" + "ndPointId\022#\n\010location\030\002 \001(\0132\021.context.Lo" + "cation\"Y\n\033Constraint_EndPointPriority\022(\n" + "\013endpoint_id\030\001 \001(\0132\023.context.EndPointId\022" + "\020\n\010priority\030\002 \001(\r\"0\n\026Constraint_SLA_Late" + "ncy\022\026\n\016e2e_latency_ms\030\001 \001(\002\"0\n\027Constrain" + "t_SLA_Capacity\022\025\n\rcapacity_gbps\030\001 \001(\002\"c\n" + "\033Constraint_SLA_Availability\022\032\n\022num_disj" + "oint_paths\030\001 \001(\r\022\022\n\nall_active\030\002 \001(\010\022\024\n\014" + "availability\030\003 \001(\002\"V\n\036Constraint_SLA_Iso" + "lation_level\0224\n\017isolation_level\030\001 \003(\0162\033." + "context.IsolationLevelEnum\"\242\001\n\025Constrain" + "t_Exclusions\022\024\n\014is_permanent\030\001 \001(\010\022%\n\nde" + "vice_ids\030\002 \003(\0132\021.context.DeviceId\022)\n\014end" + "point_ids\030\003 \003(\0132\023.context.EndPointId\022!\n\010" + "link_ids\030\004 \003(\0132\017.context.LinkId\"\333\004\n\nCons" + "traint\022-\n\006action\030\001 \001(\0162\035.context.Constra" + "intActionEnum\022,\n\006custom\030\002 \001(\0132\032.context." + "Constraint_CustomH\000\0220\n\010schedule\030\003 \001(\0132\034." + "context.Constraint_ScheduleH\000\022A\n\021endpoin" + "t_location\030\004 \001(\0132$.context.Constraint_En" + "dPointLocationH\000\022A\n\021endpoint_priority\030\005 " + "\001(\0132$.context.Constraint_EndPointPriorit" + "yH\000\0228\n\014sla_capacity\030\006 \001(\0132 .context.Cons" + "traint_SLA_CapacityH\000\0226\n\013sla_latency\030\007 \001" + "(\0132\037.context.Constraint_SLA_LatencyH\000\022@\n" + "\020sla_availability\030\010 \001(\0132$.context.Constr" + "aint_SLA_AvailabilityH\000\022@\n\rsla_isolation" + "\030\t \001(\0132\'.context.Constraint_SLA_Isolatio" + "n_levelH\000\0224\n\nexclusions\030\n \001(\0132\036.context." + "Constraint_ExclusionsH\000B\014\n\nconstraint\"^\n" + "\022TeraFlowController\022&\n\ncontext_id\030\001 \001(\0132" + "\022.context.ContextId\022\022\n\nip_address\030\002 \001(\t\022" + "\014\n\004port\030\003 \001(\r\"U\n\024AuthenticationResult\022&\n" + "\ncontext_id\030\001 \001(\0132\022.context.ContextId\022\025\n" + "\rauthenticated\030\002 \001(\010\"-\n\017OpticalConfigId\022" + "\032\n\022opticalconfig_uuid\030\001 \001(\t\"S\n\rOpticalCo" + "nfig\0222\n\020opticalconfig_id\030\001 \001(\0132\030.context" + ".OpticalConfigId\022\016\n\006config\030\002 \001(\t\"C\n\021Opti" + "calConfigList\022.\n\016opticalconfigs\030\001 \003(\0132\026." + "context.OpticalConfig\"9\n\rOpticalLinkId\022(" + "\n\021optical_link_uuid\030\001 \001(\0132\r.context.Uuid" + "\",\n\007FiberId\022!\n\nfiber_uuid\030\001 \001(\0132\r.contex" + "t.Uuid\"\341\001\n\005Fiber\022\n\n\002ID\030\n \001(\t\022\020\n\010src_port" + "\030\001 \001(\t\022\020\n\010dst_port\030\002 \001(\t\022\027\n\017local_peer_p" + "ort\030\003 \001(\t\022\030\n\020remote_peer_port\030\004 \001(\t\022\017\n\007c" + "_slots\030\005 \003(\005\022\017\n\007l_slots\030\006 \003(\005\022\017\n\007s_slots" + "\030\007 \003(\005\022\016\n\006length\030\010 \001(\002\022\014\n\004used\030\t \001(\010\022$\n\n" + "fiber_uuid\030\013 \001(\0132\020.context.FiberId\"d\n\022Op" + "ticalLinkDetails\022\016\n\006length\030\001 \001(\002\022\016\n\006sour" + "ce\030\002 \001(\t\022\016\n\006target\030\003 \001(\t\022\036\n\006fibers\030\004 \003(\013" + "2\016.context.Fiber\"|\n\013OpticalLink\022\014\n\004name\030" + "\001 \001(\t\022,\n\007details\030\002 \001(\0132\033.context.Optical" + "LinkDetails\0221\n\021optical_link_uuid\030\003 \001(\0132\026" + ".context.OpticalLinkId*j\n\rEventTypeEnum\022" + "\027\n\023EVENTTYPE_UNDEFINED\020\000\022\024\n\020EVENTTYPE_CR" + "EATE\020\001\022\024\n\020EVENTTYPE_UPDATE\020\002\022\024\n\020EVENTTYP" + "E_REMOVE\020\003*\376\002\n\020DeviceDriverEnum\022\032\n\026DEVIC" + "EDRIVER_UNDEFINED\020\000\022\033\n\027DEVICEDRIVER_OPEN" + "CONFIG\020\001\022\036\n\032DEVICEDRIVER_TRANSPORT_API\020\002" + "\022\023\n\017DEVICEDRIVER_P4\020\003\022&\n\"DEVICEDRIVER_IE" + "TF_NETWORK_TOPOLOGY\020\004\022\033\n\027DEVICEDRIVER_ON" + "F_TR_532\020\005\022\023\n\017DEVICEDRIVER_XR\020\006\022\033\n\027DEVIC" + "EDRIVER_IETF_L2VPN\020\007\022 \n\034DEVICEDRIVER_GNM" + "I_OPENCONFIG\020\010\022\034\n\030DEVICEDRIVER_OPTICAL_T" + "FS\020\t\022\032\n\026DEVICEDRIVER_IETF_ACTN\020\n\022\023\n\017DEVI" + "CEDRIVER_OC\020\013\022\024\n\020DEVICEDRIVER_QKD\020\014*\217\001\n\033" + "DeviceOperationalStatusEnum\022%\n!DEVICEOPE" + "RATIONALSTATUS_UNDEFINED\020\000\022$\n DEVICEOPER" + "ATIONALSTATUS_DISABLED\020\001\022#\n\037DEVICEOPERAT" + "IONALSTATUS_ENABLED\020\002*\345\001\n\017ServiceTypeEnu" + "m\022\027\n\023SERVICETYPE_UNKNOWN\020\000\022\024\n\020SERVICETYP" + "E_L3NM\020\001\022\024\n\020SERVICETYPE_L2NM\020\002\022)\n%SERVIC" + "ETYPE_TAPI_CONNECTIVITY_SERVICE\020\003\022\022\n\016SER" + "VICETYPE_TE\020\004\022\023\n\017SERVICETYPE_E2E\020\005\022$\n SE" + "RVICETYPE_OPTICAL_CONNECTIVITY\020\006\022\023\n\017SERV" + "ICETYPE_QKD\020\007*\304\001\n\021ServiceStatusEnum\022\033\n\027S" + "ERVICESTATUS_UNDEFINED\020\000\022\031\n\025SERVICESTATU" + "S_PLANNED\020\001\022\030\n\024SERVICESTATUS_ACTIVE\020\002\022\032\n" + "\026SERVICESTATUS_UPDATING\020\003\022!\n\035SERVICESTAT" + "US_PENDING_REMOVAL\020\004\022\036\n\032SERVICESTATUS_SL" + "A_VIOLATED\020\005*\251\001\n\017SliceStatusEnum\022\031\n\025SLIC" + "ESTATUS_UNDEFINED\020\000\022\027\n\023SLICESTATUS_PLANN" + "ED\020\001\022\024\n\020SLICESTATUS_INIT\020\002\022\026\n\022SLICESTATU" + "S_ACTIVE\020\003\022\026\n\022SLICESTATUS_DEINIT\020\004\022\034\n\030SL" + "ICESTATUS_SLA_VIOLATED\020\005*]\n\020ConfigAction" + "Enum\022\032\n\026CONFIGACTION_UNDEFINED\020\000\022\024\n\020CONF" + "IGACTION_SET\020\001\022\027\n\023CONFIGACTION_DELETE\020\002*" + "m\n\024ConstraintActionEnum\022\036\n\032CONSTRAINTACT" + "ION_UNDEFINED\020\000\022\030\n\024CONSTRAINTACTION_SET\020" + "\001\022\033\n\027CONSTRAINTACTION_DELETE\020\002*\203\002\n\022Isola" + "tionLevelEnum\022\020\n\014NO_ISOLATION\020\000\022\026\n\022PHYSI" + "CAL_ISOLATION\020\001\022\025\n\021LOGICAL_ISOLATION\020\002\022\025" + "\n\021PROCESS_ISOLATION\020\003\022\035\n\031PHYSICAL_MEMORY" + "_ISOLATION\020\004\022\036\n\032PHYSICAL_NETWORK_ISOLATI" + "ON\020\005\022\036\n\032VIRTUAL_RESOURCE_ISOLATION\020\006\022\037\n\033" + "NETWORK_FUNCTIONS_ISOLATION\020\007\022\025\n\021SERVICE" + "_ISOLATION\020\0102\246\031\n\016ContextService\022:\n\016ListC" + "ontextIds\022\016.context.Empty\032\026.context.Cont" + "extIdList\"\000\0226\n\014ListContexts\022\016.context.Em" + "pty\032\024.context.ContextList\"\000\0224\n\nGetContex" + "t\022\022.context.ContextId\032\020.context.Context\"" + "\000\0224\n\nSetContext\022\020.context.Context\032\022.cont" + "ext.ContextId\"\000\0225\n\rRemoveContext\022\022.conte" + "xt.ContextId\032\016.context.Empty\"\000\022=\n\020GetCon" + "textEvents\022\016.context.Empty\032\025.context.Con" + "textEvent\"\0000\001\022@\n\017ListTopologyIds\022\022.conte" + "xt.ContextId\032\027.context.TopologyIdList\"\000\022" + "=\n\016ListTopologies\022\022.context.ContextId\032\025." + "context.TopologyList\"\000\0227\n\013GetTopology\022\023." + "context.TopologyId\032\021.context.Topology\"\000\022" + "E\n\022GetTopologyDetails\022\023.context.Topology" + "Id\032\030.context.TopologyDetails\"\000\0227\n\013SetTop" + "ology\022\021.context.Topology\032\023.context.Topol" + "ogyId\"\000\0227\n\016RemoveTopology\022\023.context.Topo" + "logyId\032\016.context.Empty\"\000\022?\n\021GetTopologyE" + "vents\022\016.context.Empty\032\026.context.Topology" + "Event\"\0000\001\0228\n\rListDeviceIds\022\016.context.Emp" + "ty\032\025.context.DeviceIdList\"\000\0224\n\013ListDevic" + "es\022\016.context.Empty\032\023.context.DeviceList\"" + "\000\0221\n\tGetDevice\022\021.context.DeviceId\032\017.cont" + "ext.Device\"\000\0221\n\tSetDevice\022\017.context.Devi" + "ce\032\021.context.DeviceId\"\000\0223\n\014RemoveDevice\022" + "\021.context.DeviceId\032\016.context.Empty\"\000\022;\n\017" + "GetDeviceEvents\022\016.context.Empty\032\024.contex" + "t.DeviceEvent\"\0000\001\022<\n\014SelectDevice\022\025.cont" + "ext.DeviceFilter\032\023.context.DeviceList\"\000\022" + "I\n\021ListEndPointNames\022\027.context.EndPointI" + "dList\032\031.context.EndPointNameList\"\000\0224\n\013Li" + "stLinkIds\022\016.context.Empty\032\023.context.Link" + "IdList\"\000\0220\n\tListLinks\022\016.context.Empty\032\021." + "context.LinkList\"\000\022+\n\007GetLink\022\017.context." + "LinkId\032\r.context.Link\"\000\022+\n\007SetLink\022\r.con" + "text.Link\032\017.context.LinkId\"\000\022/\n\nRemoveLi" + "nk\022\017.context.LinkId\032\016.context.Empty\"\000\0227\n" + "\rGetLinkEvents\022\016.context.Empty\032\022.context" + ".LinkEvent\"\0000\001\022>\n\016ListServiceIds\022\022.conte" + "xt.ContextId\032\026.context.ServiceIdList\"\000\022:" + "\n\014ListServices\022\022.context.ContextId\032\024.con" + "text.ServiceList\"\000\0224\n\nGetService\022\022.conte" + "xt.ServiceId\032\020.context.Service\"\000\0224\n\nSetS" + "ervice\022\020.context.Service\032\022.context.Servi" + "ceId\"\000\0226\n\014UnsetService\022\020.context.Service" + "\032\022.context.ServiceId\"\000\0225\n\rRemoveService\022" + "\022.context.ServiceId\032\016.context.Empty\"\000\022=\n" + "\020GetServiceEvents\022\016.context.Empty\032\025.cont" + "ext.ServiceEvent\"\0000\001\022?\n\rSelectService\022\026." + "context.ServiceFilter\032\024.context.ServiceL" + "ist\"\000\022:\n\014ListSliceIds\022\022.context.ContextI" + "d\032\024.context.SliceIdList\"\000\0226\n\nListSlices\022" + "\022.context.ContextId\032\022.context.SliceList\"" + "\000\022.\n\010GetSlice\022\020.context.SliceId\032\016.contex" + "t.Slice\"\000\022.\n\010SetSlice\022\016.context.Slice\032\020." + "context.SliceId\"\000\0220\n\nUnsetSlice\022\016.contex" + "t.Slice\032\020.context.SliceId\"\000\0221\n\013RemoveSli" + "ce\022\020.context.SliceId\032\016.context.Empty\"\000\0229" + "\n\016GetSliceEvents\022\016.context.Empty\032\023.conte" + "xt.SliceEvent\"\0000\001\0229\n\013SelectSlice\022\024.conte" + "xt.SliceFilter\032\022.context.SliceList\"\000\022D\n\021" + "ListConnectionIds\022\022.context.ServiceId\032\031." + "context.ConnectionIdList\"\000\022@\n\017ListConnec" + "tions\022\022.context.ServiceId\032\027.context.Conn" + "ectionList\"\000\022=\n\rGetConnection\022\025.context." + "ConnectionId\032\023.context.Connection\"\000\022=\n\rS" + "etConnection\022\023.context.Connection\032\025.cont" + "ext.ConnectionId\"\000\022;\n\020RemoveConnection\022\025" + ".context.ConnectionId\032\016.context.Empty\"\000\022" + "C\n\023GetConnectionEvents\022\016.context.Empty\032\030" + ".context.ConnectionEvent\"\0000\001\022@\n\020GetOptic" + "alConfig\022\016.context.Empty\032\032.context.Optic" + "alConfigList\"\000\022F\n\020SetOpticalConfig\022\026.con" + "text.OpticalConfig\032\030.context.OpticalConf" + "igId\"\000\022I\n\023SelectOpticalConfig\022\030.context." + "OpticalConfigId\032\026.context.OpticalConfig\"" + "\000\0228\n\016SetOpticalLink\022\024.context.OpticalLin" + "k\032\016.context.Empty\"\000\022@\n\016GetOpticalLink\022\026." + "context.OpticalLinkId\032\024.context.OpticalL" + "ink\"\000\022.\n\010GetFiber\022\020.context.FiberId\032\016.co" + "ntext.Fiber\"\000b\006proto3" }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom(descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] { acl.Acl.getDescriptor(), kpi_sample_types.KpiSampleTypes.getDescriptor() }); internal_static_context_Empty_descriptor = getDescriptor().getMessageTypes().get(0); internal_static_context_Empty_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(internal_static_context_Empty_descriptor, new java.lang.String[] {}); internal_static_context_Uuid_descriptor = getDescriptor().getMessageTypes().get(1); @@ -81193,7 +81567,7 @@ public final class ContextOuterClass { internal_static_context_LinkId_descriptor = getDescriptor().getMessageTypes().get(23); internal_static_context_LinkId_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(internal_static_context_LinkId_descriptor, new java.lang.String[] { "LinkUuid" }); internal_static_context_LinkAttributes_descriptor = getDescriptor().getMessageTypes().get(24); - internal_static_context_LinkAttributes_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(internal_static_context_LinkAttributes_descriptor, new java.lang.String[] { "TotalCapacityGbps", "UsedCapacityGbps" }); + internal_static_context_LinkAttributes_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(internal_static_context_LinkAttributes_descriptor, new java.lang.String[] { "TotalCapacityGbps", "UsedCapacityGbps", "AvailableBw", "LinkDelay", "MinMaxLinkDelay", "DelayVariation" }); internal_static_context_Link_descriptor = getDescriptor().getMessageTypes().get(25); internal_static_context_Link_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(internal_static_context_Link_descriptor, new java.lang.String[] { "LinkId", "Name", "LinkType", "LinkEndpointIds", "Attributes" }); internal_static_context_LinkIdList_descriptor = getDescriptor().getMessageTypes().get(26);