]>
git.saurik.com Git - apple/xnu.git/blob - osfmk/kdp/kdp_core.h
a716146be137c094847bd5789a221d159f69aa87
2 * Copyright (c) 2003 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * The contents of this file constitute Original Code as defined in and
7 * are subject to the Apple Public Source License Version 1.1 (the
8 * "License"). You may not use this file except in compliance with the
9 * License. Please obtain a copy of the License at
10 * http://www.apple.com/publicsource and read it before using this file.
12 * This Original Code and all software distributed under the License are
13 * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
14 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
15 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
17 * License for the specific language governing rights and limitations
20 * @APPLE_LICENSE_HEADER_END@
24 * 8 Aug. 2003 - Created (Derek Kumar)
27 /* Various protocol definitions
28 * for the core transfer protocol, which is a variant of TFTP
34 #define KDP_RRQ 1 /* read request */
35 #define KDP_WRQ 2 /* write request */
36 #define KDP_DATA 3 /* data packet */
37 #define KDP_ACK 4 /* acknowledgement */
38 #define KDP_ERROR 5 /* error code */
39 #define KDP_SEEK 6 /* Seek to specified offset */
40 #define KDP_EOF 7 /* signal end of file */
42 short th_opcode
; /* packet type */
44 unsigned int tu_block
; /* block # */
45 unsigned int tu_code
; /* error code */
46 char tu_rpl
[1]; /* request packet payload */
48 char th_data
[1]; /* data or error string */
49 }__attribute__((packed
));
51 #define th_block th_u.tu_block
52 #define th_code th_u.tu_code
53 #define th_stuff th_u.tu_rpl
54 #define th_msg th_data
59 #define EUNDEF 0 /* not defined */
60 #define ENOTFOUND 1 /* file not found */
61 #define EACCESS 2 /* access violation */
62 #define ENOSPACE 3 /* disk full or allocation exceeded */
63 #define EBADOP 4 /* illegal TFTP operation */
64 #define EBADID 5 /* unknown transfer ID */
65 #define EEXISTS 6 /* file already exists */
66 #define ENOUSER 7 /* no such user */
68 #define CORE_REMOTE_PORT 1069 /* hardwired, we can't really query the services file */
70 void kdp_panic_dump (void);
72 void abort_panic_transfer (void);
74 struct corehdr
*create_panic_header(unsigned int request
, const char *corename
, unsigned length
, unsigned block
);
76 int kdp_send_panic_pkt (unsigned int request
, char *corename
, unsigned int length
, void *panic_data
);