From 68da4491cdbf854d14fe1cf3ed38432e2e50bc51 Mon Sep 17 00:00:00 2001 From: cdfrey Date: Thu, 8 Dec 2005 04:28:05 +0000 Subject: [PATCH] - changed headers so that any low level protocol-specific sizes and structs are completely hidden in the library... this adds library-only header: protostructs.h --- src/barry.h | 15 +- src/controller.cc | 1 + src/parser.cc | 11 +- src/parser.h | 11 +- src/protocol.cc | 1 + src/protocol.h | 442 +++++-------------------------------- src/{protocol.h => protostructs.h} | 42 +--- src/record.cc | 30 +++ src/record.h | 28 +-- src/socket.cc | 3 +- 10 files changed, 135 insertions(+), 449 deletions(-) rewrite src/protocol.h (85%) copy src/{protocol.h => protostructs.h} (91%) diff --git a/src/barry.h b/src/barry.h index 7dcbcd75..282a70b6 100644 --- a/src/barry.h +++ b/src/barry.h @@ -28,11 +28,18 @@ */ -#include "usbwrap.h" -#include "common.h" -#include "error.h" -#include "probe.h" +// This lists all the headers that the application needs. +// Only these headers get installed. + +#include "data.h" +#include "usbwrap.h" // to be moved to libusb someday +#include "common.h" // Init() +#include "error.h" // exceptions +#include "probe.h" // device prober class +#include "socket.h" +#include "protocol.h" // application-safe header #include "parser.h" +#include "record.h" #include "controller.h" #endif diff --git a/src/controller.cc b/src/controller.cc index b9bc7d1b..93a64a60 100644 --- a/src/controller.cc +++ b/src/controller.cc @@ -22,6 +22,7 @@ #include "controller.h" #include "common.h" #include "protocol.h" +#include "protostructs.h" #include "error.h" #include "data.h" #include "parser.h" diff --git a/src/parser.cc b/src/parser.cc index 6cb1954d..927ba6a2 100644 --- a/src/parser.cc +++ b/src/parser.cc @@ -1,6 +1,7 @@ /// /// \file parser.cc -/// Virtual parser functor class +/// Virtual parser functor class. Also, all protocol-specific +/// parser code goes in here. /// /* @@ -21,6 +22,7 @@ #include "parser.h" #include "protocol.h" +#include "protostructs.h" namespace Barry { @@ -35,5 +37,12 @@ bool Parser::GetOperation(const Data &data, unsigned int &operation) return true; } +size_t Parser::GetHeaderSize(size_t recordsize) const +{ + // calculate the full header size, which (for records) is a DBACCESS + // header size, plus the header size of recordsize... + return SB_PACKET_DBACCESS_HEADER_SIZE + recordsize - sizeof(Barry::CommonField); +} + } // namespace Barry diff --git a/src/parser.h b/src/parser.h index f5486ffc..3134917e 100644 --- a/src/parser.h +++ b/src/parser.h @@ -45,6 +45,7 @@ public: virtual bool operator()(const Data &data) { return true; } virtual bool GetOperation(const Data &data, unsigned int &operation); + virtual size_t GetHeaderSize(size_t recordsize) const; }; @@ -112,12 +113,12 @@ public: { case SB_DBOP_GET_RECORDS: // using the new protocol - recordsize = sizeof(Record::ProtocolRecordType); + recordsize = Record::GetProtocolRecordSize(); break; case SB_DBOP_OLD_GET_RECORDS_REPLY: // using the old protocol - recordsize = sizeof(Record::OldProtocolRecordType); + recordsize = Record::GetOldProtocolRecordSize(); break; default: @@ -126,12 +127,8 @@ public: return false; } - // calculate the full header size, which is a DBACCESS - // header size, plus the header size of recordsize... - size_t fullsize = SB_PACKET_DBACCESS_HEADER_SIZE + recordsize - sizeof(Barry::CommonField); - // return true if header is ok - return (unsigned int)data.GetSize() > fullsize; + return (size_t)data.GetSize() > GetHeaderSize(recordsize); } /// Functor member called by Controller::LoadDatabase() during diff --git a/src/protocol.cc b/src/protocol.cc index 306436b4..a6d295a6 100644 --- a/src/protocol.cc +++ b/src/protocol.cc @@ -20,6 +20,7 @@ */ #include "protocol.h" +#include "protostructs.h" #include "data.h" #include "error.h" #include "debug.h" diff --git a/src/protocol.h b/src/protocol.h dissimilarity index 85% index be2f0e06..4b7b1429 100644 --- a/src/protocol.h +++ b/src/protocol.h @@ -1,386 +1,56 @@ -/// -/// \file protocol.h -/// USB Blackberry bulk protocol API -/// - -/* - Copyright (C) 2005, Net Direct Inc. (http://www.netdirect.ca/) - - 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; either version 2 of the License, or - (at your option) any later version. - - 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 in the COPYING file at the - root directory of this project for more details. -*/ - -#ifndef __BARRY_PROTOCOL_H__ -#define __BARRY_PROTOCOL_H__ - -#include - -// forward declarations -class Data; - -namespace Barry { - -/////////////////////////////////////////////////////////////////////////////// -struct SocketCommand -{ - uint16_t socket; - uint8_t param; -} __attribute__ ((packed)); - -/////////////////////////////////////////////////////////////////////////////// -struct SequenceCommand -{ - uint8_t unknown1; - uint8_t unknown2; - uint8_t unknown3; - uint32_t sequenceId; -} __attribute__ ((packed)); - -/////////////////////////////////////////////////////////////////////////////// -struct ModeSelectCommand -{ - uint16_t socket; - uint8_t flag; - uint8_t modeName[16]; - struct ResponseBlock - { - uint8_t unknown[20]; - } __attribute__ ((packed)) response; -} __attribute__ ((packed)); - -/////////////////////////////////////////////////////////////////////////////// -struct DBCommand -{ - uint8_t operation; // see below - uint16_t databaseId; // value from the Database Database - uint8_t data[1]; -} __attribute__ ((packed)); - -struct DBResponse -{ - uint8_t operation; - uint32_t unknown; - uint16_t sequenceCount; - uint8_t data[1]; -} __attribute__ ((packed)); - - - -/////////////////////////////////////////////////////////////////////////////// -// CommandTable command and field structures - -struct CommandTableField -{ - uint8_t size; // no null terminator - uint8_t code; - uint8_t name[1]; -} __attribute__ ((packed)); - -#define COMMAND_FIELD_HEADER_SIZE (sizeof(Barry::CommandTableField) - 1) - - - -/////////////////////////////////////////////////////////////////////////////// -// Database database command and field structures - -struct OldDBDBField -{ - uint16_t dbNumber; - uint8_t unknown1; - uint32_t dbSize; // assumed from Cassis docs... - // always 0 in USB - uint16_t dbRecordCount; - uint16_t unknown2; - uint16_t nameSize; // includes null terminator - uint8_t name[1]; -} __attribute__ ((packed)); -#define OLD_DBDB_FIELD_HEADER_SIZE (sizeof(Barry::OldDBDBField) - 1) - -struct DBDBField -{ - uint16_t dbNumber; - uint8_t unknown1; - uint32_t dbSize; // assumed from Cassis docs... - // always 0 in USB - uint32_t dbRecordCount; - uint16_t unknown2; - uint16_t nameSize; // includes null terminator - uint8_t unknown3; - uint8_t name[1]; // followed by 2 zeros! - uint16_t unknown; // this comes after the - // null terminated name, but - // is here for size calcs -} __attribute__ ((packed)); -#define DBDB_FIELD_HEADER_SIZE (sizeof(Barry::DBDBField) - 1) - -struct OldDBDBRecord -{ - uint8_t operation; - uint16_t count; // number of fields in record - OldDBDBField field[1]; -} __attribute__ ((packed)); -#define OLD_DBDB_RECORD_HEADER_SIZE (sizeof(Barry::OldDBDBRecord) - sizeof(Barry::OldDBDBField)) - -struct DBDBRecord -{ - uint8_t operation; - uint16_t count; - uint8_t unknown[3]; - DBDBField field[1]; -} __attribute__ ((packed)); -#define DBDB_RECORD_HEADER_SIZE (sizeof(Barry::DBDBRecord) - sizeof(Barry::DBDBField)) - - - - -/////////////////////////////////////////////////////////////////////////////// -// Address book sub-field structs - -struct GroupLink -{ - uint32_t uniqueId; - uint16_t unknown; -} __attribute__ ((packed)); - - -/////////////////////////////////////////////////////////////////////////////// -// Message sub-field structs - -struct MessageAddress -{ - uint8_t unknown[8]; - uint8_t addr[1]; // 2 null terminated strings: first - // contains full name, second contains - // the email address -} __attribute__ ((packed)); - - - - - -/////////////////////////////////////////////////////////////////////////////// -// Common database field structure - -struct CommonField -{ - uint16_t size; // including null terminator - uint8_t type; - - union FieldData - { - GroupLink link; - MessageAddress addr; - int32_t min1900; - uint8_t raw[1]; - - } __attribute__ ((packed)) data; -} __attribute__ ((packed)); -#define COMMON_FIELD_HEADER_SIZE (sizeof(Barry::CommonField) - sizeof(Barry::CommonField::FieldData)) - - -/////////////////////////////////////////////////////////////////////////////// -// Address book / Contact record data - -struct OldContactRecord -{ - uint8_t operation; - uint8_t unknown; - uint16_t recordNumber; - uint32_t uniqueId; - uint8_t unknown2; - CommonField field[1]; -} __attribute__ ((packed)); -#define OLD_CONTACT_RECORD_HEADER_SIZE (sizeof(Barry::OldContactRecord) - sizeof(Barry::CommonField)) - -struct ContactRecord -{ - uint8_t operation; - uint8_t unknown; - uint16_t recordNumber; - uint8_t unknown2[3]; - uint32_t uniqueId; - uint8_t unknown3[3]; - CommonField field[1]; -} __attribute__ ((packed)); -#define CONTACT_RECORD_HEADER_SIZE (sizeof(Barry::ContactRecord) - sizeof(Barry::CommonField)) - - -/////////////////////////////////////////////////////////////////////////////// -// Message field and record structures - -struct OldMessageRecord -{ - uint8_t operation; - uint8_t unknown; - uint16_t count; - uint8_t timeBlock[0x72]; - CommonField field[1]; -} __attribute__ ((packed)); - -struct MessageRecord -{ - uint8_t operation; - uint8_t unknown; - uint16_t count; - uint8_t timeBlock[0x77]; - CommonField field[1]; -} __attribute__ ((packed)); - - - -/////////////////////////////////////////////////////////////////////////////// -// Calendar field and record structures - -struct OldCalendarRecord -{ - uint8_t operation; - uint8_t unknown; - uint16_t count; - uint32_t uniqueId; - uint8_t unknown2; // observed as 0 or 1 - CommonField field[1]; -} __attribute__ ((packed)); - -struct CalendarRecord -{ - uint8_t operation; - // FIXME - not yet implemented - CommonField field[1]; -} __attribute__ ((packed)); - - - -/////////////////////////////////////////////////////////////////////////////// -// Database access command structure - -// even fragmented packets have a tableCmd -struct DBAccess -{ - uint8_t tableCmd; - union DBData - { - DBCommand db; - DBResponse db_r; - OldContactRecord old_contact; - ContactRecord contact; - CommandTableField table[1]; - OldDBDBRecord old_dbdb; - DBDBRecord dbdb; - OldMessageRecord old_message; - MessageRecord message; - OldCalendarRecord old_calendar; - CalendarRecord calendar; - uint8_t fragment[1]; - uint8_t raw[1]; - - } __attribute__ ((packed)) data; -} __attribute__ ((packed)); - - - -/////////////////////////////////////////////////////////////////////////////// -// Main packet struct - -struct Packet -{ - uint16_t socket; // socket ID... 0 is always there - uint16_t size; // total size of data packet - uint8_t command; - - union PacketData - { - - SocketCommand socket; - SequenceCommand sequence; - ModeSelectCommand mode; - DBAccess db; - uint8_t raw[1]; - - } __attribute__ ((packed)) data; -} __attribute__ ((packed)); - -// minimum required sizes for various responses -#define MIN_PACKET_SIZE 6 - - -// maximum sizes -#define MAX_PACKET_SIZE 0x400 // anything beyond this needs to be - // fragmented -// various useful sizes -#define SB_PACKET_HEADER_SIZE (sizeof(Barry::Packet) - sizeof(Barry::Packet::PacketData)) -#define SB_DBACCESS_HEADER_SIZE (sizeof(Barry::DBAccess) - sizeof(Barry::DBAccess::DBData)) -#define SB_PACKET_DBACCESS_HEADER_SIZE (SB_PACKET_HEADER_SIZE + SB_DBACCESS_HEADER_SIZE) -#define SB_FRAG_HEADER_SIZE SB_PACKET_DBACCESS_HEADER_SIZE -#define SB_SEQUENCE_PACKET_SIZE (SB_PACKET_HEADER_SIZE + sizeof(Barry::SequenceCommand)) -#define SB_SOCKET_PACKET_SIZE (SB_PACKET_HEADER_SIZE + sizeof(Barry::SocketCommand)) -#define SB_MODE_PACKET_COMMAND_SIZE (SB_PACKET_HEADER_SIZE + sizeof(Barry::ModeSelectCommand) - sizeof(Barry::ModeSelectCommand::ResponseBlock)) -#define SB_MODE_PACKET_RESPONSE_SIZE (SB_PACKET_HEADER_SIZE + sizeof(Barry::ModeSelectCommand)) -#define SB_PACKET_CONTACT_HEADER_SIZE (SB_PACKET_HEADER_SIZE + SB_DBACCESS_HEADER_SIZE + CONTACT_RECORD_HEADER_SIZE) -#define SB_PACKET_OLD_CONTACT_HEADER_SIZE (SB_PACKET_HEADER_SIZE + SB_DBACCESS_HEADER_SIZE + OLD_CONTACT_RECORD_HEADER_SIZE) -#define SB_PACKET_DBDB_HEADER_SIZE (SB_PACKET_HEADER_SIZE + SB_DBACCESS_HEADER_SIZE + DBDB_RECORD_HEADER_SIZE) -#define SB_PACKET_OLD_DBDB_HEADER_SIZE (SB_PACKET_HEADER_SIZE + SB_DBACCESS_HEADER_SIZE + OLD_DBDB_RECORD_HEADER_SIZE) - - - -// packet commands (Packet.command: has response codes too) -#define SB_COMMAND_SELECT_MODE 0x07 -#define SB_COMMAND_MODE_SELECTED 0x08 -#define SB_COMMAND_OPEN_SOCKET 0x0a -#define SB_COMMAND_CLOSE_SOCKET 0x0b -#define SB_COMMAND_CLOSED_SOCKET 0x0c -#define SB_COMMAND_OPENED_SOCKET 0x10 -#define SB_COMMAND_SEQUENCE_HANDSHAKE 0x13 -#define SB_COMMAND_DB_DATA 0x40 -#define SB_COMMAND_DB_FRAGMENTED 0x60 -#define SB_COMMAND_DB_DONE 0x41 - - -// mode constants -#define SB_MODE_REQUEST_SOCKET 0x00ff - - -// param command parameters -//#define SB_PARAM_DEFAULT 0xff - - -// DB Operation Command -#define SB_DBOP_GET_DBDB 0x4a -#define SB_DBOP_OLD_GET_DBDB 0x4c -#define SB_DBOP_GET_COUNT 0x4e -#define SB_DBOP_GET_RECORDS 0x4f -#define SB_DBOP_OLD_GET_RECORDS 0x42 -#define SB_DBOP_OLD_GET_RECORDS_REPLY 0x44 - - -// Macros -#define COMMAND(data) (((const Barry::Packet *)data.GetData())->command) -#define IS_COMMAND(data, cmd) (COMMAND(data) == cmd) -#define MAKE_PACKET(var, data) const Barry::Packet *var = (const Barry::Packet *) data.GetData() - -// fragmentation protocol -// send DATA first, then keep sending DATA packets, FRAGMENTing -// as required until finished, then send DONE. Both sides behave -// this way, so different sized data can be sent in both -// directions -// -// the fragmented piece only has a the param header, and then continues -// right on with the data - - - -// checks packet size and throws BError if not right -void CheckSize(const Data &packet, int requiredsize = MIN_PACKET_SIZE); - -} // namespace Barry - -#endif - +/// +/// \file protocol.h +/// USB Blackberry bulk protocol API constants +/// + +/* + Copyright (C) 2005, Net Direct Inc. (http://www.netdirect.ca/) + + 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; either version 2 of the License, or + (at your option) any later version. + + 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#ifndef __BARRY_PROTOCOL_H__ +#define __BARRY_PROTOCOL_H__ + +// packet commands (Packet.command: has response codes too) +#define SB_COMMAND_SELECT_MODE 0x07 +#define SB_COMMAND_MODE_SELECTED 0x08 +#define SB_COMMAND_OPEN_SOCKET 0x0a +#define SB_COMMAND_CLOSE_SOCKET 0x0b +#define SB_COMMAND_CLOSED_SOCKET 0x0c +#define SB_COMMAND_OPENED_SOCKET 0x10 +#define SB_COMMAND_SEQUENCE_HANDSHAKE 0x13 +#define SB_COMMAND_DB_DATA 0x40 +#define SB_COMMAND_DB_FRAGMENTED 0x60 +#define SB_COMMAND_DB_DONE 0x41 + + +// mode constants +#define SB_MODE_REQUEST_SOCKET 0x00ff + + +// param command parameters +//#define SB_PARAM_DEFAULT 0xff + + +// DB Operation Command +#define SB_DBOP_GET_DBDB 0x4a +#define SB_DBOP_OLD_GET_DBDB 0x4c +#define SB_DBOP_GET_COUNT 0x4e +#define SB_DBOP_GET_RECORDS 0x4f +#define SB_DBOP_OLD_GET_RECORDS 0x42 +#define SB_DBOP_OLD_GET_RECORDS_REPLY 0x44 + + +#endif + diff --git a/src/protocol.h b/src/protostructs.h similarity index 91% copy from src/protocol.h copy to src/protostructs.h index be2f0e06..dc78cfc2 100644 --- a/src/protocol.h +++ b/src/protostructs.h @@ -1,6 +1,10 @@ /// -/// \file protocol.h -/// USB Blackberry bulk protocol API +/// \file protostructs.h +/// USB Blackberry bulk protocol API. This is split out from +/// protocol.h so that low level, packed structs can be +/// compiled separately from the application. This prevents +/// aliasing problems in the application, or using +/// -fno-strict-aliasing, which the library only needs. /// /* @@ -19,8 +23,8 @@ root directory of this project for more details. */ -#ifndef __BARRY_PROTOCOL_H__ -#define __BARRY_PROTOCOL_H__ +#ifndef __BARRY_PROTOSTRUCTS_H__ +#define __BARRY_PROTOSTRUCTS_H__ #include @@ -331,36 +335,6 @@ struct Packet -// packet commands (Packet.command: has response codes too) -#define SB_COMMAND_SELECT_MODE 0x07 -#define SB_COMMAND_MODE_SELECTED 0x08 -#define SB_COMMAND_OPEN_SOCKET 0x0a -#define SB_COMMAND_CLOSE_SOCKET 0x0b -#define SB_COMMAND_CLOSED_SOCKET 0x0c -#define SB_COMMAND_OPENED_SOCKET 0x10 -#define SB_COMMAND_SEQUENCE_HANDSHAKE 0x13 -#define SB_COMMAND_DB_DATA 0x40 -#define SB_COMMAND_DB_FRAGMENTED 0x60 -#define SB_COMMAND_DB_DONE 0x41 - - -// mode constants -#define SB_MODE_REQUEST_SOCKET 0x00ff - - -// param command parameters -//#define SB_PARAM_DEFAULT 0xff - - -// DB Operation Command -#define SB_DBOP_GET_DBDB 0x4a -#define SB_DBOP_OLD_GET_DBDB 0x4c -#define SB_DBOP_GET_COUNT 0x4e -#define SB_DBOP_GET_RECORDS 0x4f -#define SB_DBOP_OLD_GET_RECORDS 0x42 -#define SB_DBOP_OLD_GET_RECORDS_REPLY 0x44 - - // Macros #define COMMAND(data) (((const Barry::Packet *)data.GetData())->command) #define IS_COMMAND(data, cmd) (COMMAND(data) == cmd) diff --git a/src/record.cc b/src/record.cc index 4852d9fe..f03b95aa 100644 --- a/src/record.cc +++ b/src/record.cc @@ -22,6 +22,7 @@ #include "record.h" #include "protocol.h" +#include "protostructs.h" #include "data.h" #include "base64.h" #include "time.h" @@ -333,6 +334,16 @@ FieldLink ContactFieldLinks[] = { { CFC_INVALID_FIELD,"EndOfList", 0, 0, 0 } }; +size_t Contact::GetOldProtocolRecordSize() +{ + return sizeof(Barry::OldContactRecord); +} + +size_t Contact::GetProtocolRecordSize() +{ + return sizeof(Barry::ContactRecord); +} + Contact::Contact() { } @@ -591,6 +602,16 @@ FieldLink MessageFieldLinks[] = { { MFC_END, "End of List",0, 0, 0, 0, 0 } }; +size_t Message::GetOldProtocolRecordSize() +{ + return sizeof(Barry::OldMessageRecord); +} + +size_t Message::GetProtocolRecordSize() +{ + return sizeof(Barry::MessageRecord); +} + Message::Message() { } @@ -729,6 +750,15 @@ FieldLink CalendarFieldLinks[] = { { CALFC_END, "End of List",0, 0, 0, 0, 0 } }; +size_t Calendar::GetOldProtocolRecordSize() +{ + return sizeof(Barry::OldCalendarRecord); +} + +size_t Calendar::GetProtocolRecordSize() +{ + return sizeof(Barry::CalendarRecord); +} Calendar::Calendar() { diff --git a/src/record.h b/src/record.h index 9dff273d..91cfda88 100644 --- a/src/record.h +++ b/src/record.h @@ -28,8 +28,6 @@ #include #include -#include "protocol.h" // only needed for size typedefs - // forward declarations class Data; @@ -139,11 +137,6 @@ std::ostream& operator<< (std::ostream &os, const std::vector &unk class Contact { -public: - // protocol record types, for size calculations - typedef Barry::OldContactRecord OldProtocolRecordType; - typedef Barry::ContactRecord ProtocolRecordType; - private: // private contact management data uint64_t m_recordId; @@ -195,6 +188,10 @@ public: void Dump(std::ostream &os) const; void DumpLdif(std::ostream &os, const std::string &baseDN) const; + + // protocol record sizes + static size_t GetOldProtocolRecordSize(); + static size_t GetProtocolRecordSize(); }; inline std::ostream& operator<< (std::ostream &os, const Contact &contact) { @@ -205,10 +202,6 @@ inline std::ostream& operator<< (std::ostream &os, const Contact &contact) { class Message { public: - // protocol record types, for size calculations - typedef Barry::OldMessageRecord OldProtocolRecordType; - typedef Barry::MessageRecord ProtocolRecordType; - struct Address { std::string Name; @@ -233,6 +226,10 @@ public: void Clear(); void Dump(std::ostream &os) const; + + // protocol record sizes + static size_t GetOldProtocolRecordSize(); + static size_t GetProtocolRecordSize(); }; inline std::ostream& operator<<(std::ostream &os, const Message &msg) { @@ -245,11 +242,6 @@ std::ostream& operator<<(std::ostream &os, const Message::Address &msga); class Calendar { -public: - // protocol record types, for size calculations - typedef Barry::OldCalendarRecord OldProtocolRecordType; - typedef Barry::CalendarRecord ProtocolRecordType; - private: uint64_t m_recordId; @@ -272,6 +264,10 @@ public: void Clear(); void Dump(std::ostream &os) const; + + // protocol record sizes + static size_t GetOldProtocolRecordSize(); + static size_t GetProtocolRecordSize(); }; inline std::ostream& operator<<(std::ostream &os, const Calendar &msg) { diff --git a/src/socket.cc b/src/socket.cc index 095f7f4b..e6c06b41 100644 --- a/src/socket.cc +++ b/src/socket.cc @@ -19,9 +19,10 @@ root directory of this project for more details. */ +#include "socket.h" #include "usbwrap.h" #include "protocol.h" -#include "socket.h" +#include "protostructs.h" #include "debug.h" #include "data.h" #include "error.h" -- 2.11.4.GIT