-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1402 from atsign-foundation/c-sshnpd-permit-open
feat: permit-open
- Loading branch information
Showing
14 changed files
with
748 additions
and
140 deletions.
There are no files selected for viewing
This file contains 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,24 @@ | ||
name: C Unit Tests | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: [trunk] | ||
pull_request: | ||
branches: [trunk] | ||
|
||
permissions: # added using https://github.com/step-security/secure-repo | ||
contents: read | ||
|
||
jobs: | ||
unit-tests: | ||
runs-on: "ubuntu-latest" | ||
steps: | ||
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 | ||
|
||
- name: sshnpd Unit CTest | ||
working-directory: packages/c | ||
run: | | ||
cmake -S . -B build -DSSHNPD_BUILD_TESTS=ON | ||
cmake --build build | ||
ctest --test-dir build/sshnpd/tests --output-on-failure --timeout 2 |
This file contains 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 |
---|---|---|
|
@@ -5,3 +5,4 @@ compile_commands.json | |
|
||
core | ||
valgrind-out.txt* | ||
Testing/ |
This file contains 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 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 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,25 @@ | ||
#ifndef SSHNPD_PERMITOPEN_H | ||
#define SSHNPD_PERMITOPEN_H | ||
#include <atlogger/atlogger.h> | ||
#include <stdbool.h> | ||
#include <stddef.h> | ||
#include <stdint.h> | ||
|
||
// atlogger won't be available during the initial parsing of the parameters | ||
// (since we are waiting for the verbose flag to be set) | ||
int parse_permitopen(char *input, char ***permitopen_hosts, uint16_t **permitopen_ports, size_t *permitopen_len, | ||
bool is_logger_available); | ||
|
||
struct _permitopen_params { | ||
char *requested_host; | ||
uint16_t requested_port; | ||
|
||
char **permitopen_hosts; | ||
uint16_t *permitopen_ports; | ||
size_t permitopen_len; | ||
}; | ||
|
||
typedef struct _permitopen_params permitopen_params; | ||
|
||
bool should_permitopen(struct _permitopen_params *params); | ||
#endif |
This file contains 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 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
Oops, something went wrong.