]>
git.saurik.com Git - apple/xnu.git/blob - osfmk/kdp/kdp_core.h
1 /* Various protocol definitions
2 * for the core transfer protocol, which is a variant of TFTP
8 #define KDP_RRQ 1 /* read request */
9 #define KDP_WRQ 2 /* write request */
10 #define KDP_DATA 3 /* data packet */
11 #define KDP_ACK 4 /* acknowledgement */
12 #define KDP_ERROR 5 /* error code */
13 #define KDP_SEEK 6 /* Seek to specified offset */
14 #define KDP_EOF 7 /* signal end of file */
16 short th_opcode
; /* packet type */
18 unsigned int tu_block
; /* block # */
19 unsigned int tu_code
; /* error code */
20 char tu_rpl
[1]; /* request packet payload */
22 char th_data
[1]; /* data or error string */
23 }__attribute__((packed
));
25 #define th_block th_u.tu_block
26 #define th_code th_u.tu_code
27 #define th_stuff th_u.tu_rpl
28 #define th_msg th_data
33 #define EUNDEF 0 /* not defined */
34 #define ENOTFOUND 1 /* file not found */
35 #define EACCESS 2 /* access violation */
36 #define ENOSPACE 3 /* disk full or allocation exceeded */
37 #define EBADOP 4 /* illegal TFTP operation */
38 #define EBADID 5 /* unknown transfer ID */
39 #define EEXISTS 6 /* file already exists */
40 #define ENOUSER 7 /* no such user */
42 #define CORE_REMOTE_PORT 1069 /* hardwired, we can't really query the services file */
44 void kdp_panic_dump (void);
46 void abort_panic_transfer (void);
48 struct corehdr
*create_panic_header(unsigned int request
, const char *corename
, unsigned length
, unsigned block
);
50 int kdp_send_panic_pkt (unsigned int request
, char *corename
, unsigned int length
, void *panic_data
);