// Copyright 2022-2024 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.

syntax = "proto3";
package src.main.proto;

//el modulo java abre la comunicacion
//cliente(java) manda la info al servidor(python)
//el modulo en python responde con ok

message updateRequest {

	string addressFamilyID = 1;
	string nextHop = 2;
	string asPathSegment = 3;

  	repeated nodeInfo node = 4;
  	// repeated : se da la posibilidad de mandar 0 o varios
  	repeated linkInfo link = 5;
	}

message nodeInfo{
	string nodeName=1;
	string igpID=2;
	string bgplsID=3;
	int32 asID=4;
	string learntFrom = 5;
}

message linkInfo{

	string remoteID=1;
	string localID=2;

	string remoteIPv4ID=3;
	string localIPv4ID=4;

	NodeDescriptors local=5;
	NodeDescriptors remote=6;

	float availableBw=7;
	float residualBw = 8;
	float utilized = 9;

	float maxLinkDelay = 10;
	float minLinkDelay = 11;
	float delayVariation = 12;
	float delay = 13;

	int32 TEDefaultMetric = 14;
	string adjacencySid = 15;

	string learntFrom = 16;

}

message NodeDescriptors{
	string asNumber=1;
	string bgplsID=2;
}

message updateResponse {
  string ack = 1;
}

// Defining a Service, a Service can have multiple RPC operations
service updateService {
  // MODIFY HERE: Update the return to streaming return.
  rpc update(updateRequest) returns (updateResponse);
}
