ThirdParty/sw_services/lwip211/examples/lwip_example_tftp_server.c
static int tftp_send_data_packet(struct udp_pcb *pcb, ip_addr_t *to,
		int to_port, int block, char *buf, int buflen)
{
	char packet[TFTP_MAX_MSG_LEN] = {0};

	tftp_set_opcode(packet, TFTP_DATA);
	tftp_set_block_value(packet, block);
	tftp_set_data(packet, buf, buflen);

	return tftp_send_packet(pcb, to, to_port, packet,
			buflen + TFTP_PACKET_HDR_LEN);
}
/* construct and send a data packet */
construct and send a data packet
construct and send a data packet
static int tftp_send_data_packet(struct udp_pcb *pcb, ip_addr_t *to,
		int to_port, int block, char *buf, int buflen)
{
	char packet[TFTP_MAX_MSG_LEN] = {0};
	tftp_set_opcode(packet, TFTP_DATA);
	tftp_set_block_value(packet, block);
	tftp_set_data(packet, buf, buflen);
	return tftp_send_packet(pcb, to, to_port, packet,
			buflen + TFTP_PACKET_HDR_LEN);
}
static int tftp_send_data_packet ( struct udp_pcb * pcb , ip_addr_t * to , int to_port , int block , char * buf , int buflen ) { char packet [ TFTP_MAX_MSG_LEN ] = { 0 } ; tftp_set_opcode ( packet , TFTP_DATA ) ; tftp_set_block_value ( packet , block ) ; tftp_set_data ( packet , buf , buflen ) ; return tftp_send_packet ( pcb , to , to_port , packet , buflen + TFTP_PACKET_HDR_LEN ) ; }
construct and send a data packet
construct and send a data packet