csnet
|
CSNET is a C application programming library for communicating over a SCION network. More information about SCION can be found here. CSNET exposes a BSD-socket-like API to send and receive SCION packets. CSNET provides similar functionalities to snet (Go), PAN (Go), JPAN (Java) and scion-rs (Rust).
To get started with CSNET follow the building and installation instructions below and afterward continue with the Getting Started Guide.
Building and installing the library and examples requires CMake 3.22 or newer (download here).
All the requirements for building the library and examples are fetched automatically with CMake and installed in the workspace build directory, ensuring the rest of the system remains unaffected.
Running the examples (in ./examples
) additionally requires the following:
Building the documentation (in ./docs
) requires:
Setup the CMake build directory in ./dist
with
The following options exist:
BUILD_LIB
: build the library in ./lib
BUILD_CMD
: build the command line tools in ./cmd
BUILD_EXAMPLES
: build the examples in ./examples
.BUILD_TESTS
: build the tests in ./tests
. May also build the command line tools in ./cmd
that are required by the tests even if DBUILD_CMD
is OFF
.BUILD_DOCS
: build the docs which are output to ./docs/api
.Build everything with
To install the library execute:
Depending on the installation directory you might need to run the command with sudo
.
The installation will produce the static libraries lib/libscion.a
, lib/libnghttp2.a
, lib/libz.a
, lib/libprotobuf.a
, lib/libcurl.a
, the header file include/scion/scion.h
, and the command-line tool bin/ping
in your installation directory. When using the library make sure to link against all the static libraries produced by the installation.
Requirements:
To set up a local SCION Network execute the setup script in scripts/setup-network.sh
. After successfully installing it, the network can be started with sudo scripts/run-testnet.sh
. Press Ctrl+C
to shut down the test network.
EPS32 specific instructions can be found here.
Required tools:
protobuf
and protobuf-c
: Protobuf to C compiler required to generate code from .proto files to talk to a control server.clang-format
: Code formatter we use.To automatically format the code install clang-format
(e.g., via Homebrew) and run
Individual sections can be excluded from formatting like follows:
Entire files and directories are ignored by adding them to .clang-format-ignore