Lines Matching refs:len
588 size_t len = 0; in do_SOCKS5() local
735 len = 0; in do_SOCKS5()
736 socksreq[len++] = 1; /* username/pw subnegotiation version */ in do_SOCKS5()
737 socksreq[len++] = (unsigned char) proxy_user_len; in do_SOCKS5()
744 memcpy(socksreq + len, sx->proxy_user, proxy_user_len); in do_SOCKS5()
746 len += proxy_user_len; in do_SOCKS5()
747 socksreq[len++] = (unsigned char) proxy_password_len; in do_SOCKS5()
754 memcpy(socksreq + len, sx->proxy_password, proxy_password_len); in do_SOCKS5()
756 len += proxy_password_len; in do_SOCKS5()
758 DEBUGASSERT(len <= sizeof(sx->buffer)); in do_SOCKS5()
759 sx->outstanding = len; in do_SOCKS5()
858 len = 0; in do_SOCKS5()
859 socksreq[len++] = 5; /* version (SOCKS5) */ in do_SOCKS5()
860 socksreq[len++] = 1; /* connect */ in do_SOCKS5()
861 socksreq[len++] = 0; /* must be zero */ in do_SOCKS5()
865 socksreq[len++] = 1; /* ATYP: IPv4 = 1 */ in do_SOCKS5()
869 socksreq[len++] = ((unsigned char *)&saddr_in->sin_addr.s_addr)[i]; in do_SOCKS5()
879 socksreq[len++] = 4; /* ATYP: IPv6 = 4 */ in do_SOCKS5()
883 socksreq[len++] = in do_SOCKS5()
902 len = 0; in do_SOCKS5()
903 socksreq[len++] = 5; /* version (SOCKS5) */ in do_SOCKS5()
904 socksreq[len++] = 1; /* connect */ in do_SOCKS5()
905 socksreq[len++] = 0; /* must be zero */ in do_SOCKS5()
917 socksreq[len++] = 4; in do_SOCKS5()
918 memcpy(&socksreq[len], ip6, sizeof(ip6)); in do_SOCKS5()
919 len += sizeof(ip6); in do_SOCKS5()
924 socksreq[len++] = 1; in do_SOCKS5()
925 memcpy(&socksreq[len], ip4, sizeof(ip4)); in do_SOCKS5()
926 len += sizeof(ip4); in do_SOCKS5()
929 socksreq[len++] = 3; in do_SOCKS5()
930 socksreq[len++] = (unsigned char) hostname_len; /* one byte length */ in do_SOCKS5()
931 memcpy(&socksreq[len], sx->hostname, hostname_len); /* w/o NULL */ in do_SOCKS5()
932 len += hostname_len; in do_SOCKS5()
942 socksreq[len++] = (unsigned char)((sx->remote_port >> 8) & 0xff); in do_SOCKS5()
944 socksreq[len++] = (unsigned char)(sx->remote_port & 0xff); in do_SOCKS5()
953 DEBUGASSERT(len <= sizeof(sx->buffer)); in do_SOCKS5()
954 sx->outstanding = len; in do_SOCKS5()
1033 len = 5 + addrlen + 2; in do_SOCKS5()
1037 len = 4 + 16 + 2; in do_SOCKS5()
1040 len = 4 + 4 + 2; in do_SOCKS5()
1052 if(len > 10) { in do_SOCKS5()
1053 DEBUGASSERT(len <= sizeof(sx->buffer)); in do_SOCKS5()
1054 sx->outstanding = len - 10; /* get the rest */ in do_SOCKS5()