1 | /* $Id: tftp.h 98103 2023-01-17 14:15:46Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * NAT - TFTP server (declarations/defines).
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2006-2023 Oracle and/or its affiliates.
|
---|
8 | *
|
---|
9 | * This file is part of VirtualBox base platform packages, as
|
---|
10 | * available from https://www.virtualbox.org.
|
---|
11 | *
|
---|
12 | * This program is free software; you can redistribute it and/or
|
---|
13 | * modify it under the terms of the GNU General Public License
|
---|
14 | * as published by the Free Software Foundation, in version 3 of the
|
---|
15 | * License.
|
---|
16 | *
|
---|
17 | * This program is distributed in the hope that it will be useful, but
|
---|
18 | * WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
---|
20 | * General Public License for more details.
|
---|
21 | *
|
---|
22 | * You should have received a copy of the GNU General Public License
|
---|
23 | * along with this program; if not, see <https://www.gnu.org/licenses>.
|
---|
24 | *
|
---|
25 | * SPDX-License-Identifier: GPL-3.0-only
|
---|
26 | */
|
---|
27 |
|
---|
28 | /* tftp defines */
|
---|
29 |
|
---|
30 | #ifndef _SLIRP_TFTP_H_
|
---|
31 | #define _SLIRP_TFTP_H_
|
---|
32 |
|
---|
33 | #define TFTP_SESSIONS_MAX 3
|
---|
34 |
|
---|
35 | #define TFTP_SERVER 69
|
---|
36 |
|
---|
37 | #define TFTP_RRQ 1
|
---|
38 | #define TFTP_WRQ 2
|
---|
39 | #define TFTP_DATA 3
|
---|
40 | #define TFTP_ACK 4
|
---|
41 | #define TFTP_ERROR 5
|
---|
42 | #define TFTP_OACK 6
|
---|
43 |
|
---|
44 | /* error codes */
|
---|
45 | #define TFTP_EUNDEF 0 /* Not defined, see error message (if any). */
|
---|
46 | #define TFTP_ENOENT 1 /* File not found. */
|
---|
47 | #define TFTP_EACCESS 2 /* Access violation. */
|
---|
48 | #define TFTP_EFBIG 3 /* Disk full or allocation exceeded. */
|
---|
49 | #define TFTP_ENOSYS 4 /* Illegal TFTP operation. */
|
---|
50 | #define TFTP_ESRCH 5 /* Unknown transfer ID. */
|
---|
51 | #define TFTP_EEXIST 6 /* File already exists. */
|
---|
52 | #define TFTP_EUSER 7 /* No such user. */
|
---|
53 | /* RFC 2347 */
|
---|
54 | #define TFTP_EONAK 8 /* Option refused. */
|
---|
55 |
|
---|
56 |
|
---|
57 | #define TFTP_FILENAME_MAX 512
|
---|
58 |
|
---|
59 |
|
---|
60 | int slirpTftpInput(PNATState pData, struct mbuf *m);
|
---|
61 | int slirpTftpInit(PNATState pData);
|
---|
62 | void slirpTftpTerm(PNATState pData);
|
---|
63 | #endif
|
---|