-
Notifications
You must be signed in to change notification settings - Fork 3
Add nat20cli command line tool for nat20device. #104
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
werwurm
wants to merge
6
commits into
werwurm/linux_example_integration_test
Choose a base branch
from
werwurm/linux_example_nat20cli
base: werwurm/linux_example_integration_test
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
2a5a8b6
Reapply "Add nat20cli command line tool for nat20device."
werwurm 4e5acf5
polishing clitest
werwurm 9ddc860
Merge branch 'werwurm/linux_example_integration_test' into werwurm/li…
werwurm b34c143
Merge branch 'werwurm/linux_example_integration_test' into werwurm/li…
werwurm babb4d9
Apply suggestions from code review
werwurm bca940f
Merge branch 'werwurm/linux_example_integration_test' into werwurm/li…
werwurm File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| # Copyright 2026 Aurora Operations, Inc. | ||
| # | ||
| # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0 | ||
| # | ||
| # This work is dual licensed. | ||
| # You may use it under Apache-2.0 or GPL-2.0 at your option. | ||
| # | ||
| # 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. | ||
| # | ||
| # OR | ||
| # | ||
| # This program is free software; you can redistribute it and/or | ||
| # modify it under the terms of the GNU General Public License | ||
| # as published by the Free Software Foundation; either version 2 | ||
| # of the License, or (at your option) any later version. | ||
| # | ||
| # This program is distributed in the hope that it will be useful, | ||
| # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| # GNU General Public License for more details. | ||
| # | ||
| # You should have received a copy of the GNU General Public License | ||
| # along with this program; if not, see | ||
| # <https://www.gnu.org/licenses/>. | ||
|
|
||
| config BR2_PACKAGE_NAT20CLI | ||
| bool "nat20cli" | ||
| depends on BR2_PACKAGE_LIBNAT20 | ||
| select BR2_PACKAGE_NAT20SW | ||
| help | ||
| Enable building the nat20cli tool. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| # Copyright 2026 Aurora Operations, Inc. | ||
| # | ||
| # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0 | ||
| # | ||
| # This work is dual licensed. | ||
| # You may use it under Apache-2.0 or GPL-2.0 at your option. | ||
| # | ||
| # 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. | ||
| # | ||
| # OR | ||
| # | ||
| # This program is free software; you can redistribute it and/or | ||
| # modify it under the terms of the GNU General Public License | ||
| # as published by the Free Software Foundation; either version 2 | ||
| # of the License, or (at your option) any later version. | ||
| # | ||
| # This program is distributed in the hope that it will be useful, | ||
| # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| # GNU General Public License for more details. | ||
| # | ||
| # You should have received a copy of the GNU General Public License | ||
| # along with this program; if not, see | ||
| # <https://www.gnu.org/licenses/>. | ||
|
|
||
| # In CI NAT20CLI_OVERRIDE_SRCDIR is set to the root of the repository, | ||
| # so that the source under test is always the current branch. | ||
| # Integrators who use this configuration should pin the version | ||
| # to a specific commit or branch to avoid breakages when the main branch changes. | ||
| NAT20CLI_VERSION = origin/main | ||
| NAT20CLI_SITE = https://github.com/aurora-opensource/libnat20.git | ||
| NAT20CLI_SITE_METHOD = git | ||
| NAT20CLI_LICENSE = Apache-2.0 OR GPL-2.0 | ||
| NAT20CLI_LICENSE_FILES = LICENSE-Apache-2.0.txt LICENSE-GPL-2.0.txt | ||
|
|
||
| NAT20CLI_SUBDIR = examples/linux/nat20cli | ||
|
|
||
| NAT20CLI_INSTALL_TARGET = YES | ||
| NAT20CLI_DEPENDENCIES += libnat20 | ||
|
|
||
| $(eval $(cmake-package)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,83 @@ | ||
| # Copyright 2026 Aurora Operations, Inc. | ||
| # | ||
| # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0 | ||
| # | ||
| # This work is dual licensed. | ||
| # You may use it under Apache-2.0 or GPL-2.0 at your option. | ||
| # | ||
| # 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. | ||
| # | ||
| # OR | ||
| # | ||
| # This program is free software; you can redistribute it and/or | ||
| # modify it under the terms of the GNU General Public License | ||
| # as published by the Free Software Foundation; either version 2 | ||
| # of the License, or (at your option) any later version. | ||
| # | ||
| # This program is distributed in the hope that it will be useful, | ||
| # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| # GNU General Public License for more details. | ||
| # | ||
| # You should have received a copy of the GNU General Public License | ||
| # along with this program; if not, see | ||
| # <https://www.gnu.org/licenses/>. | ||
|
|
||
| cmake_minimum_required(VERSION 3.22) | ||
|
|
||
| project(NAT20CLI VERSION 0.0.1 LANGUAGES C) | ||
|
|
||
| # The C standard shall be C11. | ||
| set(CMAKE_C_STANDARD 11) | ||
|
|
||
| # CMake shall generate a compile_commands.json file for | ||
| # the benefit of clangd based IDE support. | ||
| set(CMAKE_EXPORT_COMPILE_COMMANDS ON) | ||
|
|
||
| ################################################################################################### | ||
| # The following section defines all the groups of source files. | ||
| # All files must be specified explicitly; no globbing or other generation is allowed. | ||
|
|
||
| set(NAT20CLI_SOURCES | ||
| # Add the core library source files here. | ||
| src/main.c | ||
| ) | ||
|
|
||
| ################################################################################################### | ||
|
|
||
| ################################################################################################### | ||
| # The nat20_service library is also part of the product of this project. | ||
| # It will always be compiled. | ||
| add_executable(nat20cli) | ||
|
|
||
| find_package(LibNat20 REQUIRED) | ||
|
|
||
| target_sources(nat20cli | ||
| PRIVATE ${NAT20CLI_SOURCES} | ||
| ) | ||
|
|
||
| target_link_libraries(nat20cli PRIVATE LibNat20::nat20 LibNat20::nat20_service LibNat20::nat20_crypto_nat20) | ||
|
|
||
| target_compile_options(nat20cli | ||
| PRIVATE -pedantic | ||
| PRIVATE -Wall | ||
| PRIVATE -Wextra | ||
| PRIVATE -Werror | ||
| ) | ||
|
|
||
| install(TARGETS nat20cli RUNTIME DESTINATION bin) | ||
| install(PROGRAMS nat20cli_test.sh DESTINATION bin) | ||
| install(PROGRAMS nat20cli_qemu_init.sh DESTINATION bin) | ||
| install(FILES openssl_dice.cnf DESTINATION bin) | ||
|
|
||
| ################################################################################################### |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,60 @@ | ||
| #!/bin/sh | ||
|
|
||
| # Copyright 2026 Aurora Operations, Inc. | ||
| # | ||
| # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0 | ||
| # | ||
| # This work is dual licensed. | ||
| # You may use it under Apache-2.0 or GPL-2.0 at your option. | ||
| # | ||
| # 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. | ||
| # | ||
| # OR | ||
| # | ||
| # This program is free software; you can redistribute it and/or | ||
| # modify it under the terms of the GNU General Public License | ||
| # as published by the Free Software Foundation; either version 2 | ||
| # of the License, or (at your option) any later version. | ||
| # | ||
| # This program is distributed in the hope that it will be useful, | ||
| # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| # GNU General Public License for more details. | ||
| # | ||
| # You should have received a copy of the GNU General Public License | ||
| # along with this program; if not, see | ||
| # <https://www.gnu.org/licenses/>. | ||
|
|
||
| # Init wrapper for running nat20cli_test.sh in a QEMU VM. | ||
| # This script is intended to be used as the init process (PID 1). | ||
| # It mounts the necessary filesystems, runs the nat20cli test suite, | ||
| # prints a machine-parseable result marker, and powers off the VM. | ||
|
|
||
| export PATH="/usr/bin:/bin:/sbin:/usr/sbin" | ||
|
|
||
| mount -t proc none /proc | ||
| mount -t sysfs none /sys | ||
| mount -t tmpfs none /tmp | ||
|
|
||
| cd /tmp | ||
|
|
||
| nat20cli_test.sh | ||
| rc=$? | ||
|
|
||
| if [ $rc -eq 0 ]; then | ||
| echo "NAT20CLI_TESTS_PASSED" | ||
| else | ||
| echo "NAT20CLI_TESTS_FAILED (exit code: $rc)" | ||
| fi | ||
|
|
||
| poweroff -f |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.