Lines Matching refs:len

222 static int write_ssl_data( mbedtls_ssl_context *ssl, unsigned char *buf, size_t len )  in write_ssl_data()  argument
227 while( len && ( ret = mbedtls_ssl_write( ssl, buf, len ) ) <= 0 ) in write_ssl_data()
239 static int write_ssl_and_get_response( mbedtls_ssl_context *ssl, unsigned char *buf, size_t len ) in write_ssl_and_get_response() argument
247 while( len && ( ret = mbedtls_ssl_write( ssl, buf, len ) ) <= 0 ) in write_ssl_and_get_response()
258 len = sizeof( data ) - 1; in write_ssl_and_get_response()
260 ret = mbedtls_ssl_read( ssl, data, len ); in write_ssl_and_get_response()
275 len = ret; in write_ssl_and_get_response()
276 for( i = 0; i < len; i++ ) in write_ssl_and_get_response()
297 static int write_and_get_response( mbedtls_net_context *sock_fd, unsigned char *buf, size_t len ) in write_and_get_response() argument
305 if( len && ( ret = mbedtls_net_send( sock_fd, buf, len ) ) <= 0 ) in write_and_get_response()
313 len = sizeof( data ) - 1; in write_and_get_response()
315 ret = mbedtls_net_recv( sock_fd, data, len ); in write_and_get_response()
323 data[len] = '\0'; in write_and_get_response()
325 len = ret; in write_and_get_response()
326 for( i = 0; i < len; i++ ) in write_and_get_response()
349 int ret = 0, len; in main() local
649 len = sprintf( (char *) buf, "EHLO %s\r\n", hostname ); in main()
650 ret = write_ssl_and_get_response( &ssl, buf, len ); in main()
675 len = sprintf( (char *) buf, "EHLO %s\r\n", hostname ); in main()
676 ret = write_and_get_response( &server_fd, buf, len ); in main()
689 len = sprintf( (char *) buf, "STARTTLS\r\n" ); in main()
690 ret = write_and_get_response( &server_fd, buf, len ); in main()
709 len = sprintf( (char *) buf, "AUTH LOGIN\r\n" ); in main()
710 ret = write_ssl_and_get_response( &ssl, buf, len ); in main()
729 len = sprintf( (char *) buf, "%s\r\n", base ); in main()
730 ret = write_ssl_and_get_response( &ssl, buf, len ); in main()
749 len = sprintf( (char *) buf, "%s\r\n", base ); in main()
750 ret = write_ssl_and_get_response( &ssl, buf, len ); in main()
764 len = sprintf( (char *) buf, "MAIL FROM:<%s>\r\n", opt.mail_from ); in main()
765 ret = write_ssl_and_get_response( &ssl, buf, len ); in main()
777 len = sprintf( (char *) buf, "RCPT TO:<%s>\r\n", opt.mail_to ); in main()
778 ret = write_ssl_and_get_response( &ssl, buf, len ); in main()
790 len = sprintf( (char *) buf, "DATA\r\n" ); in main()
791 ret = write_ssl_and_get_response( &ssl, buf, len ); in main()
803 len = sprintf( (char *) buf, "From: %s\r\nSubject: mbed TLS Test mail\r\n\r\n" in main()
808 ret = write_ssl_data( &ssl, buf, len ); in main()
810 len = sprintf( (char *) buf, "\r\n.\r\n"); in main()
811 ret = write_ssl_and_get_response( &ssl, buf, len ); in main()