Commit Graph

12 Commits

Author SHA1 Message Date
Wolfgang Bumiller
7b7a42b467 protocol: use Option<fn()> for nullable function
This should have the same memory layoutas a simple `fn()`
with NULL function pointers mapping to None.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-03-15 14:21:52 +01:00
Wolfgang Bumiller
7f497b2e68 protocol: add C bindings for Connector
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-03-15 12:40:47 +01:00
Wolfgang Bumiller
4457adb28c protocol: C-API improvements
- make Client creation reusable
- add helper to create a CApiSocket for any Read + Write
  streams
- add drop callback (required for the above)

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-03-15 12:40:47 +01:00
Wolfgang Bumiller
41310cb96e protocol: add connector
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-03-15 12:40:47 +01:00
Wolfgang Bumiller
f7bbb8a664 protocol: add missing finish_backup to C API
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-03-13 14:16:17 +01:00
Wolfgang Bumiller
6f90a6a764 protocol: cleanup finish_backup
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-03-13 14:16:17 +01:00
Wolfgang Bumiller
06178f13fa move chunker into proxmox_protocol
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-03-08 09:29:47 +01:00
Wolfgang Bumiller
181cb6401d protocol: use size_t for c api instead of ulong
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-03-07 14:40:15 +01:00
Wolfgang Bumiller
b4844eb334 protocol: expose chunker and digest function
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-03-07 14:32:42 +01:00
Wolfgang Bumiller
e402769332 protocol: allow explicitly polling for a single packet
When using *blocking* I/O wait_for_* functions need to be
able to not read past their awaited packet.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-03-07 13:51:13 +01:00
Wolfgang Bumiller
b08b44c046 protocol: remove redundant WouldBlock handling
The packet reading code already translates this to a bool.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-03-07 13:51:13 +01:00
Wolfgang Bumiller
ac4e349b5e import proxmox-protocol crate
This is supposed to contain only the parts necessary to
communicate with the server via the proxmox backup protocol.
(Including the chunker, which is currently `include!()`d
from the main crate.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-03-06 10:26:10 +01:00