Logo Search packages:      
Sourcecode: barry version File versions  Download package

protostructs.h File Reference


Detailed Description

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.

Do not include this in any Barry library header. This may only be included from .cc files, in order to hide aliasing concernes from the application.

Definition in file protostructs.h.

#include <stdint.h>
#include <sys/types.h>

Go to the source code of this file.

Namespaces

namespace  Barry
namespace  Barry::Protocol

Classes

struct  Barry::Protocol::AttributeFetch
struct  Barry::Protocol::CalendarRecurrenceDataField
union  Barry::Protocol::CalendarRecurrenceDataField::Additional
struct  Barry::Protocol::CalendarRecurrenceDataField::Additional::Day
struct  Barry::Protocol::CalendarRecurrenceDataField::Additional::MonthByDate
struct  Barry::Protocol::CalendarRecurrenceDataField::Additional::MonthByDay
struct  Barry::Protocol::CalendarRecurrenceDataField::Additional::Week
struct  Barry::Protocol::CalendarRecurrenceDataField::Additional::YearByDate
struct  Barry::Protocol::CalendarRecurrenceDataField::Additional::YearByDay
struct  Barry::Protocol::CommandTableField
struct  Barry::Protocol::CommonField
union  Barry::Protocol::CommonField::CommonFieldData
struct  Barry::Protocol::DBAccess
union  Barry::Protocol::DBAccess::DBData
struct  Barry::Protocol::DBC_IndexedUpload
struct  Barry::Protocol::DBC_Record
struct  Barry::Protocol::DBC_RecordFlags
struct  Barry::Protocol::DBC_TaggedUpload
struct  Barry::Protocol::DBCommand
union  Barry::Protocol::DBCommand::Parameters
struct  Barry::Protocol::DBDBField
struct  Barry::Protocol::DBR_DBDBRecord
struct  Barry::Protocol::DBR_OldDBDBRecord
struct  Barry::Protocol::DBR_OldTaggedRecord
union  Barry::Protocol::DBR_OldTaggedRecord::TaggedData
struct  Barry::Protocol::DBResponse
union  Barry::Protocol::DBResponse::Parameters
struct  Barry::Protocol::GroupLink
struct  Barry::Protocol::MessageAddress
struct  Barry::Protocol::MessageRecord
struct  Barry::Protocol::ModeSelect
struct  Barry::Protocol::ModeSelect::ResponseBlock
struct  Barry::Protocol::OldDBDBField
struct  Barry::Protocol::PackedField_02
struct  Barry::Protocol::PackedField_10
struct  Barry::Protocol::Packet
union  Barry::Protocol::Packet::PacketData
struct  Barry::Protocol::PasswordChallenge
union  Barry::Protocol::PasswordChallenge::Hash
struct  Barry::Protocol::RecordStateTableField
struct  Barry::Protocol::SequenceCommand
struct  Barry::Protocol::ServiceBookConfigField
union  Barry::Protocol::SizePacket
struct  Barry::Protocol::SocketCommand
union  Barry::Protocol::SocketCommand::PacketData

Defines

