ThirdParty/sw_services/lwip211/examples/freertos_lwip_example_tftp_client.c
static int tftp_send_error_packet(int sd, struct sockaddr_in *to,
		tftp_errorcode err)
{
	char buf[TFTP_MAX_ERR_MSG_LEN] = {0};
	/* total packet length */
	int len = TFTP_PACKET_HDR_LEN + strlen(tftp_errorcode_string[err]) + 1;

	tftp_set_opcode(buf, TFTP_ERROR);
	tftp_set_errcode(buf, err);
	tftp_set_errmsg(buf, tftp_errorcode_string[err]);

	return tftp_send_packet(sd, to, buf, len);
}
/* construct and send an error packet to client */
construct and send an error packet to client
construct and send an error packet to client
static int tftp_send_error_packet(int sd, struct sockaddr_in *to,
		tftp_errorcode err)
{
	char buf[TFTP_MAX_ERR_MSG_LEN] = {0};
	int len = TFTP_PACKET_HDR_LEN + strlen(tftp_errorcode_string[err]) + 1;
	tftp_set_opcode(buf, TFTP_ERROR);
	tftp_set_errcode(buf, err);
	tftp_set_errmsg(buf, tftp_errorcode_string[err]);
	return tftp_send_packet(sd, to, buf, len);
}
static int tftp_send_error_packet ( int sd , struct sockaddr_in * to , tftp_errorcode err ) { char buf [ TFTP_MAX_ERR_MSG_LEN ] = { 0 } ; int len = TFTP_PACKET_HDR_LEN + strlen ( tftp_errorcode_string [ err ] ) + 1 ; tftp_set_opcode ( buf , TFTP_ERROR ) ; tftp_set_errcode ( buf , err ) ; tftp_set_errmsg ( buf , tftp_errorcode_string [ err ] ) ; return tftp_send_packet ( sd , to , buf , len ) ; }
construct and send an error packet to client
construct and send an error packet to client
/* total packet length */