diff options
| author | Peter Maydell <peter.maydell@linaro.org> | 2019-03-08 11:55:53 +0000 |
|---|---|---|
| committer | Peter Maydell <peter.maydell@linaro.org> | 2019-03-08 11:55:53 +0000 |
| commit | 6bbbe16a02ecf631fffb4a339e1c662d60a1e529 (patch) | |
| tree | 5e847e5af195f8399a8d18ba88bc91e2d06aac57 /slirp/src/tftp.h | |
| parent | e56d931a9ddee7230f647a25ada33ee19d26aa6d (diff) | |
| parent | be1911ff7504be95d5cf2c18bc99ce07246a91e5 (diff) | |
| download | focaccia-qemu-6bbbe16a02ecf631fffb4a339e1c662d60a1e529.tar.gz focaccia-qemu-6bbbe16a02ecf631fffb4a339e1c662d60a1e529.zip | |
Merge remote-tracking branch 'remotes/thibault/tags/samuel-thibault' into staging
Slirp updates Greg Kurz (1): slirp: Fix build with gcc 9 Marc-André Lureau (7): slirp: adapt a subset of QEMU vmstate code slirp: use libslirp migration code slirp: use "slirp_" prefix for inet_aton() win32 implementation slirp: move sources to src/ subdirectory slirp: add a standalone Makefile build-sys: link with slirp as an external project slirp: remove QEMU Makefile.objs Samuel Thibault (2): slirp: fix big/little endian conversion in ident protocol slirp: Mark pieces missing IPv6 support Vic Lee (1): slirp: check for ioctlsocket error and 0-length udp payload. William Bowling (1): slirp: check sscanf result when emulating ident # gpg: Signature made Thu 07 Mar 2019 11:51:20 GMT # gpg: using RSA key E61DBB15D4172BDEC97E92D9DB550E89F0FA54F3 # gpg: Good signature from "Samuel Thibault <samuel.thibault@aquilenet.fr>" [unknown] # gpg: aka "Samuel Thibault <sthibault@debian.org>" [marginal] # gpg: aka "Samuel Thibault <samuel.thibault@gnu.org>" [unknown] # gpg: aka "Samuel Thibault <samuel.thibault@inria.fr>" [marginal] # gpg: aka "Samuel Thibault <samuel.thibault@labri.fr>" [marginal] # gpg: aka "Samuel Thibault <samuel.thibault@ens-lyon.org>" [marginal] # gpg: aka "Samuel Thibault <samuel.thibault@u-bordeaux.fr>" [unknown] # gpg: WARNING: This key is not certified with sufficiently trusted signatures! # gpg: It is not certain that the signature belongs to the owner. # Primary key fingerprint: 900C B024 B679 31D4 0F82 304B D017 8C76 7D06 9EE6 # Subkey fingerprint: E61D BB15 D417 2BDE C97E 92D9 DB55 0E89 F0FA 54F3 * remotes/thibault/tags/samuel-thibault: slirp: remove QEMU Makefile.objs build-sys: link with slirp as an external project slirp: add a standalone Makefile slirp: move sources to src/ subdirectory slirp: use "slirp_" prefix for inet_aton() win32 implementation slirp: use libslirp migration code slirp: adapt a subset of QEMU vmstate code slirp: Mark pieces missing IPv6 support slirp: fix big/little endian conversion in ident protocol slirp: check sscanf result when emulating ident slirp: check for ioctlsocket error and 0-length udp payload. slirp: Fix build with gcc 9 Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'slirp/src/tftp.h')
| -rw-r--r-- | slirp/src/tftp.h | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/slirp/src/tftp.h b/slirp/src/tftp.h new file mode 100644 index 0000000000..a4c4a64e64 --- /dev/null +++ b/slirp/src/tftp.h @@ -0,0 +1,51 @@ +/* tftp defines */ + +#ifndef SLIRP_TFTP_H +#define SLIRP_TFTP_H + +#define TFTP_SESSIONS_MAX 20 + +#define TFTP_SERVER 69 + +#define TFTP_RRQ 1 +#define TFTP_WRQ 2 +#define TFTP_DATA 3 +#define TFTP_ACK 4 +#define TFTP_ERROR 5 +#define TFTP_OACK 6 + +#define TFTP_FILENAME_MAX 512 +#define TFTP_BLOCKSIZE_MAX 1428 + +struct tftp_t { + struct udphdr udp; + uint16_t tp_op; + union { + struct { + uint16_t tp_block_nr; + uint8_t tp_buf[TFTP_BLOCKSIZE_MAX]; + } tp_data; + struct { + uint16_t tp_error_code; + uint8_t tp_msg[TFTP_BLOCKSIZE_MAX]; + } tp_error; + char tp_buf[TFTP_BLOCKSIZE_MAX + 2]; + } x; +} __attribute__((packed)); + +struct tftp_session { + Slirp *slirp; + char *filename; + int fd; + uint16_t block_size; + + struct sockaddr_storage client_addr; + uint16_t client_port; + uint32_t block_nr; + + int timestamp; +}; + +void tftp_input(struct sockaddr_storage *srcsas, struct mbuf *m); + +#endif |