#define ATTRIBUTE_FETCH_COMMAND_SIZE   (sizeof(Barry::Protocol::AttributeFetch) - 1)
#define BARRY_RSTF_DIRTY   0x01
#define CALENDAR_RECURRENCE_DATA_FIELD_SIZE   sizeof(Barry::Protocol::CalendarRecurrenceDataField)
#define COMMAND(data)   (((const Barry::Protocol::Packet *)data.GetData())->command)
#define COMMAND_FIELD_HEADER_SIZE   (sizeof(Barry::Protocol::CommandTableField) - 1)
#define COMMON_FIELD_HEADER_SIZE   (sizeof(Barry::Protocol::CommonField) - sizeof(Barry::Protocol::CommonField::CommonFieldData))
#define COMMON_FIELD_MIN1900_SIZE   (sizeof(int32_t))
#define CRDF_TYPE_DAY   0x01
#define CRDF_TYPE_MONTH_BY_DATE   0x03
#define CRDF_TYPE_MONTH_BY_DAY   0x04
#define CRDF_TYPE_WEEK   0x0c
#define CRDF_TYPE_YEAR_BY_DATE   0x05
#define CRDF_TYPE_YEAR_BY_DAY   0x06
#define CRDF_WD_FRI   0x20
#define CRDF_WD_MON   0x02
#define CRDF_WD_SAT   0x40
#define CRDF_WD_SUN   0x01
#define CRDF_WD_THU   0x10
#define CRDF_WD_TUE   0x04
#define CRDF_WD_WED   0x08
#define DB_COMMAND_HEADER_SIZE   (sizeof(Barry::Protocol::DBCommand) - sizeof(Barry::Protocol::DBCommand::Parameters))
#define DB_RESPONSE_HEADER_SIZE   (sizeof(Barry::Protocol::DBResponse) - sizeof(Barry::Protocol::DBResponse::Parameters))
#define DBC_INDEXED_UPLOAD_HEADER_SIZE   (sizeof(Barry::Protocol::DBC_IndexedUpload) - 1)
#define DBC_RECORD_FLAGS_SIZE   (sizeof(Barry::Protocol::DBC_RecordFlags))
#define DBC_RECORD_HEADER_SIZE   (sizeof(Barry::Protocol::DBC_Record) - 1)
#define DBC_TAGGED_UPLOAD_HEADER_SIZE   (sizeof(Barry::Protocol::DBC_TaggedUpload) - 1)
#define DBDB_FIELD_HEADER_SIZE   (sizeof(Barry::Protocol::DBDBField) - 1)
#define DBDB_RECORD_HEADER_SIZE   (sizeof(Barry::Protocol::DBR_DBDBRecord) - sizeof(Barry::Protocol::DBDBField))
#define DBR_OLD_TAGGED_RECORD_HEADER_SIZE   (sizeof(Barry::Protocol::DBR_OldTaggedRecord) - sizeof(Barry::Protocol::DBR_OldTaggedRecord::TaggedData))
#define IS_COMMAND(data, cmd)   (COMMAND(data) == cmd)
#define MAKE_PACKET(var, data)   const Barry::Protocol::Packet *var = (const Barry::Protocol::Packet *) (data).GetData()
#define MAKE_PACKETPTR_BUF(var, ptr)   Barry::Protocol::Packet *var = (Barry::Protocol::Packet *)ptr
#define MAKE_RECORD(type, var, data, off)   type *var = (type *) ((data).GetData() + (off))
#define MAKE_RECORD_PTR(type, var, data, off)   type *var = (type *) ((data) + (off))
#define MAX_PACKET_SIZE   0x400
#define MESSAGE_RECORD_HEADER_SIZE   (sizeof(Barry::Protocol::MessageRecord) - sizeof(Barry::Protocol::CommonField))
#define MIN_PACKET_SIZE   6
#define OLD_DBDB_FIELD_HEADER_SIZE   (sizeof(Barry::Protocol::OldDBDBField) - 1)
#define OLD_DBDB_RECORD_HEADER_SIZE   (sizeof(Barry::Protocol::DBR_OldDBDBRecord) - sizeof(Barry::Protocol::OldDBDBField))
#define PACKED_FIELD_02_HEADER_SIZE   (sizeof(Barry::Protocol::PackedField_02) - 1)
#define PACKED_FIELD_10_HEADER_SIZE   (sizeof(Barry::Protocol::PackedField_10) - 1)
#define PASSWORD_CHALLENGE_HEADER_SIZE   (sizeof(Barry::Protocol::PasswordChallenge) - sizeof(Barry::Protocol::PasswordChallenge::Hash))
#define PASSWORD_CHALLENGE_SEED_SIZE   (PASSWORD_CHALLENGE_HEADER_SIZE + sizeof(uint32_t))
#define PASSWORD_CHALLENGE_SIZE   (sizeof(Barry::Protocol::PasswordChallenge))
#define SB_DBACCESS_HEADER_SIZE   (sizeof(Barry::Protocol::DBAccess) - sizeof(Barry::Protocol::DBAccess::DBData))
#define SB_DBACCESS_RETURN_CODE_SIZE   (1)
#define SB_FRAG_HEADER_SIZE   SB_PACKET_DBACCESS_HEADER_SIZE
#define SB_MODE_PACKET_COMMAND_SIZE   (SB_SOCKET_PACKET_HEADER_SIZE + sizeof(Barry::Protocol::ModeSelect) - sizeof(Barry::Protocol::ModeSelect::ResponseBlock))
#define SB_MODE_PACKET_RESPONSE_SIZE   (SB_SOCKET_PACKET_HEADER_SIZE + sizeof(Barry::Protocol::ModeSelect))
#define SB_PACKET_COMMAND_HEADER_SIZE   (SB_PACKET_DBACCESS_HEADER_SIZE + DB_COMMAND_HEADER_SIZE)
#define SB_PACKET_DBACCESS_HEADER_SIZE   (SB_PACKET_HEADER_SIZE + SB_DBACCESS_HEADER_SIZE)
#define SB_PACKET_DBDB_HEADER_SIZE   (SB_PACKET_RESPONSE_HEADER_SIZE + DBDB_RECORD_HEADER_SIZE)
#define SB_PACKET_HEADER_SIZE   (sizeof(Barry::Protocol::Packet) - sizeof(Barry::Protocol::Packet::PacketData))
#define SB_PACKET_OLD_DBDB_HEADER_SIZE   (SB_PACKET_RESPONSE_HEADER_SIZE + OLD_DBDB_RECORD_HEADER_SIZE)
#define SB_PACKET_RESPONSE_HEADER_SIZE   (SB_PACKET_DBACCESS_HEADER_SIZE + DB_RESPONSE_HEADER_SIZE)
#define SB_PACKET_UPLOAD_HEADER_SIZE   (SB_PACKET_DBACCESS_HEADER_SIZE + UPLOAD_HEADER_SIZE)
#define SB_SEQUENCE_PACKET_SIZE   (SB_PACKET_HEADER_SIZE + sizeof(Barry::Protocol::SequenceCommand))
#define SB_SOCKET_PACKET_HEADER_SIZE   (SB_PACKET_HEADER_SIZE + SOCKET_COMMAND_HEADER_SIZE)
#define SERVICE_BOOK_CONFIG_FIELD_HEADER_SIZE   (sizeof(Barry::Protocol::ServiceBookConfigField) - 1)
#define SOCKET_COMMAND_HEADER_SIZE   (sizeof(Barry::Protocol::SocketCommand) - sizeof(Barry::Protocol::SocketCommand::PacketData))

Functions

void Barry::Protocol::CheckSize (const Data &packet, size_t requiredsize)
unsigned int Barry::Protocol::GetSize (const Data &packet)

Variables

union Barry::Protocol::SizePacket Barry::Protocol::packed


Generated by  Doxygen 1.6.0   Back to index