tipc
Rust Bindings for some of the common Linux TIPC operations.
Prerequisites
- Linux OS (version >= 4.14 for communication groups)
- Clang compiler
- TIPC kernel module enabled (
sudo modprobe tipc
)
Building tipc
Testing
By default, Rust will run tests in parallel, which causes havoc when many different tests are trying to create/join the same TIPC group. Use the following make target, which pins the number of test threads to 1:
Alternatively, you can invoke the following cargo command directly:
Examples
Attach TIPC to an interface for communication with other nodes on the network
use attach_to_interface;
attach_to_interface.unwrap;
Open a socket, bind to an address and listen for messages
use ;
let conn = new.unwrap;
conn.bind.expect;
let mut buf: = ;
loop
In another machine on the network:
use ;
use ;
let conn = new.unwrap;
let n = 0;
loop
Join a group and listen for group membership events or messages
Note: Joining a group automatically binds to an address and creates the group if it doesn't already exist.
use ;
let mut conn = new.unwrap;
conn.join.expect;
// Listen for messages
loop