Commit 576e319e authored by Manuel Álvarez-Campana's avatar Manuel Álvarez-Campana
Browse files

Device component - P4 Driver

Removed unneeded files
parent 9a0b3039
Loading
Loading
Loading
Loading
+0 −77
Original line number Diff line number Diff line
    "devices": [
	{
            "device_id": {"device_uuid": {"uuid": "p4-sw-tf2"}},
            "device_type": "p4-switch",
            "device_drivers": ["DEVICEDRIVER_P4"],
            "device_operational_status": "DEVICEOPERATIONALSTATUS_DISABLED",
            "name": "p4-sw-tf2",
            "device_config": {
                "config_rules": [
                    {"action": "CONFIGACTION_SET", "custom": {"resource_key": "_connect/address", "resource_value": "10.0.2.68"}},
                    {"action": "CONFIGACTION_SET", "custom": {"resource_key": "_connect/port", "resource_value": "50052"}},
                    {"action": "CONFIGACTION_SET", "custom": {"resource_key": "_connect/settings", "resource_value": {
                        "id": 0,
                        "name": "p4-sw-tf2",
                        "vendor": "Open P4 Studio",
                        "hw_ver": "Open P4 Studio Tofino Model",
                        "sw_ver": "Tofino Model",
                        "timeout": 60,
                        "rt_proto": "bfruntime",
                        "p4path": "/root/p4src",
                        "p4name": "tf2_preof",
                        "endpoints": [
                            {"uuid": "1", "name": "1", "type": "port-dataplane"},
                            {"uuid": "2", "name": "2", "type": "port-dataplane"},
                            {"uuid": "3", "name": "3", "type": "port-int"}
                        ]
                    }}}
                ]
            }
        },
	{
            "device_id": {"device_uuid": {"uuid": "p4-sw-tf3"}},
            "device_type": "p4-switch",
            "device_drivers": ["DEVICEDRIVER_P4"],
            "device_operational_status": "DEVICEOPERATIONALSTATUS_DISABLED",
            "name": "p4-sw-tf3",
            "device_config": {
                "config_rules": [
                    {"action": "CONFIGACTION_SET", "custom": {"resource_key": "_connect/address", "resource_value": "10.0.2.24"}},
                    {"action": "CONFIGACTION_SET", "custom": {"resource_key": "_connect/port", "resource_value": "50052"}},
                    {"action": "CONFIGACTION_SET", "custom": {"resource_key": "_connect/settings", "resource_value": {
                        "id": 0,
                        "name": "p4-sw-tf3",
                        "vendor": "Open P4 Studio",
                        "hw_ver": "Open P4 Studio Tofino Model",
                        "sw_ver": "Tofino Model",
                        "timeout": 60,
                        "rt_proto": "bfruntime",
                        "p4path": "/root/p4src",
                        "p4name": "tf3_preof",
                        "endpoints": [
                            {"uuid": "1", "name": "1", "type": "port-dataplane"},
                            {"uuid": "2", "name": "2", "type": "port-dataplane"},
                            {"uuid": "3", "name": "3", "type": "port-int"}
                        ]
                    }}}
                ]
            }
        }

    ],
    "links": [
	{
            "link_id": {"link_uuid": {"uuid": "p4-sw-tf2/2==p4-sw-tf3/1"}}, "link_type": "LINKTYPE_COPPER", "link_endpoint_ids": [
                {"device_id": {"device_uuid": {"uuid": "p4-sw-tf2"}},           "endpoint_uuid": {"uuid": "2"}},
                {"device_id": {"device_uuid": {"uuid": "p4-sw-tf3"}},           "endpoint_uuid": {"uuid": "1"}}
            ]
        },
        {
            "link_id": {"link_uuid": {"uuid": "p4-sw-tf3/1==p4-sw-tf2/2"}}, "link_type": "LINKTYPE_COPPER", "link_endpoint_ids": [
                {"device_id": {"device_uuid": {"uuid": "p4-sw-tf3"}},           "endpoint_uuid": {"uuid": "1"}},
                {"device_id": {"device_uuid": {"uuid": "p4-sw-tf2"}},           "endpoint_uuid": {"uuid": "2"}}
            ]
        }

    ]
}
+0 −24
Original line number Diff line number Diff line
#! /bin/bash
# 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.

files=`grep -ls match-map ./$1/*` 

echo FILES $files


for f in $files; do
    cp $f $f.bk
    sed -e 's/match-map/match-fields/g' $f.bk > $f
done