Commit a83c9f7f authored by Ricard Vilalta's avatar Ricard Vilalta
Browse files

Introducing contextId

parent fd9f9edd
Loading
Loading
Loading
Loading
+18 −8
Original line number Diff line number Diff line
@@ -13,20 +13,29 @@ message Empty {
}

message Context {
  Topology topo = 1;
  TeraFlowController ctl = 2;
  ContextId contextId= 1;
  Topology topo = 2;
  TeraFlowController ctl = 3;
}

message ContextId {
  Uuid contextUuid = 1;
}

message Topology {
  repeated Device device = 1;
  repeated Link link = 2; 
  TopologyId topoId = 2;
  repeated Device device = 3;
  repeated Link link = 4; 
}

message Link {
  repeated EndPointId endpointList = 1;
}


message TopologyId {
  ContextId contextId = 1;
  Uuid topoId = 2;
}

message Constraint {
  string constraint_type = 1;
@@ -51,8 +60,9 @@ message EndPoint {
}

message EndPointId {
  Uuid port_id = 1;
  TopologyId topoId = 1;
  DeviceId dev_id = 2;
  Uuid port_id = 3;
}

message DeviceId {
@@ -69,12 +79,12 @@ enum DeviceOperationalStatus {
}

message TeraFlowController {
  context.Uuid ctl_id = 1;
  ContextId ctl_id = 1;
  string ipaddress = 2;
}

message AuthenticationResult {
  context.Uuid ctl_id = 1;
  ContextId ctl_id = 1;
  bool authenticated = 2;
}

+2 −1
Original line number Diff line number Diff line
@@ -39,7 +39,8 @@ message ServiceConfig {
}

message ServiceId {
  context.Uuid cs_id = 1;
  context.ContextId contextId = 1;
  context.Uuid cs_id = 2;
}

message ServiceIdList {
+6 −2
Original line number Diff line number Diff line
@@ -3,6 +3,7 @@ syntax = "proto3";
package slice;

import "context.proto";
import "service.proto";

service SliceService {
  rpc CreateUpdateSlice ( TransportSlice ) returns (SliceStatus) {}
@@ -19,11 +20,14 @@ message TransportSlice {
  SliceId slice_id = 1;
  repeated slice.SliceEndpoint endpoints = 2;
  repeated context.Constraint constraints = 3;
  SliceStatus status = 4;
  repeated service.ServiceId services = 4;
  repeated SliceId subSlicesId = 5;
  SliceStatus status = 6;
}

message SliceId {
  context.Uuid slice_id = 1;
  context.ContextId contextId = 1;
  context.Uuid slice_id = 2;
}

message SliceStatus {
+16 −19
Original line number Diff line number Diff line
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: attack_mitigator.proto
"""Generated protocol buffer code."""

import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
@@ -19,8 +21,7 @@ DESCRIPTOR = _descriptor.FileDescriptor(
  package='attack_mitigator',
  syntax='proto3',
  serialized_options=None,
  create_key=_descriptor._internal_create_key,
  serialized_pb=b'\n\x16\x61ttack_mitigator.proto\x12\x10\x61ttack_mitigator\x1a\rcontext.proto\"t\n\x11\x41ttackDescription\x12\x1c\n\x05\x63s_id\x18\x01 \x01(\x0b\x32\r.context.Uuid\x12\x11\n\tattack_id\x18\x02 \x01(\x05\x12\x12\n\nconfidence\x18\x03 \x01(\x02\x12\x1a\n\x12\x61ttack_description\x18\x04 \x01(\t\"\xa2\x01\n\x0e\x41ttackResponse\x12\x1c\n\x05\x63s_id\x18\x01 \x01(\x0b\x32\r.context.Uuid\x12\x11\n\tattack_id\x18\x02 \x01(\x05\x12\x1a\n\x12\x61ttack_description\x18\x03 \x01(\t\x12\x1c\n\x14response_strategy_id\x18\x04 \x01(\x05\x12%\n\x1dresponse_strategy_description\x18\x05 \x01(\t2j\n\x0f\x41ttackMitigator\x12W\n\x0cNotifyAttack\x12#.attack_mitigator.AttackDescription\x1a .attack_mitigator.AttackResponse\"\x00\x62\x06proto3'
  serialized_pb=_b('\n\x16\x61ttack_mitigator.proto\x12\x10\x61ttack_mitigator\x1a\rcontext.proto\"t\n\x11\x41ttackDescription\x12\x1c\n\x05\x63s_id\x18\x01 \x01(\x0b\x32\r.context.Uuid\x12\x11\n\tattack_id\x18\x02 \x01(\x05\x12\x12\n\nconfidence\x18\x03 \x01(\x02\x12\x1a\n\x12\x61ttack_description\x18\x04 \x01(\t\"\xa2\x01\n\x0e\x41ttackResponse\x12\x1c\n\x05\x63s_id\x18\x01 \x01(\x0b\x32\r.context.Uuid\x12\x11\n\tattack_id\x18\x02 \x01(\x05\x12\x1a\n\x12\x61ttack_description\x18\x03 \x01(\t\x12\x1c\n\x14response_strategy_id\x18\x04 \x01(\x05\x12%\n\x1dresponse_strategy_description\x18\x05 \x01(\t2j\n\x0f\x41ttackMitigator\x12W\n\x0cNotifyAttack\x12#.attack_mitigator.AttackDescription\x1a .attack_mitigator.AttackResponse\"\x00\x62\x06proto3')
  ,
  dependencies=[context__pb2.DESCRIPTOR,])

@@ -33,7 +34,6 @@ _ATTACKDESCRIPTION = _descriptor.Descriptor(
  filename=None,
  file=DESCRIPTOR,
  containing_type=None,
  create_key=_descriptor._internal_create_key,
  fields=[
    _descriptor.FieldDescriptor(
      name='cs_id', full_name='attack_mitigator.AttackDescription.cs_id', index=0,
@@ -41,28 +41,28 @@ _ATTACKDESCRIPTION = _descriptor.Descriptor(
      has_default_value=False, default_value=None,
      message_type=None, enum_type=None, containing_type=None,
      is_extension=False, extension_scope=None,
      serialized_options=None, file=DESCRIPTOR,  create_key=_descriptor._internal_create_key),
      serialized_options=None, file=DESCRIPTOR),
    _descriptor.FieldDescriptor(
      name='attack_id', full_name='attack_mitigator.AttackDescription.attack_id', index=1,
      number=2, type=5, cpp_type=1, label=1,
      has_default_value=False, default_value=0,
      message_type=None, enum_type=None, containing_type=None,
      is_extension=False, extension_scope=None,
      serialized_options=None, file=DESCRIPTOR,  create_key=_descriptor._internal_create_key),
      serialized_options=None, file=DESCRIPTOR),
    _descriptor.FieldDescriptor(
      name='confidence', full_name='attack_mitigator.AttackDescription.confidence', index=2,
      number=3, type=2, cpp_type=6, label=1,
      has_default_value=False, default_value=float(0),
      message_type=None, enum_type=None, containing_type=None,
      is_extension=False, extension_scope=None,
      serialized_options=None, file=DESCRIPTOR,  create_key=_descriptor._internal_create_key),
      serialized_options=None, file=DESCRIPTOR),
    _descriptor.FieldDescriptor(
      name='attack_description', full_name='attack_mitigator.AttackDescription.attack_description', index=3,
      number=4, type=9, cpp_type=9, label=1,
      has_default_value=False, default_value=b"".decode('utf-8'),
      has_default_value=False, default_value=_b("").decode('utf-8'),
      message_type=None, enum_type=None, containing_type=None,
      is_extension=False, extension_scope=None,
      serialized_options=None, file=DESCRIPTOR,  create_key=_descriptor._internal_create_key),
      serialized_options=None, file=DESCRIPTOR),
  ],
  extensions=[
  ],
@@ -86,7 +86,6 @@ _ATTACKRESPONSE = _descriptor.Descriptor(
  filename=None,
  file=DESCRIPTOR,
  containing_type=None,
  create_key=_descriptor._internal_create_key,
  fields=[
    _descriptor.FieldDescriptor(
      name='cs_id', full_name='attack_mitigator.AttackResponse.cs_id', index=0,
@@ -94,35 +93,35 @@ _ATTACKRESPONSE = _descriptor.Descriptor(
      has_default_value=False, default_value=None,
      message_type=None, enum_type=None, containing_type=None,
      is_extension=False, extension_scope=None,
      serialized_options=None, file=DESCRIPTOR,  create_key=_descriptor._internal_create_key),
      serialized_options=None, file=DESCRIPTOR),
    _descriptor.FieldDescriptor(
      name='attack_id', full_name='attack_mitigator.AttackResponse.attack_id', index=1,
      number=2, type=5, cpp_type=1, label=1,
      has_default_value=False, default_value=0,
      message_type=None, enum_type=None, containing_type=None,
      is_extension=False, extension_scope=None,
      serialized_options=None, file=DESCRIPTOR,  create_key=_descriptor._internal_create_key),
      serialized_options=None, file=DESCRIPTOR),
    _descriptor.FieldDescriptor(
      name='attack_description', full_name='attack_mitigator.AttackResponse.attack_description', index=2,
      number=3, type=9, cpp_type=9, label=1,
      has_default_value=False, default_value=b"".decode('utf-8'),
      has_default_value=False, default_value=_b("").decode('utf-8'),
      message_type=None, enum_type=None, containing_type=None,
      is_extension=False, extension_scope=None,
      serialized_options=None, file=DESCRIPTOR,  create_key=_descriptor._internal_create_key),
      serialized_options=None, file=DESCRIPTOR),
    _descriptor.FieldDescriptor(
      name='response_strategy_id', full_name='attack_mitigator.AttackResponse.response_strategy_id', index=3,
      number=4, type=5, cpp_type=1, label=1,
      has_default_value=False, default_value=0,
      message_type=None, enum_type=None, containing_type=None,
      is_extension=False, extension_scope=None,
      serialized_options=None, file=DESCRIPTOR,  create_key=_descriptor._internal_create_key),
      serialized_options=None, file=DESCRIPTOR),
    _descriptor.FieldDescriptor(
      name='response_strategy_description', full_name='attack_mitigator.AttackResponse.response_strategy_description', index=4,
      number=5, type=9, cpp_type=9, label=1,
      has_default_value=False, default_value=b"".decode('utf-8'),
      has_default_value=False, default_value=_b("").decode('utf-8'),
      message_type=None, enum_type=None, containing_type=None,
      is_extension=False, extension_scope=None,
      serialized_options=None, file=DESCRIPTOR,  create_key=_descriptor._internal_create_key),
      serialized_options=None, file=DESCRIPTOR),
  ],
  extensions=[
  ],
