-
Notifications
You must be signed in to change notification settings - Fork 39
WIP: Use "D-Bus over TCP/IP over Ethernet over BLE" for communicating with the watch #216
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
Draft
I-asked
wants to merge
10
commits into
AsteroidOS:master
Choose a base branch
from
I-asked:libslirp
base: master
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.
Draft
Changes from 1 commit
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
f2ebab8
Add SlirpService for Ethernet over BLE
I-asked 97694fe
Use D-Bus over TCP for bi-directional notification handling
I-asked 07ced7b
Use modern dbus-java fork, add experimental D-Bus MediaService
I-asked b779742
Fix some dbus-java-related issues
I-asked b92560c
Replace bound properties with manual property handling
I-asked e2983d7
Simplify MPRIS property access
I-asked 96afc2f
Make synchronization more efficient
I-asked 9a74b3f
Use device volume instead of content volume in MediaService
I-asked dbe7b93
Reconnect D-Bus upon connection loss
I-asked 92f7812
Separate the D-Bus infrastructure from SlirpService
I-asked 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
|
||
# For more information about using CMake with Android Studio, read the | ||
# documentation: https://d.android.com/studio/projects/add-native-code.html. | ||
# For more examples on how to use CMake, see https://github.com/android/ndk-samples. | ||
|
||
# Sets the minimum CMake version required for this project. | ||
cmake_minimum_required(VERSION 3.22.1) | ||
|
||
# Declares the project name. The project name can be accessed via ${ PROJECT_NAME}, | ||
# Since this is the top level CMakeLists.txt, the project name is also accessible | ||
# with ${CMAKE_PROJECT_NAME} (both CMake variables are in-sync within the top level | ||
# build script scope). | ||
project("sync") | ||
|
||
add_subdirectory(libslirp) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's ship libslirp as a git submodule so we don't have to copy paste files across repositories and we benefit from libslirp's commit log etc... |
||
|
||
# Creates and names a library, sets it as either STATIC | ||
# or SHARED, and provides the relative paths to its source code. | ||
# You can define multiple libraries, and CMake builds them for you. | ||
# Gradle automatically packages shared libraries with your APK. | ||
# | ||
# In this top level CMakeLists.txt, ${CMAKE_PROJECT_NAME} is used to define | ||
# the target library name; in the sub-module's CMakeLists.txt, ${PROJECT_NAME} | ||
# is preferred for the same purpose. | ||
# | ||
# In order to load a library into your app from Java/Kotlin, you must call | ||
# System.loadLibrary() and pass the name of the library defined here; | ||
# for GameActivity/NativeActivity derived applications, the same library name must be | ||
# used in the AndroidManifest.xml file. | ||
add_library(${CMAKE_PROJECT_NAME} SHARED | ||
# List C/C++ source files with relative paths to this CMakeLists.txt. | ||
sync.cpp) | ||
|
||
# Specifies libraries CMake should link to your target library. You | ||
# can link libraries from various origins, such as libraries defined in this | ||
# build script, prebuilt third-party libraries, or Android system libraries. | ||
target_link_libraries(${CMAKE_PROJECT_NAME} | ||
slirp | ||
android | ||
log) | ||
|
||
target_compile_options(${CMAKE_PROJECT_NAME} PRIVATE | ||
-fvisibility=hidden) |
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,58 @@ | ||
# https://clang.llvm.org/docs/ClangFormat.html | ||
# https://clang.llvm.org/docs/ClangFormatStyleOptions.html | ||
--- | ||
Language: Cpp | ||
AlignAfterOpenBracket: Align | ||
AlignConsecutiveAssignments: false # although we like it, it creates churn | ||
AlignConsecutiveDeclarations: false | ||
AlignEscapedNewlinesLeft: true | ||
AlignOperands: true | ||
AlignTrailingComments: false # churn | ||
AllowAllParametersOfDeclarationOnNextLine: true | ||
AllowShortBlocksOnASingleLine: false | ||
AllowShortCaseLabelsOnASingleLine: false | ||
AllowShortFunctionsOnASingleLine: None | ||
AllowShortIfStatementsOnASingleLine: false | ||
AllowShortLoopsOnASingleLine: false | ||
AlwaysBreakAfterReturnType: None # AlwaysBreakAfterDefinitionReturnType is taken into account | ||
AlwaysBreakBeforeMultilineStrings: false | ||
BinPackArguments: true | ||
BinPackParameters: true | ||
BraceWrapping: | ||
AfterControlStatement: false | ||
AfterEnum: false | ||
AfterFunction: true | ||
AfterStruct: false | ||
AfterUnion: false | ||
BeforeElse: false | ||
IndentBraces: false | ||
BreakBeforeBinaryOperators: None | ||
BreakBeforeBraces: Custom | ||
BreakBeforeTernaryOperators: false | ||
BreakStringLiterals: true | ||
ColumnLimit: 80 | ||
ContinuationIndentWidth: 4 | ||
Cpp11BracedListStyle: false | ||
DerivePointerAlignment: false | ||
DisableFormat: false | ||
IndentCaseLabels: false | ||
IndentWidth: 4 | ||
IndentWrappedFunctionNames: false | ||
KeepEmptyLinesAtTheStartOfBlocks: false | ||
MacroBlockBegin: '.*_BEGIN$' # only PREC_BEGIN ? | ||
MacroBlockEnd: '.*_END$' | ||
MaxEmptyLinesToKeep: 2 | ||
PointerAlignment: Right | ||
ReflowComments: true | ||
SortIncludes: false | ||
SpaceAfterCStyleCast: false | ||
SpaceBeforeAssignmentOperators: true | ||
SpaceBeforeParens: ControlStatements | ||
SpaceInEmptyParentheses: false | ||
SpacesBeforeTrailingComments: 1 | ||
SpacesInContainerLiterals: true | ||
SpacesInParentheses: false | ||
SpacesInSquareBrackets: false | ||
Standard: Auto | ||
UseTab: Never | ||
... |
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,11 @@ | ||
*.[aod] | ||
*.gcda | ||
*.gcno | ||
*.gcov | ||
*.lib | ||
*.obj | ||
/build/ | ||
/TAGS | ||
/cscope* | ||
/src/libslirp-version.h | ||
/tags |
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,110 @@ | ||
image: fedora:latest | ||
|
||
variables: | ||
DEPS: meson ninja-build | ||
gcc libasan liblsan libubsan pkg-config glib2-devel | ||
mingw64-gcc mingw64-pkg-config mingw64-glib2 | ||
clang-analyzer git-core | ||
|
||
before_script: | ||
- dnf install -y $DEPS | ||
- git fetch --tags https://gitlab.freedesktop.org/slirp/libslirp.git | ||
- git describe | ||
|
||
build: | ||
script: | ||
- meson --werror build || (cat build/meson-logs/meson-log.txt && exit 1) | ||
- ninja -C build | ||
- (cd build && meson test) || (cat build/meson-logs/testlog.txt && exit 1) | ||
- ninja -C build scan-build | ||
|
||
build-asan: | ||
script: | ||
- CFLAGS=-fsanitize=address meson --werror build || (cat build/meson-logs/meson-log.txt && exit 1) | ||
- ninja -C build | ||
- (cd build && ASAN_OPTIONS=detect_leaks=0 meson test) || (cat build/meson-logs/testlog.txt && exit 1) | ||
|
||
build-lsan: | ||
script: | ||
- CFLAGS=-fsanitize=leak meson --werror build || (cat build/meson-logs/meson-log.txt && exit 1) | ||
- ninja -C build | ||
- (cd build && meson test) || (cat build/meson-logs/testlog.txt && exit 1) | ||
|
||
build-usan: | ||
script: | ||
- CFLAGS=-fsanitize=undefined meson --werror build || (cat build/meson-logs/meson-log.txt && exit 1) | ||
- ninja -C build | ||
- (cd build && meson test) || (cat build/meson-logs/testlog.txt && exit 1) | ||
|
||
fuzz: | ||
parallel: | ||
matrix: | ||
- TARGET: [arp, ip-header, udp, udp-h, tftp, dhcp, icmp, tcp, tcp-h, ndp, ip6-header, udp6, udp6-h, tftp6, icmp6, tcp6, tcp6-h] | ||
script: | ||
- CC=clang CXX=clang++ meson build -Dllvm-fuzz=true || (cat build/meson-logs/meson-log.txt && exit 1) | ||
- ninja -C build | ||
- build/fuzzing/fuzz-$TARGET -seed=1234 -runs=1000000 fuzzing/IN_$TARGET | ||
artifacts: | ||
when: on_failure | ||
paths: | ||
- crash-* | ||
- leak-* | ||
- oom-* | ||
- timeout-* | ||
|
||
build-mingw64: | ||
script: | ||
- (mkdir buildw && cd buildw && mingw64-meson --werror) || (cat buildw/meson-logs/meson-log.txt && exit 1) | ||
- ninja -C buildw | ||
|
||
Coverity: | ||
only: | ||
refs: | ||
- master | ||
- coverity | ||
script: | ||
- dnf update -y | ||
- dnf install -y curl clang | ||
- curl -o /tmp/cov-analysis-linux64.tgz https://scan.coverity.com/download/linux64 | ||
--form project=$COVERITY_SCAN_PROJECT_NAME --form token=$COVERITY_SCAN_TOKEN | ||
- tar xfz /tmp/cov-analysis-linux64.tgz | ||
- CC=clang meson build | ||
- cov-analysis-linux64-*/bin/cov-build --dir cov-int ninja -C build | ||
- tar cfz cov-int.tar.gz cov-int | ||
- curl https://scan.coverity.com/builds?project=$COVERITY_SCAN_PROJECT_NAME | ||
--form token=$COVERITY_SCAN_TOKEN --form email=$GITLAB_USER_EMAIL | ||
--form [email protected] --form version="`git describe --tags`" | ||
--form description="`git describe --tags` / $CI_COMMIT_TITLE / $CI_COMMIT_REF_NAME:$CI_PIPELINE_ID " | ||
|
||
integration-slirp4netns: | ||
variables: | ||
SLIRP4NETNS_VERSION: "v1.1.12" | ||
# Consumed by `make benchmark` | ||
BENCHMARK_IPERF3_DURATION: "10" | ||
script: | ||
# Install libslirp | ||
- meson build | ||
- ninja -C build install | ||
# Register the path of libslirp.so.0 | ||
- echo /usr/local/lib64 >/etc/ld.so.conf.d/libslirp.conf | ||
- ldconfig | ||
# Install the dependencies of slirp4netns and its test suite | ||
# TODO: install udhcpc for `slirp4netns/tests/test-slirp4netns-dhcp.sh` (currently skipped, due to lack of udhcpc) | ||
- dnf install -y autoconf automake findutils iperf3 iproute iputils jq libcap-devel libseccomp-devel nmap-ncat util-linux | ||
# Check whether the runner environment is configured correctly | ||
- unshare -rn true || (echo Make sure you have relaxed seccomp and appamor && exit 1) | ||
- unshare -rn ip tap add tap0 mode tap || (echo Make sure you have /dev/net/tun && exit 1) | ||
# Install slirp4netns | ||
- git clone https://github.com/rootless-containers/slirp4netns -b "${SLIRP4NETNS_VERSION}" | ||
- cd slirp4netns | ||
- ./autogen.sh | ||
- ./configure | ||
- make | ||
- make install | ||
- slirp4netns --version | ||
# Run slirp4netns integration test | ||
- make distcheck || (cat $(find . -name 'test-suite.log' ) && exit 1) | ||
# Run benchmark test to ensure that libslirp can actually handle packets, with several MTU configurations | ||
- make benchmark MTU=1500 | ||
- make benchmark MTU=512 | ||
- make benchmark MTU=65520 |
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,3 @@ | ||
[gitpublishprofile "default"] | ||
base = master | ||
to = [email protected] |
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Uh, now these are re-added and cgi is deleted. That's a lot of back and forths to review. I realize the PR is marked as draft, it would be nice to clean up this backlog. I'll stop reviewing here until then ;)