2019-10-12 13:06:21 +01:00
|
|
|
/*
|
|
|
|
|
* This file is part of the DiscImageChef Remote Server.
|
|
|
|
|
* Copyright (c) 2019 Natalia Portillo.
|
|
|
|
|
*
|
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
|
* the Free Software Foundation, version 3.
|
|
|
|
|
*
|
|
|
|
|
* This program is distributed in the hope that it will be useful, but
|
|
|
|
|
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
|
* General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#ifndef DICMOTE_H
|
|
|
|
|
#define DICMOTE_H
|
|
|
|
|
|
2019-10-12 18:40:49 +01:00
|
|
|
#include <stdint.h>
|
|
|
|
|
#define DICMOTE_NAME "DiscImageChef Remote Server"
|
2019-10-12 13:06:21 +01:00
|
|
|
#define DICMOTE_VERSION "0.99"
|
2019-10-12 17:02:02 +01:00
|
|
|
#define DICMOTE_PORT 6666
|
2019-10-12 22:09:27 +01:00
|
|
|
#define DICMOTE_PACKET_ID 0x6873678065677584 // "DICPACKT"
|
2019-10-12 18:40:49 +01:00
|
|
|
#define DICMOTE_PACKET_VERSION 1
|
|
|
|
|
#define DICMOTE_PACKET_TYPE_HELLO 1
|
2019-10-12 22:34:32 +01:00
|
|
|
#define DICMOTE_PACKET_TYPE_COMMAND_LIST_DEVICES 2
|
|
|
|
|
#define DICMOTE_PACKET_TYPE_RESPONSE_LIST_DEVICES 3
|
2019-10-12 18:40:49 +01:00
|
|
|
#define DICMOTE_PROTOCOL_MAX 1
|
2019-10-12 13:06:21 +01:00
|
|
|
|
2019-10-12 18:40:49 +01:00
|
|
|
#pragma pack(push, 1)
|
|
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
|
{
|
2019-10-12 22:09:27 +01:00
|
|
|
uint64_t id;
|
2019-10-12 18:40:49 +01:00
|
|
|
uint32_t len;
|
|
|
|
|
uint8_t version;
|
|
|
|
|
uint8_t packet_type;
|
|
|
|
|
char spare[2];
|
|
|
|
|
} DicPacketHeader;
|
|
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
|
{
|
|
|
|
|
DicPacketHeader hdr;
|
|
|
|
|
char application[128];
|
|
|
|
|
char version[64];
|
|
|
|
|
uint8_t max_protocol;
|
|
|
|
|
char spare[3];
|
|
|
|
|
char sysname[256];
|
|
|
|
|
char release[256];
|
|
|
|
|
char machine[256];
|
|
|
|
|
} DicPacketHello;
|
|
|
|
|
|
2019-10-12 22:34:32 +01:00
|
|
|
typedef struct
|
|
|
|
|
{
|
|
|
|
|
DicPacketHeader hdr;
|
|
|
|
|
} DicPacketCmdListDevs;
|
|
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
|
{
|
|
|
|
|
DicPacketHeader hdr;
|
|
|
|
|
uint16_t devices;
|
|
|
|
|
} DicPacketResListDevs;
|
|
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
|
{
|
|
|
|
|
char path[1024];
|
|
|
|
|
char vendor;
|
|
|
|
|
char model;
|
|
|
|
|
char serial;
|
|
|
|
|
char bus;
|
|
|
|
|
uint8_t supported;
|
|
|
|
|
} DeviceInfo;
|
|
|
|
|
|
|
|
|
|
typedef struct DeviceInfoList
|
|
|
|
|
{
|
|
|
|
|
struct DeviceInfoList* next;
|
|
|
|
|
DeviceInfo this;
|
|
|
|
|
} DeviceInfoList;
|
2019-10-12 18:40:49 +01:00
|
|
|
#pragma pack(pop)
|
|
|
|
|
|
|
|
|
|
#endif
|