diff --git a/.reuse/dep5 b/.reuse/dep5 new file mode 100644 index 000000000..b61a576de --- /dev/null +++ b/.reuse/dep5 @@ -0,0 +1,39 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: dpservice +Upstream-Contact: IronCore authors +Source: https://github.com/ironcore-dev/dpservice + +# -------------------------------------------------- +# source code + +Files: + .github/* + .gitignore + .editorconfig + CODEOWNERS + Dockerfile + config/* + hack/* + *.json + *meson.build + proto/dpdk.proto + meson_options.txt + include/dp_conf_opts.h + include/dp_version.h.in + src/dp_conf_opts.c + tools/dump/opts.c + tools/dump/opts.h +Copyright: 2023 SAP SE or an SAP affiliate company and IronCore contributors +License: Apache-2.0 + +# -------------------------------------------------- +# documentation + +Files: + docs/* + *README.md +Copyright: 2023 SAP SE or an SAP affiliate company and IronCore contributors +License: Apache-2.0 + +# -------------------------------------------------- +# source dependencies diff --git a/LICENSES/Apache-2.0.txt b/LICENSES/Apache-2.0.txt new file mode 100644 index 000000000..137069b82 --- /dev/null +++ b/LICENSES/Apache-2.0.txt @@ -0,0 +1,73 @@ +Apache License +Version 2.0, January 2004 +http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + +"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. + +"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. + +"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + +"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. + +"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. + +"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. + +"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). + +"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. + +"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." + +"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: + + (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. + + You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + +To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. + +Copyright [yyyy] [name of copyright owner] + +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. diff --git a/README.md b/README.md index c0c8a4341..c8b7ab8a6 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,11 @@ # Dataplane Service - [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com) -[![GitHub License](https://img.shields.io/static/v1?label=License&message=Apache-2.0&color=blue&style=flat-square)](LICENSE) + +[![REUSE status](https://api.reuse.software/badge/github.com/ironcore-dev/dpservce)](https://api.reuse.software/info/github.com/ironcore-dev/dpservice) +[![GitHub License](https://img.shields.io/static/v1?label=License&message=Apache-2.0&color=blue)](LICENSE) +[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://makeapullrequest.com) ## Overview + Dataplane Service in short form dp-service is a L3 virtual router with basic L2 capabilites and with IP in IPv6 tunneling for the uplink traffic. It uses [SRIOV](https://en.wikipedia.org/wiki/Single-root_input/output_virtualization) based Virtual Functions as its virtual ports. A virtual machine or a bare metal machine (In case dp-service running directly on SmartNIC) can be plugged to SRIOV VFs. - It can operate in offloaded and non-offloaded mode. @@ -34,4 +37,3 @@ Please report bugs, suggestions or post question by opening a [Github issue](htt ## License [Apache License 2.0](/LICENSE) - diff --git a/code_check/check.sh b/code_check/check.sh index 033ba1fa5..f2d062e0f 100755 --- a/code_check/check.sh +++ b/code_check/check.sh @@ -1,5 +1,8 @@ #!/bin/bash +# SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +# SPDX-License-Identifier: Apache-2.0 + set -e usage() { @@ -69,4 +72,3 @@ elif [ "${TYPE}" = "fix" ] && [ -n "${FILE}" ]; then else usage fi - diff --git a/hack/dp_conf_generate.py b/hack/dp_conf_generate.py index f652a9784..137ddc8be 100755 --- a/hack/dp_conf_generate.py +++ b/hack/dp_conf_generate.py @@ -1,5 +1,8 @@ #!/usr/bin/env python3 +# SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +# SPDX-License-Identifier: Apache-2.0 + import argparse import json import re diff --git a/hack/prepare.sh b/hack/prepare.sh index 5db4d8eec..4e55d6648 100755 --- a/hack/prepare.sh +++ b/hack/prepare.sh @@ -1,5 +1,8 @@ #!/usr/bin/env bash +# SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +# SPDX-License-Identifier: Apache-2.0 + set -Eeuo pipefail # @@ -45,7 +48,7 @@ function validate_pf() { echo "pf $pf is valid" valid_devs+=( $pf ) done - devs=("${valid_devs[@]}") + devs=("${valid_devs[@]}") } function create_vf() { @@ -55,18 +58,18 @@ function create_vf() { log "disabling automatic binding of VFs on pf: $pf" echo 0 > /sys/bus/pci/devices/$pf/sriov_drivers_autoprobe - # calculating amount of VFs to create, 126 if more are available, or maximum available + # calculating amount of VFs to create, 126 if more are available, or maximum available totalvfs=$(cat /sys/bus/pci/devices/$pf/sriov_totalvfs) actualvfs=$((NUMVFS /sys/bus/pci/devices/$pf/sriov_numvfs # enable switchdev mode, this operation takes most time - log "enabling switchdev for $pf" + log "enabling switchdev for $pf" if ! devlink dev eswitch set pci/$pf mode switchdev; then log "can't set eswitch mode, setting VFs to 0" echo 0 > /sys/bus/pci/devices/$pf/sriov_numvfs - fi + fi log "now waiting for everything to settle" udevadm settle } @@ -98,7 +101,7 @@ function get_ipv6() { } function make_config() { - : > "$CONFIG" + : > "$CONFIG" { echo "# This has been generated by prepare.sh" echo "no-stats"; echo "pf0 $(get_ifname ${devs[0]})"; diff --git a/hack/rel_download.sh b/hack/rel_download.sh index 4a3372d06..8c8d062da 100755 --- a/hack/rel_download.sh +++ b/hack/rel_download.sh @@ -1,4 +1,8 @@ #!/bin/bash + +# SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +# SPDX-License-Identifier: Apache-2.0 + # This script uses a Personal Access Token (PAT) to access a GitHub repository. # It takes the following parameters in the style "-parameter=PARAMETER_VALUE": # 1. -dir : Destination directory. A directory path (relative to the current directory) where the files will be downloaded. diff --git a/hack/set_cap.sh b/hack/set_cap.sh index 7968b67f2..d0168e9bf 100755 --- a/hack/set_cap.sh +++ b/hack/set_cap.sh @@ -1,5 +1,8 @@ #!/bin/sh +# SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +# SPDX-License-Identifier: Apache-2.0 + # NET_ADMIN for setting MAC, etc. # NET_RAW to access NIC ports # SYS_ADMIN for /proc/self/pagemap access diff --git a/include/dp_argparse.h b/include/dp_argparse.h index 02a06aaad..a8e8660bc 100644 --- a/include/dp_argparse.h +++ b/include/dp_argparse.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + #ifndef __DP_ARGPARSE_H__ #define __DP_ARGPARSE_H__ diff --git a/include/dp_cntrack.h b/include/dp_cntrack.h index e8fbfbdf9..e69a431ed 100644 --- a/include/dp_cntrack.h +++ b/include/dp_cntrack.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + #ifndef __INCLUDE_DP_CNTRACK_H__ #define __INCLUDE_DP_CNTRACK_H__ diff --git a/include/dp_conf.h b/include/dp_conf.h index ac9326ef0..5b8d94540 100644 --- a/include/dp_conf.h +++ b/include/dp_conf.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + #ifndef __INCLUDE_DP_CONF_H__ #define __INCLUDE_DP_CONF_H__ diff --git a/include/dp_error.h b/include/dp_error.h index 57fc097d0..1e8ad3cf3 100644 --- a/include/dp_error.h +++ b/include/dp_error.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + #ifndef __INCLUDE_DP_ERROR_H__ #define __INCLUDE_DP_ERROR_H__ diff --git a/include/dp_firewall.h b/include/dp_firewall.h index 74aba5183..b5c098eaf 100644 --- a/include/dp_firewall.h +++ b/include/dp_firewall.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + #ifndef __INCLUDE_DP_FIREWALL_H__ #define __INCLUDE_DP_FIREWALL_H__ diff --git a/include/dp_flow.h b/include/dp_flow.h index accf4216d..f508995a2 100644 --- a/include/dp_flow.h +++ b/include/dp_flow.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + #ifndef __INCLUDE_DP_FLOW_PRIV_H__ #define __INCLUDE_DP_FLOW_PRIV_H__ diff --git a/include/dp_graph.h b/include/dp_graph.h index 0f470a277..e1e9fcf55 100644 --- a/include/dp_graph.h +++ b/include/dp_graph.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + #ifndef _INCLUDE_DP_GRAPH_H_ #define _INCLUDE_DP_GRAPH_H_ diff --git a/include/dp_hairpin.h b/include/dp_hairpin.h index 37a093638..adcbd365e 100644 --- a/include/dp_hairpin.h +++ b/include/dp_hairpin.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + #ifndef _DP_HAIRPIN_H_ #define _DP_HAIRPIN_H_ diff --git a/include/dp_iface.h b/include/dp_iface.h index cf765404d..095150a93 100644 --- a/include/dp_iface.h +++ b/include/dp_iface.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + #ifndef __INCLUDE_DP_IFACE_H__ #define __INCLUDE_DP_IFACE_H__ diff --git a/include/dp_internal_stats.h b/include/dp_internal_stats.h index 87de9fc49..8e77691c7 100644 --- a/include/dp_internal_stats.h +++ b/include/dp_internal_stats.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + #ifndef _DP_INTERNAL_STATS_H_ #define _DP_INTERNAL_STATS_H_ diff --git a/include/dp_lb.h b/include/dp_lb.h index cd27ec31c..883812933 100644 --- a/include/dp_lb.h +++ b/include/dp_lb.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + #ifndef __INCLUDE_DP_LB_H__ #define __INCLUDE_DP_LB_H__ diff --git a/include/dp_log.h b/include/dp_log.h index 0d4f32d57..788406600 100644 --- a/include/dp_log.h +++ b/include/dp_log.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + #ifndef __INCLUDE_DP_LOG_H__ #define __INCLUDE_DP_LOG_H__ diff --git a/include/dp_lpm.h b/include/dp_lpm.h index e2d49f188..e507bfc57 100644 --- a/include/dp_lpm.h +++ b/include/dp_lpm.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + #ifndef __INCLUDE_DP_LPM_PRIV_H__ #define __INCLUDE_DP_LPM_PRIV_H__ diff --git a/include/dp_mbuf_dyn.h b/include/dp_mbuf_dyn.h index 68b5758b5..1a342d562 100644 --- a/include/dp_mbuf_dyn.h +++ b/include/dp_mbuf_dyn.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + #ifndef __INCLUDE_DP_MBUF_DYN_H__ #define __INCLUDE_DP_MBUF_DYN_H__ diff --git a/include/dp_multi_path.h b/include/dp_multi_path.h index 143e02a83..212a1ce5d 100644 --- a/include/dp_multi_path.h +++ b/include/dp_multi_path.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + #ifndef __INCLUDE_DP_MULTI_PATH_H__ #define __INCLUDE_DP_MULTI_PATH_H__ diff --git a/include/dp_nat.h b/include/dp_nat.h index 470a28f0f..0aabea383 100644 --- a/include/dp_nat.h +++ b/include/dp_nat.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + #ifndef __INCLUDE_DP_NAT_H__ #define __INCLUDE_DP_NAT_H__ @@ -118,4 +121,3 @@ void dp_del_all_neigh_nat_entries_in_vni(uint32_t vni); } #endif #endif - diff --git a/include/dp_netlink.h b/include/dp_netlink.h index d22a8cf20..e731be7c0 100644 --- a/include/dp_netlink.h +++ b/include/dp_netlink.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + #ifndef __INCLUDE_DP_NETLINK_H__ #define __INCLUDE_DP_NETLINK_H__ diff --git a/include/dp_periodic_msg.h b/include/dp_periodic_msg.h index 58aa671e3..d6a8b783c 100644 --- a/include/dp_periodic_msg.h +++ b/include/dp_periodic_msg.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + #ifndef __INCLUDE_DP_PERIODIC_MSG_H__ #define __INCLUDE_DP_PERIODIC_MSG_H__ diff --git a/include/dp_port.h b/include/dp_port.h index 8a5ecbc95..8b033ac93 100644 --- a/include/dp_port.h +++ b/include/dp_port.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + #ifndef __DP_PORT_H__ #define __DP_PORT_H__ diff --git a/include/dp_refcount.h b/include/dp_refcount.h index 29a1e8bd9..a1bc9798c 100644 --- a/include/dp_refcount.h +++ b/include/dp_refcount.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + #ifndef _DP_REFCOUNT_H_ #define _DP_REFCOUNT_H_ diff --git a/include/dp_service.h b/include/dp_service.h index cd00fbbf7..49b79fb28 100644 --- a/include/dp_service.h +++ b/include/dp_service.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + #ifndef _DP_SERVICE_H_ #define _DP_SERVICE_H_ diff --git a/include/dp_telemetry.h b/include/dp_telemetry.h index a8d300ff2..2958d2471 100644 --- a/include/dp_telemetry.h +++ b/include/dp_telemetry.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + #ifndef _DP_TELEMETRY_H_ #define _DP_TELEMETRY_H_ diff --git a/include/dp_timers.h b/include/dp_timers.h index ef8d60e36..007357493 100644 --- a/include/dp_timers.h +++ b/include/dp_timers.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + #ifndef _DP_TIMERS_H_ #define _DP_TIMERS_H_ diff --git a/include/dp_util.h b/include/dp_util.h index 7055ff6dd..e71f9fdbf 100644 --- a/include/dp_util.h +++ b/include/dp_util.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + #ifndef __INCLUDE_DP_UTIL_H__ #define __INCLUDE_DP_UTIL_H__ diff --git a/include/dp_virtsvc.h b/include/dp_virtsvc.h index 6714387e3..7c9ffbf9b 100644 --- a/include/dp_virtsvc.h +++ b/include/dp_virtsvc.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + #ifndef __INCLUDE_DP_VIRTSVC_H__ #define __INCLUDE_DP_VIRTSVC_H__ diff --git a/include/dp_vnf.h b/include/dp_vnf.h index 9a2a71a16..22416479e 100644 --- a/include/dp_vnf.h +++ b/include/dp_vnf.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + #ifndef __INCLUDE_DP_VNF_H__ #define __INCLUDE_DP_VNF_H__ diff --git a/include/dp_vni.h b/include/dp_vni.h index 5f39d71e5..62449d5d9 100644 --- a/include/dp_vni.h +++ b/include/dp_vni.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + #ifndef __INCLUDE_DP_VNI_H__ #define __INCLUDE_DP_VNI_H__ diff --git a/include/dpdk_layer.h b/include/dpdk_layer.h index f409cae20..19c3b5242 100644 --- a/include/dpdk_layer.h +++ b/include/dpdk_layer.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + #ifndef _DPDK_LAYER_H_ #define _DPDK_LAYER_H_ diff --git a/include/grpc/dp_async_grpc.h b/include/grpc/dp_async_grpc.h index a05b34cf4..0e677a99f 100644 --- a/include/grpc/dp_async_grpc.h +++ b/include/grpc/dp_async_grpc.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + #ifndef __INCLUDE_DP_ASYNC_GRPC_H__ #define __INCLUDE_DP_ASYNC_GRPC_H__ diff --git a/include/grpc/dp_grpc_api.h b/include/grpc/dp_grpc_api.h index 3e3eb4a81..655c31ce8 100644 --- a/include/grpc/dp_grpc_api.h +++ b/include/grpc/dp_grpc_api.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + #ifndef __DP_GRPC_API_H__ #define __DP_GRPC_API_H__ diff --git a/include/grpc/dp_grpc_conv.h b/include/grpc/dp_grpc_conv.h index b7be18527..e8c371094 100644 --- a/include/grpc/dp_grpc_conv.h +++ b/include/grpc/dp_grpc_conv.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + #ifndef __INCLUDE_DP_GRPC_FWALL_H__ #define __INCLUDE_DP_GRPC_FWALL_H__ diff --git a/include/grpc/dp_grpc_impl.h b/include/grpc/dp_grpc_impl.h index a7f58240b..8b6be4cce 100644 --- a/include/grpc/dp_grpc_impl.h +++ b/include/grpc/dp_grpc_impl.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + #ifndef __INCLUDE_DP_GRPC_IMPL_H__ #define __INCLUDE_DP_GRPC_IMPL_H__ diff --git a/include/grpc/dp_grpc_responder.h b/include/grpc/dp_grpc_responder.h index 922a94cbc..b92cdf99f 100644 --- a/include/grpc/dp_grpc_responder.h +++ b/include/grpc/dp_grpc_responder.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + #ifndef __DP_GRPC_RESPONDER_H__ #define __DP_GRPC_RESPONDER_H__ diff --git a/include/grpc/dp_grpc_service.h b/include/grpc/dp_grpc_service.h index b9e5b34d3..165d4fdc5 100644 --- a/include/grpc/dp_grpc_service.h +++ b/include/grpc/dp_grpc_service.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + #ifndef __INCLUDE_DP_GRPC_SERVICE_H__ #define __INCLUDE_DP_GRPC_SERVICE_H__ @@ -28,7 +31,7 @@ class GRPCService final : public dpdkironcore::v1::DPDKironcore::AsyncService { bool initialized = false; void HandleRpcs(); - + public: GRPCService(const GRPCService& obj) = delete; static GRPCService* GetInstance(); diff --git a/include/grpc/dp_grpc_thread.h b/include/grpc/dp_grpc_thread.h index a5ac835d9..65c53a327 100644 --- a/include/grpc/dp_grpc_thread.h +++ b/include/grpc/dp_grpc_thread.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + #ifndef __INCLUDE_GRPC_THREAD_H__ #define __INCLUDE_GRPC_THREAD_H__ diff --git a/include/monitoring/dp_event.h b/include/monitoring/dp_event.h index 9014612c2..76367b07d 100644 --- a/include/monitoring/dp_event.h +++ b/include/monitoring/dp_event.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + #ifndef __INCLUDE_DP_EVENT_H__ #define __INCLUDE_DP_EVENT_H__ @@ -9,7 +12,7 @@ extern "C" { #include #include -int dp_link_status_change_event_callback(uint16_t port_id, +int dp_link_status_change_event_callback(uint16_t port_id, enum rte_eth_event_type type, void *param, void *ret_param); diff --git a/include/monitoring/dp_graphtrace.h b/include/monitoring/dp_graphtrace.h index d4e62335d..e3d01bd9b 100644 --- a/include/monitoring/dp_graphtrace.h +++ b/include/monitoring/dp_graphtrace.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + #ifndef __INCLUDE_DP_GRAPHTRACE_H__ #define __INCLUDE_DP_GRAPHTRACE_H__ diff --git a/include/monitoring/dp_graphtrace_shared.h b/include/monitoring/dp_graphtrace_shared.h index 6f8d189ac..c54797b6b 100644 --- a/include/monitoring/dp_graphtrace_shared.h +++ b/include/monitoring/dp_graphtrace_shared.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + #ifndef __INCLUDE_DP_GRAPHTRACE_SHARED_H__ #define __INCLUDE_DP_GRAPHTRACE_SHARED_H__ diff --git a/include/monitoring/dp_monitoring.h b/include/monitoring/dp_monitoring.h index c0de06978..dd0393eec 100644 --- a/include/monitoring/dp_monitoring.h +++ b/include/monitoring/dp_monitoring.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + #ifndef __INCLUDE_DP_MONITORING_H__ #define __INCLUDE_DP_MONITORING_H__ diff --git a/include/monitoring/dp_pcap.h b/include/monitoring/dp_pcap.h index 28cce2e14..9a0aa0870 100644 --- a/include/monitoring/dp_pcap.h +++ b/include/monitoring/dp_pcap.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + #ifndef __DP_PCAP_H__ #define __DP_PCAP_H__ diff --git a/include/nodes/arp_node.h b/include/nodes/arp_node.h index 647cd21e6..776689e43 100644 --- a/include/nodes/arp_node.h +++ b/include/nodes/arp_node.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + #ifndef __INCLUDE_ARP_NODE_H__ #define __INCLUDE_ARP_NODE_H__ diff --git a/include/nodes/common_node.h b/include/nodes/common_node.h index aa576b111..37c6c46aa 100644 --- a/include/nodes/common_node.h +++ b/include/nodes/common_node.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + #ifndef __INCLUDE_COMMON_NODE_H__ #define __INCLUDE_COMMON_NODE_H__ diff --git a/include/nodes/dhcp_node.h b/include/nodes/dhcp_node.h index d5dbc215b..bc66eec23 100644 --- a/include/nodes/dhcp_node.h +++ b/include/nodes/dhcp_node.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + #ifndef __INCLUDE_DHCP_NODE_H__ #define __INCLUDE_DHCP_NODE_H__ diff --git a/include/nodes/dhcpv6_node.h b/include/nodes/dhcpv6_node.h index bf5d8f022..21d8cd9ca 100644 --- a/include/nodes/dhcpv6_node.h +++ b/include/nodes/dhcpv6_node.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + #ifndef __INCLUDE_DHCPV6_NODE_H__ #define __INCLUDE_DHCPV6_NODE_H__ diff --git a/include/nodes/firewall_node.h b/include/nodes/firewall_node.h index 287d0740f..5a935ec78 100644 --- a/include/nodes/firewall_node.h +++ b/include/nodes/firewall_node.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + #ifndef __INCLUDE_FIREWALL_NODE_H__ #define __INCLUDE_FIREWALL_NODE_H__ diff --git a/include/nodes/ipip_encap_node.h b/include/nodes/ipip_encap_node.h index e3f0a3d51..c2ee89380 100644 --- a/include/nodes/ipip_encap_node.h +++ b/include/nodes/ipip_encap_node.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + #ifndef __INCLUDE_IPIP_ENCAP_NODE_H__ #define __INCLUDE_IPIP_ENCAP_NODE_H__ diff --git a/include/nodes/ipv6_nd_node.h b/include/nodes/ipv6_nd_node.h index 908796b86..2d45f42bb 100644 --- a/include/nodes/ipv6_nd_node.h +++ b/include/nodes/ipv6_nd_node.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + #ifndef __INCLUDE_IPV6_ND_NODE_H__ #define __INCLUDE_IPV6_ND_NODE_H__ diff --git a/include/nodes/rx_node.h b/include/nodes/rx_node.h index c02a53d7d..8e267a89b 100644 --- a/include/nodes/rx_node.h +++ b/include/nodes/rx_node.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + #ifndef __INCLUDE_RX_NODE_H__ #define __INCLUDE_RX_NODE_H__ diff --git a/include/nodes/rx_periodic_node.h b/include/nodes/rx_periodic_node.h index ed17e3d25..93ae4720d 100644 --- a/include/nodes/rx_periodic_node.h +++ b/include/nodes/rx_periodic_node.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + #ifndef __INCLUDE_RX_PERIODIC_NODE_H__ #define __INCLUDE_RX_PERIODIC_NODE_H__ diff --git a/include/nodes/tx_node.h b/include/nodes/tx_node.h index 9188f6679..9fe0d3b00 100644 --- a/include/nodes/tx_node.h +++ b/include/nodes/tx_node.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + #ifndef __INCLUDE_TX_NODE_H__ #define __INCLUDE_TX_NODE_H__ diff --git a/include/nodes/virtsvc_node.h b/include/nodes/virtsvc_node.h index 4fb75938d..75cf2545c 100644 --- a/include/nodes/virtsvc_node.h +++ b/include/nodes/virtsvc_node.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + #ifndef __INCLUDE_VIRTSVC_NODE_H__ #define __INCLUDE_VIRTSVC_NODE_H__ diff --git a/include/protocols/dp_dhcpv6.h b/include/protocols/dp_dhcpv6.h index 3f3679930..e8bbb26cc 100644 --- a/include/protocols/dp_dhcpv6.h +++ b/include/protocols/dp_dhcpv6.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + #ifndef __INCLUDE_DP_DHCPV6_H__ #define __INCLUDE_DP_DHCPV6_H__ diff --git a/include/rte_flow/dp_rte_flow.h b/include/rte_flow/dp_rte_flow.h index 87516f90f..507ae9c50 100644 --- a/include/rte_flow/dp_rte_flow.h +++ b/include/rte_flow/dp_rte_flow.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + #ifndef __INCLUDE_DP_RTE_FLOW_H__ #define __INCLUDE_DP_RTE_FLOW_H__ diff --git a/include/rte_flow/dp_rte_flow_capture.h b/include/rte_flow/dp_rte_flow_capture.h index 8d7b45893..b0c207d48 100644 --- a/include/rte_flow/dp_rte_flow_capture.h +++ b/include/rte_flow/dp_rte_flow_capture.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + #ifndef __INCLUDE_DP_RTE_FLOW_CAPTURE_H__ #define __INCLUDE_DP_RTE_FLOW_CAPTURE_H__ diff --git a/include/rte_flow/dp_rte_flow_helpers.h b/include/rte_flow/dp_rte_flow_helpers.h index 0790d991d..aa2333020 100644 --- a/include/rte_flow/dp_rte_flow_helpers.h +++ b/include/rte_flow/dp_rte_flow_helpers.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + #ifndef __INCLUDE_DP_RTE_FLOW_HELPERS_H__ #define __INCLUDE_DP_RTE_FLOW_HELPERS_H__ diff --git a/include/rte_flow/dp_rte_flow_init.h b/include/rte_flow/dp_rte_flow_init.h index b02386726..cbed32de8 100644 --- a/include/rte_flow/dp_rte_flow_init.h +++ b/include/rte_flow/dp_rte_flow_init.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + #ifndef __INCLUDE_DP_RTE_FLOW_INIT_H__ #define __INCLUDE_DP_RTE_FLOW_INIT_H__ diff --git a/include/rte_flow/dp_rte_flow_traffic_forward.h b/include/rte_flow/dp_rte_flow_traffic_forward.h index 94f4250ee..db305c6c8 100644 --- a/include/rte_flow/dp_rte_flow_traffic_forward.h +++ b/include/rte_flow/dp_rte_flow_traffic_forward.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + #ifndef __INCLUDE_DP_RTE_FLOW_TRAFFIC_FORWARD_H__ #define __INCLUDE_DP_RTE_FLOW_TRAFFIC_FORWARD_H__ diff --git a/src/dp_argparse.c b/src/dp_argparse.c index 69f5a6858..df42ce2f7 100644 --- a/src/dp_argparse.c +++ b/src/dp_argparse.c @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + #include "dp_argparse.h" #include #include diff --git a/src/dp_cntrack.c b/src/dp_cntrack.c index dd27afd8d..c22c3e978 100644 --- a/src/dp_cntrack.c +++ b/src/dp_cntrack.c @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + #include "dp_cntrack.h" #include "dp_conf.h" #include "dp_error.h" diff --git a/src/dp_conf.c b/src/dp_conf.c index 6838d29a3..2003d4b0c 100644 --- a/src/dp_conf.c +++ b/src/dp_conf.c @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + #include "dp_conf.h" #include diff --git a/src/dp_error.c b/src/dp_error.c index e5c56de5b..8669defa0 100644 --- a/src/dp_error.c +++ b/src/dp_error.c @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + #ifdef DEBUG // enable GNU extension strerrorname_np() # ifndef _GNU_SOURCE diff --git a/src/dp_firewall.c b/src/dp_firewall.c index c76ce9065..7eed452bf 100644 --- a/src/dp_firewall.c +++ b/src/dp_firewall.c @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + #include "dp_firewall.h" #include #include diff --git a/src/dp_flow.c b/src/dp_flow.c index 73ba0bcab..faada7eca 100644 --- a/src/dp_flow.c +++ b/src/dp_flow.c @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + #include "dp_flow.h" #include @@ -508,4 +511,3 @@ int dp_del_rte_age_ctx(struct flow_value *cntrack, const struct flow_age_ctx *ct cntrack->rte_age_ctxs[ctx->ref_index_in_cntrack] = NULL; return DP_OK; } - diff --git a/src/dp_graph.c b/src/dp_graph.c index 703cd3dc5..0af56663f 100644 --- a/src/dp_graph.c +++ b/src/dp_graph.c @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + #include "dp_graph.h" #include #include "dp_conf.h" diff --git a/src/dp_hairpin.c b/src/dp_hairpin.c index 8c24bd4e3..6b430a120 100644 --- a/src/dp_hairpin.c +++ b/src/dp_hairpin.c @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + #include "dp_hairpin.h" #include #include "dp_error.h" diff --git a/src/dp_iface.c b/src/dp_iface.c index 4c2ea51af..0b6dc87fe 100644 --- a/src/dp_iface.c +++ b/src/dp_iface.c @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + #include "dp_iface.h" #include "dp_vni.h" diff --git a/src/dp_internal_stats.c b/src/dp_internal_stats.c index d957a2855..8becb4b21 100644 --- a/src/dp_internal_stats.c +++ b/src/dp_internal_stats.c @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + #include "dp_internal_stats.h" #include diff --git a/src/dp_lb.c b/src/dp_lb.c index e37458d40..22334aefb 100644 --- a/src/dp_lb.c +++ b/src/dp_lb.c @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + #include "dp_lb.h" #include #include @@ -237,8 +240,8 @@ uint8_t *dp_lb_get_backend_ip(uint32_t ol_ip, uint32_t vni, rte_be16_t port, uin return NULL; /* TODO This is just temporary. Round robin. - This doesn't distribute the load evenly. - Use maglev hashing and 5 Tuple fkey for + This doesn't distribute the load evenly. + Use maglev hashing and 5 Tuple fkey for backend selection */ lb_port.port = port; lb_port.protocol = proto; diff --git a/src/dp_log.c b/src/dp_log.c index 687ab3d24..3aa0a520a 100644 --- a/src/dp_log.c +++ b/src/dp_log.c @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + #include "dp_log.h" #include diff --git a/src/dp_lpm.c b/src/dp_lpm.c index 24733c4f5..8fafc123d 100644 --- a/src/dp_lpm.c +++ b/src/dp_lpm.c @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + #include "dp_lpm.h" #include #include "dp_conf.h" diff --git a/src/dp_mbuf_dyn.c b/src/dp_mbuf_dyn.c index 9c8e397cf..7048846cf 100644 --- a/src/dp_mbuf_dyn.c +++ b/src/dp_mbuf_dyn.c @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + #include "dp_mbuf_dyn.h" rte_atomic32_t dp_pkt_id_counter = {0}; diff --git a/src/dp_multi_path.c b/src/dp_multi_path.c index 0f6a87de3..ad45f1237 100644 --- a/src/dp_multi_path.c +++ b/src/dp_multi_path.c @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + #include "dp_multi_path.h" #include diff --git a/src/dp_nat.c b/src/dp_nat.c index d1f16ab1c..027706ea8 100644 --- a/src/dp_nat.c +++ b/src/dp_nat.c @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + #include "dp_nat.h" #include #include diff --git a/src/dp_netlink.c b/src/dp_netlink.c index 3a819c5ea..0685cf417 100644 --- a/src/dp_netlink.c +++ b/src/dp_netlink.c @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + #include #include #include @@ -64,7 +67,7 @@ static int dp_recv_msg(struct sockaddr_nl sock_addr, int sock, char *buf, int bu } int dp_get_pf_neigh_mac(int if_idx, struct rte_ether_addr *neigh, const struct rte_ether_addr *own_mac) -{ +{ struct sockaddr_nl sa = { .nl_family = AF_NETLINK, .nl_groups = RTMGRP_NEIGH, diff --git a/src/dp_periodic_msg.c b/src/dp_periodic_msg.c index 8291b7de5..72ad4b1fd 100644 --- a/src/dp_periodic_msg.c +++ b/src/dp_periodic_msg.c @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + #include #include "dp_error.h" #include "dp_log.h" @@ -48,7 +51,7 @@ void send_to_all_vfs(const struct rte_mbuf *pkt, uint16_t eth_type) dp_init_pkt_mark(clone_buf); df = dp_init_flow_ptr(clone_buf); df->l3_type = eth_type; - + ret = rte_ring_sp_enqueue(dp_layer->periodic_msg_queue, clone_buf); if (DP_FAILED(ret)) { DPS_LOG_WARNING("Cannot enqueue message to a VM", DP_LOG_PORTID(clone_buf->port), DP_LOG_RET(ret)); @@ -121,7 +124,7 @@ void trigger_nd_unsol_adv(void) rte_memcpy(ipv6_hdr->src_addr, rt_ip, sizeof(ipv6_hdr->src_addr)); rte_memcpy(ipv6_hdr->dst_addr, dp_mc_ipv6, sizeof(ipv6_hdr->dst_addr)); ipv6_hdr->payload_len = htons(sizeof(struct icmp6hdr) + sizeof(struct in6_addr)); - + icmp6_hdr = &(ns_msg->icmph); memset(icmp6_hdr, 0, sizeof(struct icmp6hdr)); icmp6_hdr->icmp6_type = NDISC_NEIGHBOUR_ADVERTISEMENT; @@ -131,7 +134,7 @@ void trigger_nd_unsol_adv(void) icmp6_hdr->icmp6_hop_limit = 255; rte_memcpy(&ns_msg->target, rt_ip, sizeof(ns_msg->target)); - pkt_size = sizeof(struct rte_ether_hdr) + sizeof(struct rte_ipv6_hdr) + + pkt_size = sizeof(struct rte_ether_hdr) + sizeof(struct rte_ipv6_hdr) + sizeof(struct icmp6hdr) + sizeof(struct in6_addr); pkt->data_len = pkt_size; pkt->pkt_len = pkt_size; diff --git a/src/dp_port.c b/src/dp_port.c index c9453fd0c..a865cd541 100644 --- a/src/dp_port.c +++ b/src/dp_port.c @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + #include "dp_error.h" #include #include "dp_conf.h" diff --git a/src/dp_service.c b/src/dp_service.c index 83c45817d..561693a79 100644 --- a/src/dp_service.c +++ b/src/dp_service.c @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + #include #include #include diff --git a/src/dp_telemetry.c b/src/dp_telemetry.c index 1011da612..52ad9638b 100644 --- a/src/dp_telemetry.c +++ b/src/dp_telemetry.c @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + #include "dp_telemetry.h" #include diff --git a/src/dp_timers.c b/src/dp_timers.c index 9725b5d9c..989a33f58 100644 --- a/src/dp_timers.c +++ b/src/dp_timers.c @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + #include #include #include diff --git a/src/dp_util.c b/src/dp_util.c index 743641098..27ae82802 100644 --- a/src/dp_util.c +++ b/src/dp_util.c @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + #include "dp_util.h" #include diff --git a/src/dp_virtsvc.c b/src/dp_virtsvc.c index 8105a8ab2..99b667f34 100644 --- a/src/dp_virtsvc.c +++ b/src/dp_virtsvc.c @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + #include "dp_virtsvc.h" #include diff --git a/src/dp_vnf.c b/src/dp_vnf.c index 6cd3f7c55..8bee0ee49 100644 --- a/src/dp_vnf.c +++ b/src/dp_vnf.c @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + #include "dp_vnf.h" #include #include "dp_error.h" diff --git a/src/dp_vni.c b/src/dp_vni.c index 87b528af4..2fd81cc3c 100644 --- a/src/dp_vni.c +++ b/src/dp_vni.c @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + #include "dp_vni.h" #include #include "dp_error.h" diff --git a/src/dpdk_layer.c b/src/dpdk_layer.c index 42d1cce37..d919f23a1 100644 --- a/src/dpdk_layer.c +++ b/src/dpdk_layer.c @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + #include "dpdk_layer.h" #include #include "dp_error.h" diff --git a/src/grpc/dp_async_grpc.cpp b/src/grpc/dp_async_grpc.cpp index e4db8504c..b8e95d0c4 100644 --- a/src/grpc/dp_async_grpc.cpp +++ b/src/grpc/dp_async_grpc.cpp @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + #include "grpc/dp_async_grpc.h" #include #include @@ -1201,4 +1204,3 @@ void CaptureStatusCall::ParseReply(struct dpgrpc_reply* reply) reply_.set_allocated_capture_config(capture_config); } } - diff --git a/src/grpc/dp_grpc_conv.cpp b/src/grpc/dp_grpc_conv.cpp index d7f36cda8..e3d4a1670 100644 --- a/src/grpc/dp_grpc_conv.cpp +++ b/src/grpc/dp_grpc_conv.cpp @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + #include "grpc/dp_grpc_conv.h" #include "dp_error.h" #include "dp_log.h" diff --git a/src/grpc/dp_grpc_impl.c b/src/grpc/dp_grpc_impl.c index 9c05539c8..d394e96e8 100644 --- a/src/grpc/dp_grpc_impl.c +++ b/src/grpc/dp_grpc_impl.c @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + #include "grpc/dp_grpc_impl.h" #include #include "dp_conf.h" diff --git a/src/grpc/dp_grpc_responder.c b/src/grpc/dp_grpc_responder.c index 3cd083b37..607262e17 100644 --- a/src/grpc/dp_grpc_responder.c +++ b/src/grpc/dp_grpc_responder.c @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + #include "grpc/dp_grpc_responder.h" #include "dp_log.h" diff --git a/src/grpc/dp_grpc_service.cpp b/src/grpc/dp_grpc_service.cpp index bba37a624..d0e7e3cc5 100644 --- a/src/grpc/dp_grpc_service.cpp +++ b/src/grpc/dp_grpc_service.cpp @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + #include "grpc/dp_grpc_service.h" #include "grpc/dp_async_grpc.h" #include "dp_lpm.h" @@ -128,4 +131,3 @@ void GRPCService::HandleRpcs() DPGRPC_LOG_ERR("gRPC internal error (cannot read next message)"); rte_exit(EXIT_FAILURE, "gRPC service aborted\n"); } - diff --git a/src/grpc/dp_grpc_thread.cpp b/src/grpc/dp_grpc_thread.cpp index 90a9824a1..46620a5ec 100644 --- a/src/grpc/dp_grpc_thread.cpp +++ b/src/grpc/dp_grpc_thread.cpp @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + #include "grpc/dp_grpc_thread.h" #include #include diff --git a/src/monitoring/dp_event.c b/src/monitoring/dp_event.c index 802d5e2aa..5956425ee 100644 --- a/src/monitoring/dp_event.c +++ b/src/monitoring/dp_event.c @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + #include "monitoring/dp_event.h" #include "dp_conf.h" #include "dp_error.h" diff --git a/src/monitoring/dp_graphtrace.c b/src/monitoring/dp_graphtrace.c index 4a070ae5c..f21fc48ee 100644 --- a/src/monitoring/dp_graphtrace.c +++ b/src/monitoring/dp_graphtrace.c @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + #include "monitoring/dp_graphtrace.h" #include diff --git a/src/monitoring/dp_graphtrace_shared.c b/src/monitoring/dp_graphtrace_shared.c index 184a4360f..267ab3a7f 100644 --- a/src/monitoring/dp_graphtrace_shared.c +++ b/src/monitoring/dp_graphtrace_shared.c @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + #include "monitoring/dp_graphtrace_shared.h" #include "dp_util.h" diff --git a/src/monitoring/dp_monitoring.c b/src/monitoring/dp_monitoring.c index 24a61c0c6..ea80b74bd 100644 --- a/src/monitoring/dp_monitoring.c +++ b/src/monitoring/dp_monitoring.c @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + #include "monitoring/dp_monitoring.h" #include "dp_log.h" #include "monitoring/dp_event.h" diff --git a/src/monitoring/dp_pcap.c b/src/monitoring/dp_pcap.c index fdf42c3ce..1c85d8977 100644 --- a/src/monitoring/dp_pcap.c +++ b/src/monitoring/dp_pcap.c @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + #include "monitoring/dp_pcap.h" #include #include diff --git a/src/nodes/arp_node.c b/src/nodes/arp_node.c index f990449de..d2720b701 100644 --- a/src/nodes/arp_node.c +++ b/src/nodes/arp_node.c @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + #include "nodes/arp_node.h" #include #include diff --git a/src/nodes/cls_node.c b/src/nodes/cls_node.c index 931aa2a0c..c5935c160 100644 --- a/src/nodes/cls_node.c +++ b/src/nodes/cls_node.c @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + #include #include #include @@ -50,7 +53,7 @@ static __rte_always_inline int is_arp(const struct rte_ether_hdr *ether_hdr) && arp_hdr->arp_protocol == htons(RTE_ETHER_TYPE_IPV4) && arp_hdr->arp_plen == 4 ; -} +} static __rte_always_inline int is_ipv6_nd(const struct rte_ipv6_hdr *ipv6_hdr) { diff --git a/src/nodes/common_node.c b/src/nodes/common_node.c index 2d87463f8..fa9a8bd22 100644 --- a/src/nodes/common_node.c +++ b/src/nodes/common_node.c @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + #include "nodes/common_node.h" #include "dp_error.h" #include "dp_log.h" diff --git a/src/nodes/conntrack_node.c b/src/nodes/conntrack_node.c index af95df6a1..7bf9fe9ae 100644 --- a/src/nodes/conntrack_node.c +++ b/src/nodes/conntrack_node.c @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + #include #include #include diff --git a/src/nodes/dhcp_node.c b/src/nodes/dhcp_node.c index b8f3df1be..0f400adaf 100644 --- a/src/nodes/dhcp_node.c +++ b/src/nodes/dhcp_node.c @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + #define _GNU_SOURCE #include // need memmem() diff --git a/src/nodes/dhcpv6_node.c b/src/nodes/dhcpv6_node.c index 7124871f4..a42510ba2 100644 --- a/src/nodes/dhcpv6_node.c +++ b/src/nodes/dhcpv6_node.c @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + #include "nodes/dhcpv6_node.h" #include #include @@ -190,7 +193,7 @@ static int generate_reply_options(struct rte_mbuf *m, uint8_t *options, int opti static __rte_always_inline rte_edge_t get_next_index(struct rte_node *node, struct rte_mbuf *m) { struct rte_ether_hdr *req_eth_hdr; - struct rte_ipv6_hdr *req_ipv6_hdr; + struct rte_ipv6_hdr *req_ipv6_hdr; struct rte_udp_hdr *req_udp_hdr; struct dhcpv6_packet *dhcp_pkt; int req_options_len = rte_pktmbuf_data_len(m) - (int)DP_DHCPV6_PKT_FIXED_LEN; diff --git a/src/nodes/dnat_node.c b/src/nodes/dnat_node.c index 9a29e9594..cfd55c880 100644 --- a/src/nodes/dnat_node.c +++ b/src/nodes/dnat_node.c @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + #include #include #include @@ -41,7 +44,7 @@ static __rte_always_inline rte_edge_t get_next_index(__rte_unused struct rte_nod // extrack identifier field from icmp reply pkt, which is a reply to VM's icmp request if (df->l4_type == DP_IP_PROTO_ICMP && df->l4_info.icmp_field.icmp_type == RTE_IP_ICMP_ECHO_REPLY) df->l4_info.trans_port.dst_port = df->l4_info.icmp_field.icmp_identifier; - + // it is icmp request targeting scalable nat if (df->l4_type == DP_IP_PROTO_ICMP && df->l4_info.icmp_field.icmp_type == RTE_IP_ICMP_ECHO_REQUEST) { cntrack->nf_info.nat_type = DP_FLOW_NAT_AS_TARGET; @@ -59,9 +62,9 @@ static __rte_always_inline rte_edge_t get_next_index(__rte_unused struct rte_nod dp_delete_flow(&cntrack->flow_key[DP_FLOW_DIR_REPLY]); // no reverse traffic for relaying pkts return DNAT_NEXT_PACKET_RELAY; } - - // if it is not a nat pkt destinated for its neighboring nat, - // then it is a premature dnat pkt for network nat (sent before any outgoing traffic from VM, + + // if it is not a nat pkt destinated for its neighboring nat, + // then it is a premature dnat pkt for network nat (sent before any outgoing traffic from VM, // and it cannot be a standalone new incoming flow for network NAT), // silently drop it now. return DNAT_NEXT_DROP; diff --git a/src/nodes/drop_node.c b/src/nodes/drop_node.c index a597f4b4f..ef7c7dd19 100644 --- a/src/nodes/drop_node.c +++ b/src/nodes/drop_node.c @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + #include #include #include "nodes/common_node.h" diff --git a/src/nodes/firewall_node.c b/src/nodes/firewall_node.c index dacffc540..9a8a5c92d 100644 --- a/src/nodes/firewall_node.c +++ b/src/nodes/firewall_node.c @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + #include "nodes/firewall_node.h" #include #include diff --git a/src/nodes/ipip_decap_node.c b/src/nodes/ipip_decap_node.c index c2366e52b..3b9587d1c 100644 --- a/src/nodes/ipip_decap_node.c +++ b/src/nodes/ipip_decap_node.c @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + #include #include #include diff --git a/src/nodes/ipip_encap_node.c b/src/nodes/ipip_encap_node.c index 8cc410367..c5cbbf9d6 100644 --- a/src/nodes/ipip_encap_node.c +++ b/src/nodes/ipip_encap_node.c @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + #include "nodes/ipip_encap_node.h" #include #include diff --git a/src/nodes/ipv4_lookup_node.c b/src/nodes/ipv4_lookup_node.c index 9a0683a1e..7df6dcbda 100644 --- a/src/nodes/ipv4_lookup_node.c +++ b/src/nodes/ipv4_lookup_node.c @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + #include #include #include diff --git a/src/nodes/ipv6_lookup_node.c b/src/nodes/ipv6_lookup_node.c index 975d23572..e1c25b77f 100644 --- a/src/nodes/ipv6_lookup_node.c +++ b/src/nodes/ipv6_lookup_node.c @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + #include #include #include diff --git a/src/nodes/ipv6_nd_node.c b/src/nodes/ipv6_nd_node.c index 9389d8103..856876e8d 100644 --- a/src/nodes/ipv6_nd_node.c +++ b/src/nodes/ipv6_nd_node.c @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + #include "nodes/ipv6_nd_node.h" #include #include @@ -73,7 +76,7 @@ static __rte_always_inline rte_edge_t get_next_index(__rte_unused struct rte_nod req_icmp6_hdr->icmp6_cksum = rte_ipv6_udptcp_cksum(req_ipv6_hdr,req_icmp6_hdr); return next_tx_index[m->port]; -} +} static uint16_t ipv6_nd_node_process(struct rte_graph *graph, struct rte_node *node, diff --git a/src/nodes/lb_node.c b/src/nodes/lb_node.c index 3eb3da08d..457578ede 100644 --- a/src/nodes/lb_node.c +++ b/src/nodes/lb_node.c @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + #include #include #include diff --git a/src/nodes/packet_relay_node.c b/src/nodes/packet_relay_node.c index 277ac4f9f..f7328ec59 100644 --- a/src/nodes/packet_relay_node.c +++ b/src/nodes/packet_relay_node.c @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + #include #include #include diff --git a/src/nodes/rx_node.c b/src/nodes/rx_node.c index 041ee0f1f..7ebfa7195 100644 --- a/src/nodes/rx_node.c +++ b/src/nodes/rx_node.c @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + #include "nodes/rx_node.h" #include #include diff --git a/src/nodes/rx_periodic_node.c b/src/nodes/rx_periodic_node.c index aa53d3068..a1a90c08e 100644 --- a/src/nodes/rx_periodic_node.c +++ b/src/nodes/rx_periodic_node.c @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + #include "nodes/rx_periodic_node.h" #include #include diff --git a/src/nodes/snat_node.c b/src/nodes/snat_node.c index 8858291a1..c68a7ea13 100644 --- a/src/nodes/snat_node.c +++ b/src/nodes/snat_node.c @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + #include #include #include diff --git a/src/nodes/tx_node.c b/src/nodes/tx_node.c index 05b38beb5..8e9419ee6 100644 --- a/src/nodes/tx_node.c +++ b/src/nodes/tx_node.c @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + #include "nodes/tx_node.h" #include #include diff --git a/src/nodes/virtsvc_node.c b/src/nodes/virtsvc_node.c index b1ea84b5f..086ec551b 100644 --- a/src/nodes/virtsvc_node.c +++ b/src/nodes/virtsvc_node.c @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + #include "nodes/virtsvc_node.h" #include #include diff --git a/src/rte_flow/dp_rte_flow.c b/src/rte_flow/dp_rte_flow.c index aea494ceb..43e04b0a5 100644 --- a/src/rte_flow/dp_rte_flow.c +++ b/src/rte_flow/dp_rte_flow.c @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + #include "rte_flow/dp_rte_flow.h" #include "dp_error.h" #include "dp_flow.h" diff --git a/src/rte_flow/dp_rte_flow_capture.c b/src/rte_flow/dp_rte_flow_capture.c index 4215d3858..11755ede3 100644 --- a/src/rte_flow/dp_rte_flow_capture.c +++ b/src/rte_flow/dp_rte_flow_capture.c @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + #include "rte_flow/dp_rte_flow_capture.h" #include "dp_error.h" diff --git a/src/rte_flow/dp_rte_flow_init.c b/src/rte_flow/dp_rte_flow_init.c index 2a239f1df..2c1d063ee 100644 --- a/src/rte_flow/dp_rte_flow_init.c +++ b/src/rte_flow/dp_rte_flow_init.c @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + #include "rte_flow/dp_rte_flow_init.h" #include "dp_error.h" diff --git a/src/rte_flow/dp_rte_flow_traffic_forward.c b/src/rte_flow/dp_rte_flow_traffic_forward.c index e6aef8335..f650d51f3 100644 --- a/src/rte_flow/dp_rte_flow_traffic_forward.c +++ b/src/rte_flow/dp_rte_flow_traffic_forward.c @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + #include "rte_flow/dp_rte_flow_traffic_forward.h" #include "dp_conf.h" #include "dp_error.h" diff --git a/test/config.py b/test/config.py index 814852898..d1053d83b 100644 --- a/test/config.py +++ b/test/config.py @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +# SPDX-License-Identifier: Apache-2.0 + # Address range convention for better trace/dump readablity # (see docs/testing/pytest_schema.drawio.png for overview) # diff --git a/test/conftest.py b/test/conftest.py index 1b76e5427..84c4f4649 100644 --- a/test/conftest.py +++ b/test/conftest.py @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +# SPDX-License-Identifier: Apache-2.0 + import pytest import os diff --git a/test/dp_grpc_client.py b/test/dp_grpc_client.py index c50df12a4..dce9e28f2 100644 --- a/test/dp_grpc_client.py +++ b/test/dp_grpc_client.py @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +# SPDX-License-Identifier: Apache-2.0 + import shlex import socket import subprocess diff --git a/test/dp_service.py b/test/dp_service.py index 2e835ddc1..2a644d3dc 100755 --- a/test/dp_service.py +++ b/test/dp_service.py @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +# SPDX-License-Identifier: Apache-2.0 + #!/usr/bin/env python3 import os diff --git a/test/gdbinit b/test/gdbinit index e59e6a36d..12732a4bb 100644 --- a/test/gdbinit +++ b/test/gdbinit @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +# SPDX-License-Identifier: Apache-2.0 + # TUN/TAP use signals in their implementation handle SIG35 nostop noprint pass diff --git a/test/grpc_client.py b/test/grpc_client.py index 05e07dd3a..8cb9e0dc9 100644 --- a/test/grpc_client.py +++ b/test/grpc_client.py @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +# SPDX-License-Identifier: Apache-2.0 + import json import os import pytest diff --git a/test/helpers.py b/test/helpers.py index 11e1546a0..04de26839 100644 --- a/test/helpers.py +++ b/test/helpers.py @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +# SPDX-License-Identifier: Apache-2.0 + import shlex import time diff --git a/test/runtest.py b/test/runtest.py index 916a656d5..a1dac2798 100755 --- a/test/runtest.py +++ b/test/runtest.py @@ -1,5 +1,8 @@ #!/usr/bin/env python3 +# SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +# SPDX-License-Identifier: Apache-2.0 + import argparse import os import random diff --git a/test/tcp_tester.py b/test/tcp_tester.py index b739ce207..b41420d9d 100644 --- a/test/tcp_tester.py +++ b/test/tcp_tester.py @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +# SPDX-License-Identifier: Apache-2.0 + from config import * from helpers import * diff --git a/test/test_arp.py b/test/test_arp.py index afec24a4d..28ae0a68c 100644 --- a/test/test_arp.py +++ b/test/test_arp.py @@ -1,5 +1,7 @@ -from helpers import * +# SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +# SPDX-License-Identifier: Apache-2.0 +from helpers import * def test_l2_arp(prepare_ifaces): arp_packet = (Ether(dst="ff:ff:ff:ff:ff:ff") / diff --git a/test/test_dhcpv4.py b/test/test_dhcpv4.py index 9c210ea92..49b58bad7 100644 --- a/test/test_dhcpv4.py +++ b/test/test_dhcpv4.py @@ -1,5 +1,7 @@ -from helpers import * +# SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +# SPDX-License-Identifier: Apache-2.0 +from helpers import * def test_dhcpv4_vf0(prepare_ifaces): request_ip(VM1) diff --git a/test/test_dhcpv6.py b/test/test_dhcpv6.py index b7ed8dfc4..1a0dd4196 100644 --- a/test/test_dhcpv6.py +++ b/test/test_dhcpv6.py @@ -1,8 +1,9 @@ -from helpers import * +# SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +# SPDX-License-Identifier: Apache-2.0 +from helpers import * def test_dhcpv6(prepare_ifaces): - DUID = DUID_LL(lladdr=VM1.mac) IAID = 0x18702501 diff --git a/test/test_encap.py b/test/test_encap.py index 5a2768ee9..55a996cbc 100644 --- a/test/test_encap.py +++ b/test/test_encap.py @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +# SPDX-License-Identifier: Apache-2.0 + import pytest import shlex import subprocess @@ -5,7 +8,6 @@ from helpers import * - def ipv4_in_ipv6_icmp_responder(pf_name, vm_ipv6): pkt = sniff_packet(pf_name, is_encaped_icmp_pkt) assert pkt[IPv6].dst == neigh_vni1_ul_ipv6, \ diff --git a/test/test_flows.py b/test/test_flows.py index 0e9409293..5f2ae4b40 100644 --- a/test/test_flows.py +++ b/test/test_flows.py @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +# SPDX-License-Identifier: Apache-2.0 + import pytest import threading import time diff --git a/test/test_ipv6_nd.py b/test/test_ipv6_nd.py index fcbc6c4c8..849e7b054 100644 --- a/test/test_ipv6_nd.py +++ b/test/test_ipv6_nd.py @@ -1,5 +1,7 @@ -from helpers import * +# SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +# SPDX-License-Identifier: Apache-2.0 +from helpers import * def test_nd(prepare_ifaces): answer = neighsol(gateway_ipv6, VM1.ipv6, iface=VM1.tap, timeout=sniff_timeout) diff --git a/test/test_lb.py b/test/test_lb.py index a1c358a85..30b2e0970 100644 --- a/test/test_lb.py +++ b/test/test_lb.py @@ -1,8 +1,10 @@ +# SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +# SPDX-License-Identifier: Apache-2.0 + import pytest from helpers import * - def test_network_lb_external_icmp_echo(prepare_ipv4, grpc_client): lb_ul_ipv6 = grpc_client.createlb(lb_name, vni1, lb_ip, "tcp/80") @@ -18,7 +20,6 @@ def test_network_lb_external_icmp_echo(prepare_ipv4, grpc_client): grpc_client.dellb(lb_name) - def router_loopback(dst_ipv6, check_ipv4_src, check_ipv4_dst): pkt = sniff_packet(PF0.tap, is_tcp_pkt) assert pkt[IP].dst == check_ipv4_dst, \ @@ -98,7 +99,6 @@ def test_vip_nat_to_lb_on_another_vni(prepare_ipv4, grpc_client, port_redundancy # NOTE: this test, just like in test_pf_to_vf.py # cannot be run twice in a row, since the flows need to age-out - def test_nat_to_lb_nat(request, prepare_ipv4, grpc_client, port_redundancy): if port_redundancy: @@ -137,7 +137,6 @@ def test_external_lb_relay(prepare_ipv4, grpc_client): lb_ul_ipv6 = grpc_client.createlb(lb_name, vni1, lb_ip, "tcp/80") grpc_client.addlbtarget(lb_name, neigh_ul_ipv6) - threading.Thread(target=send_bounce_pkt_to_pf, args=(lb_ul_ipv6,)).start() pkt = sniff_packet(PF0.tap, is_tcp_pkt, skip=1) @@ -145,7 +144,6 @@ def test_external_lb_relay(prepare_ipv4, grpc_client): assert dst_ip == neigh_ul_ipv6, \ f"Wrong network-lb relayed packet (outer dst ipv6: {dst_ip})" - grpc_client.dellbtarget(lb_name, neigh_ul_ipv6) grpc_client.dellb(lb_name) @@ -172,6 +170,5 @@ def test_external_lb_icmp_error_relay(prepare_ipv4, grpc_client): assert dst_ip == neigh_ul_ipv6, \ f"Wrong network-lb relayed icmp packet (outer dst ipv6: {dst_ip})" - grpc_client.dellbtarget(lb_name, neigh_ul_ipv6) - grpc_client.dellb(lb_name) \ No newline at end of file + grpc_client.dellb(lb_name) diff --git a/test/test_nat.py b/test/test_nat.py index ac38b7afb..e2724cd0d 100644 --- a/test/test_nat.py +++ b/test/test_nat.py @@ -1,9 +1,11 @@ +# SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +# SPDX-License-Identifier: Apache-2.0 + import pytest import threading from helpers import * - def test_network_nat_external_icmp_echo(prepare_ipv4, grpc_client): nat_ul_ipv6 = grpc_client.addnat(VM1.name, nat_vip, nat_local_min_port, nat_local_max_port) icmp_pkt = (Ether(dst=ipv6_multicast_mac, src=PF0.mac, type=0x86DD) / @@ -16,7 +18,6 @@ def test_network_nat_external_icmp_echo(prepare_ipv4, grpc_client): "No ECHO reply" grpc_client.delnat(VM1.name) - def send_bounce_pkt_to_pf(ipv6_nat): bouce_pkt = (Ether(dst=ipv6_multicast_mac, src=PF0.mac, type=0x86DD) / IPv6(dst=ipv6_nat, src=router_ul_ipv6, nh=4) / @@ -25,7 +26,6 @@ def send_bounce_pkt_to_pf(ipv6_nat): delayed_sendp(bouce_pkt, PF0.tap) def test_network_nat_pkt_relay(prepare_ifaces, grpc_client): - nat_ul_ipv6 = grpc_client.addnat(VM1.name, nat_vip, nat_local_min_port, nat_local_max_port) grpc_client.addneighnat(nat_vip, vni1, nat_neigh_min_port, nat_neigh_max_port, neigh_vni1_ul_ipv6) # Add another neighbor and remove it to check if that does not break the other entry @@ -76,7 +76,6 @@ def send_foreign_ip_nat_pkt_to_pf(ipv6_nat): delayed_sendp(bouce_pkt, PF0.tap) def test_network_nat_foreign_ip(prepare_ifaces, grpc_client): - nat_ul_ipv6 = grpc_client.addnat(VM1.name, nat_vip, nat_local_min_port, nat_local_max_port) threading.Thread(target=send_foreign_ip_nat_pkt_to_pf, args=(nat_ul_ipv6,)).start() @@ -121,7 +120,6 @@ def router_nat_vip(dst_ipv6, check_ipv4): delayed_sendp(reply_pkt, PF0.tap) def test_network_nat_to_vip_on_another_vni(prepare_ipv4, grpc_client, port_redundancy): - if port_redundancy: pytest.skip("Port redundancy is not supported for NAT(vni1) <-> VIP(vni2) test") diff --git a/test/test_pf_to_vf.py b/test/test_pf_to_vf.py index d6494a467..007531455 100644 --- a/test/test_pf_to_vf.py +++ b/test/test_pf_to_vf.py @@ -1,8 +1,10 @@ +# SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +# SPDX-License-Identifier: Apache-2.0 + import threading from helpers import * - def send_lb_pkt_to_pf(lb_ul_ipv6): lb_pkt = (Ether(dst=ipv6_multicast_mac, src=PF0.mac, type=0x86DD) / IPv6(dst=lb_ul_ipv6, src=router_ul_ipv6, nh=4) / @@ -11,7 +13,6 @@ def send_lb_pkt_to_pf(lb_ul_ipv6): delayed_sendp(lb_pkt, PF0.tap) def test_pf_to_vf_lb_tcp(prepare_ifaces, grpc_client): - lb_ul_ipv6 = grpc_client.createlb(lb_name, vni1, lb_ip, "tcp/80") lbpfx_ul_ipv6 = grpc_client.addlbprefix(VM1.name, lb_ip) grpc_client.addlbtarget(lb_name, lbpfx_ul_ipv6) diff --git a/test/test_telemetry.py b/test/test_telemetry.py index 2630322cc..7ccc39484 100644 --- a/test/test_telemetry.py +++ b/test/test_telemetry.py @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +# SPDX-License-Identifier: Apache-2.0 + import json import pytest from helpers import * @@ -19,7 +22,6 @@ def get_telemetry(request): client.close() return response - def check_tel_graph(key): tel = get_telemetry(f"/dp_service/graph/{key}") assert tel is not None, \ @@ -35,7 +37,6 @@ def test_telemetry_graph(prepare_ifaces): check_tel_graph("cycle_count") check_tel_graph("realloc_count") - def test_telemetry_nat(prepare_ifaces): tel = get_telemetry("/dp_service/nat/used_port_count") assert tel is not None, \ @@ -43,7 +44,6 @@ def test_telemetry_nat(prepare_ifaces): assert VM1.name in tel and VM2.name in tel and VM3.name in tel, \ "Running VMs not present in NAT telemetry" - def test_telemetry_virtsvc(request, prepare_ifaces): if not request.config.getoption("--virtsvc"): pytest.skip("Virtual services not enabled") diff --git a/test/test_vf_to_pf.py b/test/test_vf_to_pf.py index 221e87ce2..a95aea932 100644 --- a/test/test_vf_to_pf.py +++ b/test/test_vf_to_pf.py @@ -1,11 +1,12 @@ +# SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +# SPDX-License-Identifier: Apache-2.0 + import pytest import threading from helpers import * - def reply_icmp_pkt_from_vm1(nat_ul_ipv6): - pkt = sniff_packet(PF0.tap, is_icmp_pkt) src_ip = pkt[IP].src assert src_ip == nat_vip, \ @@ -18,7 +19,6 @@ def reply_icmp_pkt_from_vm1(nat_ul_ipv6): delayed_sendp(reply_pkt, PF0.tap) def test_vf_to_pf_network_nat_icmp(prepare_ipv4, grpc_client): - nat_ul_ipv6 = grpc_client.addnat(VM1.name, nat_vip, nat_local_min_port, nat_local_max_port) threading.Thread(target=reply_icmp_pkt_from_vm1, args=(nat_ul_ipv6,)).start() @@ -37,7 +37,6 @@ def test_vf_to_pf_network_nat_icmp(prepare_ipv4, grpc_client): def reply_tcp_if_port_not(forbidden_port, nat_ul_ipv6): - pkt = sniff_packet(PF0.tap, is_tcp_pkt) src_ip = pkt[IP].src sport = pkt[TCP].sport @@ -61,7 +60,6 @@ def reply_tcp_pkt_from_vm1_max_port(nat_ul_ipv6): reply_tcp_if_port_not(sport, nat_ul_ipv6) def send_tcp_through_port(port): - tcp_pkt = (Ether(dst=PF0.mac, src=VM1.mac, type=0x0800) / IP(dst=public_ip, src=VM1.ip) / TCP(sport=port)) @@ -133,7 +131,6 @@ def reply_with_icmp_err_fragment_needed(pf_name, nat_ul_ipv6): delayed_sendp(reply_pkt, pf_name) def request_icmperr(dport, pf_name, nat_ul_ipv6): - threading.Thread(target=reply_with_icmp_err_fragment_needed, args=(pf_name, nat_ul_ipv6)).start(); tcp_pkt = (Ether(dst=ipv6_multicast_mac, src=VM1.mac, type=0x0800) / diff --git a/test/test_vf_to_vf.py b/test/test_vf_to_vf.py index 8071f5508..a24415c31 100644 --- a/test/test_vf_to_vf.py +++ b/test/test_vf_to_vf.py @@ -1,9 +1,11 @@ +# SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +# SPDX-License-Identifier: Apache-2.0 + import threading import pytest from helpers import * - def vf_to_vf_tcp_responder(vf_tap): pkt = sniff_packet(vf_tap, is_tcp_pkt) reply_pkt = (Ether(dst=pkt[Ether].src, src=pkt[Ether].dst, type=0x0800) / @@ -11,9 +13,7 @@ def vf_to_vf_tcp_responder(vf_tap): TCP(sport=pkt[TCP].dport, dport=pkt[TCP].sport)) delayed_sendp(reply_pkt, vf_tap) - def test_vf_to_vf_tcp(prepare_ipv4, grpc_client): - threading.Thread(target=vf_to_vf_tcp_responder, args=(VM2.tap,)).start() grpc_client.addfwallrule(VM2.name, "fw0-vm2", proto="tcp", dst_port_min=1234, dst_port_max=1234) @@ -27,7 +27,6 @@ def test_vf_to_vf_tcp(prepare_ipv4, grpc_client): def test_vf_to_vf_vip_dnat(prepare_ipv4, grpc_client): - threading.Thread(target=vf_to_vf_tcp_responder, args=(VM2.tap,)).start() grpc_client.addvip(VM2.name, vip_vip) diff --git a/test/test_virtsvc.py b/test/test_virtsvc.py index 8c312a6b4..dd539cf12 100644 --- a/test/test_virtsvc.py +++ b/test/test_virtsvc.py @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +# SPDX-License-Identifier: Apache-2.0 + import threading import pytest @@ -7,7 +10,6 @@ udp_used_port = 0 def reply_udp(pf_name): - global udp_used_port pkt = sniff_packet(pf_name, is_udp_pkt) @@ -26,7 +28,6 @@ def reply_udp(pf_name): delayed_sendp(reply_pkt, pf_name) def request_udp(l4_port, pf_name): - threading.Thread(target=reply_udp, args=(pf_name,)).start() udp_pkt = (Ether(dst=PF0.mac, src=VM1.mac, type=0x0800) / diff --git a/test/test_vni.py b/test/test_vni.py index 14fb63f4b..250816bcf 100644 --- a/test/test_vni.py +++ b/test/test_vni.py @@ -1,5 +1,7 @@ -from helpers import * +# SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +# SPDX-License-Identifier: Apache-2.0 +from helpers import * def test_vni_existence(prepare_ipv4, grpc_client): lb_ul_ipv6 = grpc_client.createlb(lb_name, vni3, lb_ip, "tcp/80") @@ -69,4 +71,3 @@ def test_vni_neighnats(prepare_ipv4, grpc_client): VM2.ul_ipv6 = grpc_client.addinterface(VM2.name, VM2.pci, VM2.vni, VM2.ip, VM2.ipv6) grpc_client.dellb(lb_name) - diff --git a/test/test_zzz_grpc.py b/test/test_zzz_grpc.py index 8aa8c4045..f0dfe4f23 100644 --- a/test/test_zzz_grpc.py +++ b/test/test_zzz_grpc.py @@ -1,5 +1,7 @@ -from helpers import * +# SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +# SPDX-License-Identifier: Apache-2.0 +from helpers import * def test_grpc_addinterface_already_exists(prepare_ifaces, grpc_client): # Try to add using an existing vm identifier diff --git a/test/xtratest_flow_timeout.py b/test/xtratest_flow_timeout.py index 9011d1088..fa569731e 100644 --- a/test/xtratest_flow_timeout.py +++ b/test/xtratest_flow_timeout.py @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +# SPDX-License-Identifier: Apache-2.0 + import pytest from config import * @@ -19,7 +22,6 @@ def tcp_server_nat_pkt_check(pkt): "Failed to use NAT's only single port" def test_cntrack_nat_timeout_tcp(request, prepare_ipv4, grpc_client, fast_flow_timeout): - if not fast_flow_timeout: pytest.skip("Fast flow timeout needs to be enabled") @@ -42,7 +44,6 @@ def test_cntrack_nat_timeout_tcp(request, prepare_ipv4, grpc_client, fast_flow_t grpc_client.delnat(VM1.name) - def tcp_server_virtsvc_pkt_check(pkt): assert pkt[IPv6].dst == virtsvc_tcp_svc_ipv6, \ "Request to wrong service IPv6 address" @@ -111,7 +112,6 @@ def sniff_lb_pkt(dst_ipv6): f"Wrong network-lb relayed packet (outer dst ipv6: {dst_ip})" def test_external_lb_relay_timeout(prepare_ipv4, grpc_client, fast_flow_timeout): - if not fast_flow_timeout: pytest.skip("Fast flow timeout needs to be enabled") diff --git a/tools/dp_grpc_client.cpp b/tools/dp_grpc_client.cpp index 67329d99a..608227878 100644 --- a/tools/dp_grpc_client.cpp +++ b/tools/dp_grpc_client.cpp @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + #include #include #include diff --git a/tools/dump/main.c b/tools/dump/main.c index d58032ab5..496e0a973 100644 --- a/tools/dump/main.c +++ b/tools/dump/main.c @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + #include #include #include