Commit cfda9cf8 authored by Javier Velázquez's avatar Javier Velázquez
Browse files

Merge branch 'feat/4-challenge-4-l3vpn-support' of...

Merge branch 'feat/4-challenge-4-l3vpn-support' of https://labs.etsi.org/rep/tfs/nsc into feat/4-challenge-4-l3vpn-support
parents 7f24267c c1b79b5e
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
# Copyright 2025 Telefonica Innovación Digital S.L.
# Copyright 2025 Telefonica Innovación Digital S.L.

# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
+2 −0
Original line number Diff line number Diff line
# Copyright 2025 Telefonica Innovación Digital S.L.
# Copyright 2025 Telefonica Innovación Digital S.L.

# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -18,6 +19,7 @@ import logging, requests, json
from netmiko import ConnectHandler
from src.Constants import DEFAULT_LOGGING_LEVEL
from requests.auth import HTTPBasicAuth
from requests.auth import HTTPBasicAuth

# Configure logging to provide clear and informative log messages
logging.basicConfig(
+19 −0
Original line number Diff line number Diff line
# Copyright 2025 Telefonica Innovación Digital S.L.
# Copyright 2025 Telefonica Innovación Digital S.L.

# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -64,6 +65,9 @@ class NSController:
        self.path = path
        self.path_l3 = path_l3
        #self.json_file = json_file
        self.path = path
        self.path_l3 = path_l3
        #self.json_file = json_file
        self.answer = {}
        self.cool_answer = {}
        self.start_time = 0
@@ -501,6 +505,7 @@ class NSController:
            }
            # Add slice details to the response
            logging.info(self.answer)
            logging.info(self.answer)
            for subnet in self.answer:
                slice_info = {
                    "id": subnet,
@@ -834,7 +839,16 @@ class NSController:
    def __tfs_l2vpn(self, ietf_intent):
       """
       Translate slice intent into a TeraFlow service request.
       """
       Translate slice intent into a TeraFlow service request.

       This method prepares a L2VPN service request by:
       1. Defining endpoint routers
       2. Loading a service template
       3. Generating a unique service UUID
       4. Configuring service endpoints
       5. Adding QoS constraints
       6. Preparing configuration rules for network interfaces
       This method prepares a L2VPN service request by:
       1. Defining endpoint routers
       2. Loading a service template
@@ -843,9 +857,13 @@ class NSController:
       5. Adding QoS constraints
       6. Preparing configuration rules for network interfaces

       Args:
           ietf_intent (dict): IETF-formatted network slice intent.
       Args:
           ietf_intent (dict): IETF-formatted network slice intent.

       Returns:
           dict: A TeraFlow service request for L2VPN configuration.
       Returns:
           dict: A TeraFlow service request for L2VPN configuration.

@@ -854,6 +872,7 @@ class NSController:
        # TODO (should be dynamically determined)
        origin_router_id = ietf_intent["ietf-network-slice-service:network-slice-services"]["slice-service"][0]["sdps"]["sdp"][0]["attachment-circuits"]["attachment-circuit"][0]["sdp-peering"]["peer-sap-id"]
        origin_router_if = 'eth2'
        origin_router_if = 'eth2'
        destination_router_id = ietf_intent["ietf-network-slice-service:network-slice-services"]["slice-service"][0]["sdps"]["sdp"][1]["attachment-circuits"]["attachment-circuit"][0]["sdp-peering"]["peer-sap-id"]
        destination_router_if = '0/0/0-GigabitEthernet0/0/0/0'