panda-channels

Crates.iopanda-channels
lib.rspanda-channels
version0.4.0
sourcesrc
created_at2021-12-15 15:51:37.298219
updated_at2022-10-07 15:26:20.416552
descriptionA library for communicating with the hypervisor from the guest
homepagehttps://panda.re
repositoryhttps://github.com/panda-re/panda-channels
max_upload_size
id498352
size18,232
Jordan McLeod (jamcleod)

documentation

README

panda-channels

A Rust library (with C bindings) for communicating with the hypervisor via hypercalls in a channel-like manner. Primarily intended for use with the guest plugin API.

C API Documentation

/**
 * Initialize the channel library, should be run at the start of main() in your guest plu
 */
void hyperchannel_init(void);

/**
 * Uninitialize the channel library, should be run at the end of main() in your guest plu
 */
void hyperchannel_uninit(void);

/**
 * Read from a channel descriptor into a buffer
 *
 * Returns: the number of bytes read into the buffer.
 */
uintptr_t channel_read(uint32_t channel, uint8_t *out, uintptr_t out_len);

/**
 * Write a buffer to a given channel descriptor
 */
void channel_write(uint32_t channel, const uint8_t *buf, uintptr_t buf_len);

/**
 * Gets the main channel for a plugin of a given name
 *
 * Returns: the number of bytes read into the buffer, or -1 if the plugin wasn't found
 */
int32_t get_main_channel(const uint8_t *name, uintptr_t len);

/**
 * Get a new channel not associated with any specific plugin
 *
 * Returns: the channel, or -1 if an error occurs
 */
int32_t get_new_channel(void);
Commit count: 0

cargo fmt