📄 tftpput.c
字号:
#include "net.h"
#include "eth.h"
#include "ip.h"
#include "udp.h"
#include "tftp.h"
#include "utils.h"
#include "tcpserver.h"
#include "tcp.h"
extern CONNECTION conxn[];
extern ulong my_ipaddr;
extern char text[];
extern UCHAR rcve_buf_allocated;
extern UCHAR debug;
int count=0;
int tftp_put(char* inbuf, int buflen)
{
int i;
UCHAR* outbuf;
{
for (i=0; i < 5; i++)
{
//轮询5个连接, 如有效,则发送数据;
if (conxn[i].ipaddr!=0 && (conxn[i].state==STATE_ESTABLISHED))
{
outbuf = TX_BUFF;
if (outbuf == 0)
{
return 0;
}
memcpy(outbuf + 54, inbuf, buflen);
tcp_server_send(outbuf, 20 + buflen, i);
conxn[i].my_sequence += buflen;
}
}
count = 0;
}
return 0;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -