Select one of the symbols to view example projects that use it.
 
Outline
#define __TFTPSERVER_H_
#include "lwip/mem.h"
#include "lwip/udp.h"
#define TFTP_OPCODE_LEN
#define TFTP_BLKNUM_LEN
#define TFTP_DATA_LEN_MAX
#define TFTP_DATA_PKT_HDR_LEN
#define TFTP_ERR_PKT_HDR_LEN
#define TFTP_ACK_PKT_LEN
#define TFTP_DATA_PKT_LEN_MAX
#define TFTP_MAX_RETRIES
#define TFTP_TIMEOUT_INTERVAL
tftp_connection_args
tftp_opcode
tftp_errorcode
IAP_tftpd_init();
Files
loading...
CodeScopeSTM32 Libraries and SamplesLwIP_IAPInc/tftpserver.h
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
/** ****************************************************************************** * @file LwIP/LwIP_TFTP_Server/Inc/tftpserver.h * @author MCD Application Team * @brief This file is the header of tftpserver file. ****************************************************************************** * @attention * * Copyright (c) 2017 STMicroelectronics. * All rights reserved. * * This software is licensed under terms that can be found in the LICENSE file * in the root directory of this software component. * If no LICENSE file comes with this software, it is provided AS-IS. * ****************************************************************************** *//* ... */ #ifndef __TFTPSERVER_H_ #define __TFTPSERVER_H_ #include "lwip/mem.h" #include "lwip/udp.h" #define TFTP_OPCODE_LEN 2 #define TFTP_BLKNUM_LEN 2 #define TFTP_DATA_LEN_MAX 512 #define TFTP_DATA_PKT_HDR_LEN (TFTP_OPCODE_LEN + TFTP_BLKNUM_LEN) #define TFTP_ERR_PKT_HDR_LEN (TFTP_OPCODE_LEN + TFTP_ERRCODE_LEN) #define TFTP_ACK_PKT_LEN (TFTP_OPCODE_LEN + TFTP_BLKNUM_LEN) #define TFTP_DATA_PKT_LEN_MAX (TFTP_DATA_PKT_HDR_LEN + TFTP_DATA_LEN_MAX) #define TFTP_MAX_RETRIES 3 #define TFTP_TIMEOUT_INTERVAL 5 9 defines typedef struct { int op; /*WRQ */ /* last block read */ char data[TFTP_DATA_PKT_LEN_MAX]; int data_len; /* destination ip:port */ ip_addr_t to_ip; int to_port; /* next block number */ int block; /* total number of bytes transferred */ int tot_bytes; /* timer interrupt count when last packet was sent */ /* this should be used to resend packets on timeout */ unsigned long long last_time; ...}tftp_connection_args; /* TFTP opcodes as specified in RFC1350 */ typedef enum { TFTP_RRQ = 1, TFTP_WRQ = 2, TFTP_DATA = 3, TFTP_ACK = 4, TFTP_ERROR = 5 ...} tftp_opcode; /* TFTP error codes as specified in RFC1350 */ typedef enum { TFTP_ERR_NOTDEFINED, TFTP_ERR_FILE_NOT_FOUND, TFTP_ERR_ACCESS_VIOLATION, TFTP_ERR_DISKFULL, TFTP_ERR_ILLEGALOP, TFTP_ERR_UKNOWN_TRANSFER_ID, TFTP_ERR_FILE_ALREADY_EXISTS, TFTP_ERR_NO_SUCH_USER, ...} tftp_errorcode; void IAP_tftpd_init(void); /* ... */ #endif