Skip to content

Commit

Permalink
Issue sonic-net#30: Support configuration of VPP bootup parameters
Browse files Browse the repository at this point in the history
Updated some files with copyright section as required.

Signed-off-by: Shashidhar Patil <[email protected]>
  • Loading branch information
patilshashidhar committed May 9, 2023
1 parent 589912f commit 194b006
Show file tree
Hide file tree
Showing 18 changed files with 217 additions and 32 deletions.
13 changes: 13 additions & 0 deletions platform/mkrules/files/scripts/vppcfg_load.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# Copyright (c) 2023 Cisco and/or its affiliates.
# 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.

import json
import sys
import os
Expand Down
13 changes: 13 additions & 0 deletions platform/mkrules/src/sonic-vppcfgd/setup.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
# Copyright (c) 2023 Cisco and/or its affiliates.
# 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.

import setuptools

setuptools.setup(
Expand Down
11 changes: 0 additions & 11 deletions platform/mkrules/src/sonic-vppcfgd/vpp.json

This file was deleted.

12 changes: 12 additions & 0 deletions platform/mkrules/src/sonic-vppcfgd/vppcfgd/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Copyright (c) 2023 Cisco and/or its affiliates.
# 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.
15 changes: 14 additions & 1 deletion platform/mkrules/src/sonic-vppcfgd/vppcfgd/__main__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,17 @@
# Copyright (c) 2023 Cisco and/or its affiliates.
# 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.

from .main import main

if __name__ == '__main__':
main()
main()
13 changes: 13 additions & 0 deletions platform/mkrules/src/sonic-vppcfgd/vppcfgd/config.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
# Copyright (c) 2023 Cisco and/or its affiliates.
# 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.

import json
from .vars import g_dev_debug, VPP_CONFIG_JSON_PATH, VPP_CFG_STARTUP_PATH, VPP_BOOTUP_CFG_PATH, INDENT
from .log import dev_debug, log_notice
Expand Down
16 changes: 15 additions & 1 deletion platform/mkrules/src/sonic-vppcfgd/vppcfgd/directory.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# Copyright 2016 Microsoft, Inc.
# Modifications copyright (c) 2023 Cisco and/or its affiliates.
# 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.

from collections import defaultdict

from .log import log_err
Expand Down Expand Up @@ -156,4 +170,4 @@ def subscribe(self, deps, handler):
"""
for db, table, path in deps:
slot = self.get_slot_name(db, table)
self.notify[slot][path].append(handler)
self.notify[slot][path].append(handler)
14 changes: 14 additions & 0 deletions platform/mkrules/src/sonic-vppcfgd/vppcfgd/log.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# Copyright 2016 Microsoft, Inc.
# Modifications copyright (c) 2023 Cisco and/or its affiliates.
# 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.

import syslog

from .vars import g_debug, g_dev_debug
Expand Down
13 changes: 13 additions & 0 deletions platform/mkrules/src/sonic-vppcfgd/vppcfgd/main.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
# Copyright (c) 2023 Cisco and/or its affiliates.
# 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.

import os
import signal
import sys
Expand Down
16 changes: 15 additions & 1 deletion platform/mkrules/src/sonic-vppcfgd/vppcfgd/manager.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# Copyright 2016 Microsoft, Inc.
# Modifications copyright (c) 2023 Cisco and/or its affiliates.
# 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.

from swsscommon import swsscommon

from .log import log_debug, log_err
Expand Down Expand Up @@ -68,4 +82,4 @@ def set_handler(self, key, data):

def del_handler(self, key):
""" Placeholder for 'DEL' command """
log_err("del_handler wasn't implemented for %s" % self.__class__.__name__)
log_err("del_handler wasn't implemented for %s" % self.__class__.__name__)
13 changes: 13 additions & 0 deletions platform/mkrules/src/sonic-vppcfgd/vppcfgd/managers_vppcfg.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
# Copyright (c) 2023 Cisco and/or its affiliates.
# 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.

import traceback
from .log import log_crit, log_err, log_debug, log_notice, dev_debug, g_dev_debug
from .manager import Manager
Expand Down
14 changes: 14 additions & 0 deletions platform/mkrules/src/sonic-vppcfgd/vppcfgd/runner.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# Copyright 2016 Microsoft, Inc.
# Modifications copyright (c) 2023 Cisco and/or its affiliates.
# 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.

from collections import defaultdict
from swsscommon import swsscommon

Expand Down
14 changes: 14 additions & 0 deletions platform/mkrules/src/sonic-vppcfgd/vppcfgd/template.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# Copyright 2016 Microsoft, Inc.
# Modifications copyright (c) 2023 Cisco and/or its affiliates.
# 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.

from collections import OrderedDict
from functools import partial

Expand Down
14 changes: 14 additions & 0 deletions platform/mkrules/src/sonic-vppcfgd/vppcfgd/utils.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# Copyright 2016 Microsoft, Inc.
# Modifications copyright (c) 2023 Cisco and/or its affiliates.
# 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.

import subprocess
import yaml

Expand Down
14 changes: 14 additions & 0 deletions platform/mkrules/src/sonic-vppcfgd/vppcfgd/vars.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# Copyright 2016 Microsoft, Inc.
# Modifications copyright (c) 2023 Cisco and/or its affiliates.
# 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.

g_debug = True # FIXME: read from env variable, or from constants
g_dev_debug = True

Expand Down
18 changes: 0 additions & 18 deletions platform/mkrules/src/sonic-vppcfgd/vppcfgd/vpp.json

This file was deleted.

13 changes: 13 additions & 0 deletions platform/mkrules/src/sonic-vppcfgd/vppcfgd/vpp.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
# Copyright (c) 2023 Cisco and/or its affiliates.
# 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.

import json

class VppMgr(object):
Expand Down
13 changes: 13 additions & 0 deletions platform/vpp/docker-sonic-vpp/scripts/vppcfg_load.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# Copyright (c) 2023 Cisco and/or its affiliates.
# 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.

import json
import sys
import os
Expand Down

0 comments on commit 194b006

Please sign in to comment.