]>
git.saurik.com Git - apple/xnu.git/blob - osfmk/kdp/kdp_core.h
d5723d916477835a38fe8ca4da7831bf2d89b971
2 * Copyright (c) 2003 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_OSREFERENCE_HEADER_START@
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. The rights granted to you under the
10 * License may not be used to create, or enable the creation or
11 * redistribution of, unlawful or unlicensed copies of an Apple operating
12 * system, or to circumvent, violate, or enable the circumvention or
13 * violation of, any terms of an Apple operating system software license
16 * Please obtain a copy of the License at
17 * http://www.opensource.apple.com/apsl/ and read it before using this
20 * The Original Code and all software distributed under the License are
21 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
22 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
23 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
24 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
25 * Please see the License for the specific language governing rights and
26 * limitations under the License.
28 * @APPLE_LICENSE_OSREFERENCE_HEADER_END@
32 * 8 Aug. 2003 - Created (Derek Kumar)
35 /* Various protocol definitions
36 * for the core transfer protocol, which is a variant of TFTP
42 #define KDP_RRQ 1 /* read request */
43 #define KDP_WRQ 2 /* write request */
44 #define KDP_DATA 3 /* data packet */
45 #define KDP_ACK 4 /* acknowledgement */
46 #define KDP_ERROR 5 /* error code */
47 #define KDP_SEEK 6 /* Seek to specified offset */
48 #define KDP_EOF 7 /* signal end of file */
50 short th_opcode
; /* packet type */
52 unsigned int tu_block
; /* block # */
53 unsigned int tu_code
; /* error code */
54 char tu_rpl
[1]; /* request packet payload */
56 char th_data
[1]; /* data or error string */
57 }__attribute__((packed
));
59 #define th_block th_u.tu_block
60 #define th_code th_u.tu_code
61 #define th_stuff th_u.tu_rpl
62 #define th_msg th_data
67 #define EUNDEF 0 /* not defined */
68 #define ENOTFOUND 1 /* file not found */
69 #define EACCESS 2 /* access violation */
70 #define ENOSPACE 3 /* disk full or allocation exceeded */
71 #define EBADOP 4 /* illegal TFTP operation */
72 #define EBADID 5 /* unknown transfer ID */
73 #define EEXISTS 6 /* file already exists */
74 #define ENOUSER 7 /* no such user */
76 #define CORE_REMOTE_PORT 1069 /* hardwired, we can't really query the services file */
78 void kdp_panic_dump (void);
80 void abort_panic_transfer (void);
82 struct corehdr
*create_panic_header(unsigned int request
, const char *corename
, unsigned length
, unsigned block
);
84 int kdp_send_crashdump_pkt(unsigned int request
, char *corename
,
85 unsigned int length
, void *panic_data
);
87 int kdp_send_crashdump_data(unsigned int request
, char *corename
,
88 unsigned int length
, caddr_t txstart
);