mirror of
https://github.com/t2linux/librxpc.git
synced 2026-04-30 13:53:55 -07:00
68b29b5350
i think some of the changes here might be by mrarm not me but ive forgotten
41 lines
1.1 KiB
C
41 lines
1.1 KiB
C
#ifndef RXPC_STREAM_H
|
|
#define RXPC_STREAM_H
|
|
|
|
#include <stdint.h>
|
|
#include <stddef.h>
|
|
#include <xpc/xpc.h>
|
|
#include "proto.h"
|
|
|
|
struct rxpc_session;
|
|
struct rxpc_stream;
|
|
struct rxpc_stream_pending_data;
|
|
|
|
typedef void (*rxpc_stream_opened_cb)(struct rxpc_stream *);
|
|
typedef void (*rxpc_stream_message_cb)(struct rxpc_stream *, struct rxpc_msg_header *header, const void *data);
|
|
|
|
struct rxpc_stream_callbacks {
|
|
rxpc_stream_opened_cb opened;
|
|
rxpc_stream_message_cb message;
|
|
};
|
|
struct rxpc_stream {
|
|
struct rxpc_session *session;
|
|
int32_t id;
|
|
struct rxpc_stream_callbacks cbs;
|
|
struct rxpc_stream_pending_data *send_data_begin, *send_data_end;
|
|
|
|
char recv_header_data[sizeof(struct rxpc_msg_header)];
|
|
size_t recv_header_pos;
|
|
char *recv_data;
|
|
size_t recv_data_pos;
|
|
};
|
|
struct rxpc_stream_pending_data {
|
|
struct rxpc_stream_pending_data *next;
|
|
size_t offset, size;
|
|
uint8_t data[];
|
|
};
|
|
|
|
struct rxpc_stream *rxpc_stream_open(struct rxpc_session *session, struct rxpc_stream_callbacks *cbs);
|
|
void rxpc_stream_send(struct rxpc_stream *stream, uint8_t type, uint16_t flags, uint64_t msg_id, xpc_object_t data);
|
|
|
|
#endif //RXPC_STREAM_H
|