summaryrefslogtreecommitdiffstats
path: root/src/AFC.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/AFC.h')
-rw-r--r--src/AFC.h18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/AFC.h b/src/AFC.h
index 86a924e..41b4d67 100644
--- a/src/AFC.h
+++ b/src/AFC.h
@@ -27,14 +27,18 @@
27#include <stdlib.h> 27#include <stdlib.h>
28#include <sys/stat.h> 28#include <sys/stat.h>
29#include <glib.h> 29#include <glib.h>
30#include <stdint.h>
31
32#define AFC_MAGIC "CFA6LPAA"
33#define AFC_MAGIC_LEN (8)
30 34
31typedef struct { 35typedef struct {
32 uint32_t header1, header2; 36 char magic[AFC_MAGIC_LEN];
33 uint32_t entire_length, unknown1, this_length, unknown2, packet_num, unknown3, operation, unknown4; 37 uint64_t entire_length, this_length, packet_num, operation;
34} AFCPacket; 38} AFCPacket;
35 39
36typedef struct { 40typedef struct {
37 uint32_t filehandle, unknown1, size, unknown2; 41 uint64_t filehandle, size;
38} AFCFilePacket; 42} AFCFilePacket;
39 43
40typedef struct __AFCToken { 44typedef struct __AFCToken {
@@ -47,11 +51,16 @@ struct iphone_afc_client_int {
47 AFCPacket *afc_packet; 51 AFCPacket *afc_packet;
48 int file_handle; 52 int file_handle;
49 int lock; 53 int lock;
54 int afcerror;
50 GMutex *mutex; 55 GMutex *mutex;
51}; 56};
52 57
53struct iphone_afc_file_int { 58struct iphone_afc_file_int {
54 uint32_t filehandle, blocks, size, type; 59 uint32_t filehandle;
60 uint32_t blocks;
61 off_t size;
62 uint32_t mode;
63 uint32_t nlink;
55}; 64};
56 65
57 66
@@ -88,3 +97,4 @@ enum {
88}; 97};
89 98
90uint32_t iphone_afc_get_file_handle(iphone_afc_file_t file); 99uint32_t iphone_afc_get_file_handle(iphone_afc_file_t file);
100static int afcerror_to_errno(int afcerror);