Commit ae6bc78b authored by Lluis Gifre Renom's avatar Lluis Gifre Renom
Browse files

PathComp:

- Added definition of algorithm in proto file
- Minor code comments and TODOs added
parent f4cff5db
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -21,8 +21,19 @@ service PathCompService {
  rpc Compute(PathCompRequest) returns (PathCompReply) {}
}

message Algorithm_ShortestPath {}

message Algorithm_KShortestPath {
  uint32 k_inspection = 1;
  uint32 k_return     = 2;
}

message PathCompRequest {
  repeated context.Service services = 1;
  oneof algorithm {
    Algorithm_ShortestPath  shortest_path   = 10;
    Algorithm_KShortestPath k_shortest_path = 11;
  }
}

message PathCompReply {
+2 −0
Original line number Diff line number Diff line
@@ -38,6 +38,8 @@ class PathCompServiceServicerImpl(PathCompServiceServicer):

        context_client = ContextClient()

        # TODO: consider filtering resources

        grpc_contexts = context_client.ListContexts(Empty())
        grpc_devices = context_client.ListDevices(Empty())
        grpc_links = context_client.ListLinks(Empty())
+2 −2
Original line number Diff line number Diff line
@@ -93,8 +93,8 @@ LINK_C2_C3_ID, LINK_C2_C3 = compose_link(DEVICE_C2_ENDPOINTS[1], DEVICE_C3_ENDPO

# ----- Service --------------------------------------------------------------------------------------------------------
SERVICE_A1_B1 = compose_service(DEVICE_A1_ENDPOINTS[2], DEVICE_B1_ENDPOINTS[2], constraints=[
    json_constraint('bandwidth', 10.0),
    json_constraint('latency_ms', 5.0)
    json_constraint('bandwidth[gbps]', 10.0),
    json_constraint('latency[ms]',      5.0),
])

# ----- Containers -----------------------------------------------------------------------------------------------------