ppd/dsmbr/dmsg.h

27 lines
637 B
C
Raw Normal View History

2023-03-02 14:12:35 +00:00
#pragma once
#include <cstdint>
#include <cstdio>
static constexpr int CTRL_SYNC = 0x1234;
static constexpr int CTRL_ACK = 0x2345;
static constexpr int CTRL_STOP = 0x3456;
static constexpr int CTRL_STAT = 0x4567;
static constexpr int DSMBR_MSG_MAX_DATA = 16;
struct dsmbr_ctrl_msg {
uint32_t code;
uint64_t data[DSMBR_MSG_MAX_DATA];
};
int
dsmbr_send_ctrl_msg(int sockfd, int code, char * data, size_t len);
int
dsmbr_sendall_ctrl_msg(int * sockfds, int count, int code);
int
dsmbr_recv_ctrl_msg(int sockfd, struct dsmbr_ctrl_msg * msg);
int
dsmbr_recvall_ctrl_msg(int * sockfds, int count, struct dsmbr_ctrl_msg * msgs);