@@ -167,7 +166,6 @@ _ATTACKMITIGATOR = _descriptor.ServiceDescriptor(
  file=DESCRIPTOR,
  index=0,
  serialized_options=None,
  create_key=_descriptor._internal_create_key,
  serialized_start=342,
  serialized_end=448,
  methods=[
@@ -179,7 +177,6 @@ _ATTACKMITIGATOR = _descriptor.ServiceDescriptor(
    input_type=_ATTACKDESCRIPTION,
    output_type=_ATTACKRESPONSE,
    serialized_options=None,
    create_key=_descriptor._internal_create_key,
  ),
])
_sym_db.RegisterServiceDescriptor(_ATTACKMITIGATOR)
+30 −50
Original line number Diff line number Diff line
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
"""Client and server classes corresponding to protobuf-defined services."""
import grpc

import attack_mitigator_pb2 as attack__mitigator__pb2


class AttackMitigatorStub(object):
    """Missing associated documentation comment in .proto file."""
  # missing associated documentation comment in .proto file
  pass

  def __init__(self, channel):
    """Constructor.
@@ -22,10 +22,12 @@ class AttackMitigatorStub(object):


class AttackMitigatorServicer(object):
    """Missing associated documentation comment in .proto file."""
  # missing associated documentation comment in .proto file
  pass

  def NotifyAttack(self, request, context):
        """Missing associated documentation comment in .proto file."""
    # missing associated documentation comment in .proto file
    pass
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')
@@ -42,25 +44,3 @@ def add_AttackMitigatorServicer_to_server(servicer, server):
  generic_handler = grpc.method_handlers_generic_handler(
      'attack_mitigator.AttackMitigator', rpc_method_handlers)
  server.add_generic_rpc_handlers((generic_handler,))


 # This class is part of an EXPERIMENTAL API.
class AttackMitigator(object):
    """Missing associated documentation comment in .proto file."""

    @staticmethod
    def NotifyAttack(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, '/attack_mitigator.AttackMitigator/NotifyAttack',
            attack__mitigator__pb2.AttackDescription.SerializeToString,
            attack__mitigator__pb2.AttackResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
Loading