1 | /*␊ |
2 | * Copyright (c) 1999-2003 Apple Computer, Inc. All rights reserved.␊ |
3 | *␊ |
4 | * Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights␊ |
5 | * Reserved. This file contains Original Code and/or Modifications of␊ |
6 | * Original Code as defined in and that are subject to the Apple Public␊ |
7 | * Source License Version 2.0 (the "License"). You may not use this file␊ |
8 | * except in compliance with the License. Please obtain a copy of the␊ |
9 | * License at http://www.apple.com/publicsource and read it before using␊ |
10 | * this file.␊ |
11 | * ␊ |
12 | * The 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␊ |
18 | * under the License.␊ |
19 | * ␊ |
20 | */␊ |
21 | ␊ |
22 | #ifndef __LIBSAIO_NBP_CMD_H␊ |
23 | #define __LIBSAIO_NBP_CMD_H␊ |
24 | ␊ |
25 | #include <IOKit/IOTypes.h>␊ |
26 | ␊ |
27 | /*==========================================================================␊ |
28 | * NBP return status codes.␊ |
29 | */␊ |
30 | typedef enum {␊ |
31 | nbpStatusSuccess = 0,␊ |
32 | nbpStatusFailed,␊ |
33 | ␉nbpStatusInvalid,␊ |
34 | } nbpStatus_t;␊ |
35 | ␊ |
36 | /*==========================================================================␊ |
37 | * NBP commands codes.␊ |
38 | */␊ |
39 | typedef enum {␊ |
40 | nbpCommandTFTPReadFile = 1,␊ |
41 | nbpCommandTFTPGetFileSize,␊ |
42 | nbpCommandUnloadBaseCode,␊ |
43 | } nbpCommandCode_t;␊ |
44 | ␊ |
45 | /*==========================================================================␊ |
46 | * NBP commands.␊ |
47 | */␊ |
48 | typedef struct {␊ |
49 | UInt32 status; /* return code from NBP */␊ |
50 | } nbpCommandHeader_s;␊ |
51 | ␊ |
52 | typedef struct {␊ |
53 | UInt32 status; /* return code from NBP */␊ |
54 | UInt8 filename[128]; /* name of file to be downloaded */␊ |
55 | UInt32 bufferSize; /* size of the download buffer */␊ |
56 | UInt32 buffer; /* physical address of the download buffer */␊ |
57 | } nbpCommandTFTPReadFile_s;␊ |
58 | ␊ |
59 | typedef struct {␊ |
60 | UInt32 status; /* return code from NBP */␊ |
61 | UInt8 filename[128]; /* name of file to be downloaded */␊ |
62 | UInt32 filesize; /* size of the file specified */␊ |
63 | } nbpCommandTFTPGetFileSize_s;␊ |
64 | ␊ |
65 | typedef struct {␊ |
66 | UInt32 status; /* return code from NBP */␊ |
67 | UInt8 sname[64]; /* server name */␊ |
68 | UInt32 CIP; /* client IP address */␊ |
69 | UInt32 SIP; /* server IP address */␊ |
70 | UInt32 GIP; /* gateway IP address */␊ |
71 | } nbpCommandGetNetworkInfo_s;␊ |
72 | ␊ |
73 | /*==========================================================================␊ |
74 | * An union of all NBP command structures.␊ |
75 | */␊ |
76 | typedef union {␊ |
77 | ␉nbpCommandHeader_s header;␊ |
78 | ␉nbpCommandTFTPReadFile_s tftpReadFile;␊ |
79 | ␉nbpCommandTFTPGetFileSize_s tftpFileSize;␊ |
80 | } nbpCommand_u;␊ |
81 | ␊ |
82 | #endif /* !__LIBSAIO_NBP_CMD_H */␊ |
83 | |