Crate libcsp

Source
Expand description

This crate provides a (mostly) safe and ergonomic Rust API for the libcsp C library on top of the libcsp-sys crate.

You can find some more high-level information and examples in the main repository.

Re-exports§

pub use libcsp_sys as ffi;

Modules§

iflist
udp

Structs§

ConnectOpts
CspConnGuard
CspConnRef
CspInterface
CspPacket
CspPacketMut
CspPacketRef
CspPacketRefGuard
CspSocket
CspUdpConf
PingError
SocketFlags

Enums§

ConnState
ConnType
CspError
MsgPriority
RdpState
ReservedPort

Constants§

CSP_ANY
Listen on all ports, primarily used with csp_bind
CSP_LOOPBACK

Functions§

csp_accept
Rust wrapper for ffi::csp_accept.
csp_accept_guarded
csp_bind
Rust wrapper for ffi::csp_bind.
csp_buffer_free
Rust wrapper for ffi::csp_buffer_free.
csp_buffer_get
Rust wrapper for ffi::csp_buffer_get.
csp_close
Rust wrapper for ffi::csp_close.
csp_conn_dport
Rust wrapper for ffi::csp_conn_dport.
csp_conn_dst
Rust wrapper for ffi::csp_conn_dst.
csp_conn_flags
Rust wrapper for ffi::csp_conn_src.
csp_conn_flags_typed
Rust wrapper for ffi::csp_conn_src which also tries to convert the options to a ConnectOpts bitfield.
csp_conn_print_table
Rust wrapper for ffi::csp_conn_print_table.
csp_conn_sport
Rust wrapper for ffi::csp_conn_sport.
csp_conn_src
Rust wrapper for ffi::csp_conn_src.
csp_connect
Rust wrapper for ffi::csp_connect.
csp_connect_guarded
Rust wrapper for ffi::csp_connect which returns a guard structure. The connection will be be closed automatically when the guard structure is dropped.
csp_init
Rust wrapper for ffi::csp_init. Initialize the CSP stack.
csp_listen
Rust wrapper for ffi::csp_listen.
csp_ping
Rust wrapper for ffi::csp_ping.
csp_ping_raw
Rust wrapper for ffi::csp_ping, returns the result code directly.
csp_read
Rust wrapper for ffi::csp_read.
csp_read_guarded
Rust wrapper for ffi::csp_read which returns a guarded packet reference. This packet will cleaned up automatically with csp_buffer_free on drop.
csp_reboot
Rust wrapper for ffi::csp_reboot.
csp_recvfrom
Rust wrapper for ffi::csp_recvfrom.
csp_recvfrom_guarded
Rust wrapper for ffi::csp_recvfrom which returns a guarded packet reference. This packet will cleaned up automatically with csp_buffer_free on drop.
csp_route_work
Rust wrapper for ffi::csp_route_work which also converts errors to the CspError type. This function will panic if the returned error type is not among the known values of CspError.
csp_route_work_raw
Rust wrapper for ffi::csp_route_work.
csp_send
Rust wrapper for ffi::csp_send.
csp_service_handler
csp_transaction
Calls csp_transaction_w_opts with ConnectOpts::NONE.
csp_transaction_persistent
Rust wrapper for ffi::csp_transaction_persistent.
csp_transaction_w_opts
Rust wrapper for ffi::csp_transaction_w_opts.