• Home
  • Raw
  • Download

Lines Matching refs:socksreq

116   unsigned char socksreq[SOCKS4REQLEN]; /* room for SOCKS4 request incl. user  in Curl_SOCKS4()  local
147 socksreq[0] = 4; /* version (SOCKS4) */ in Curl_SOCKS4()
148 socksreq[1] = 1; /* connect */ in Curl_SOCKS4()
149 socksreq[2] = (unsigned char)((remote_port >> 8) & 0xff); /* PORT MSB */ in Curl_SOCKS4()
150 socksreq[3] = (unsigned char)(remote_port & 0xff); /* PORT LSB */ in Curl_SOCKS4()
181 socksreq[4] = ((unsigned char *)&saddr_in->sin_addr.s_addr)[0]; in Curl_SOCKS4()
182 socksreq[5] = ((unsigned char *)&saddr_in->sin_addr.s_addr)[1]; in Curl_SOCKS4()
183 socksreq[6] = ((unsigned char *)&saddr_in->sin_addr.s_addr)[2]; in Curl_SOCKS4()
184 socksreq[7] = ((unsigned char *)&saddr_in->sin_addr.s_addr)[3]; in Curl_SOCKS4()
206 socksreq[8] = 0; /* ensure empty userid is NUL-terminated */ in Curl_SOCKS4()
209 if(plen >= sizeof(socksreq) - 8) { in Curl_SOCKS4()
214 memcpy(socksreq + 8, proxy_user, plen + 1); in Curl_SOCKS4()
226 strlen((char *)socksreq + 8); /* size including NUL */ in Curl_SOCKS4()
230 socksreq[4] = 0; in Curl_SOCKS4()
231 socksreq[5] = 0; in Curl_SOCKS4()
232 socksreq[6] = 0; in Curl_SOCKS4()
233 socksreq[7] = 1; in Curl_SOCKS4()
237 strcpy((char *)socksreq + packetsize, hostname); in Curl_SOCKS4()
243 code = Curl_write_plain(conn, sock, (char *)socksreq, in Curl_SOCKS4()
264 result = Curl_blockread_all(conn, sock, (char *)socksreq, packetsize, in Curl_SOCKS4()
291 if(socksreq[0] != 0) { in Curl_SOCKS4()
298 switch(socksreq[1]) { in Curl_SOCKS4()
306 (unsigned char)socksreq[4], (unsigned char)socksreq[5], in Curl_SOCKS4()
307 (unsigned char)socksreq[6], (unsigned char)socksreq[7], in Curl_SOCKS4()
308 (((unsigned char)socksreq[2] << 8) | (unsigned char)socksreq[3]), in Curl_SOCKS4()
309 (unsigned char)socksreq[1]); in Curl_SOCKS4()
316 (unsigned char)socksreq[4], (unsigned char)socksreq[5], in Curl_SOCKS4()
317 (unsigned char)socksreq[6], (unsigned char)socksreq[7], in Curl_SOCKS4()
318 (((unsigned char)socksreq[2] << 8) | (unsigned char)socksreq[3]), in Curl_SOCKS4()
319 (unsigned char)socksreq[1]); in Curl_SOCKS4()
326 (unsigned char)socksreq[4], (unsigned char)socksreq[5], in Curl_SOCKS4()
327 (unsigned char)socksreq[6], (unsigned char)socksreq[7], in Curl_SOCKS4()
328 (((unsigned char)socksreq[2] << 8) | (unsigned char)socksreq[3]), in Curl_SOCKS4()
329 (unsigned char)socksreq[1]); in Curl_SOCKS4()
335 (unsigned char)socksreq[4], (unsigned char)socksreq[5], in Curl_SOCKS4()
336 (unsigned char)socksreq[6], (unsigned char)socksreq[7], in Curl_SOCKS4()
337 (((unsigned char)socksreq[2] << 8) | (unsigned char)socksreq[3]), in Curl_SOCKS4()
338 (unsigned char)socksreq[1]); in Curl_SOCKS4()
376 unsigned char socksreq[600]; /* room for large user/pw (255 max each) */ in Curl_SOCKS5() local
444 socksreq[idx++] = 5; /* version */ in Curl_SOCKS5()
446 socksreq[idx++] = 0; /* no authentication */ in Curl_SOCKS5()
448 socksreq[idx++] = 1; /* GSS-API */ in Curl_SOCKS5()
450 socksreq[idx++] = 2; /* username/password */ in Curl_SOCKS5()
452 socksreq[1] = (unsigned char) (idx - 2); in Curl_SOCKS5()
458 code = Curl_write_plain(conn, sock, (char *)socksreq, (2 + (int)socksreq[1]), in Curl_SOCKS5()
460 if(code || (written != (2 + (int)socksreq[1]))) { in Curl_SOCKS5()
485 result = Curl_blockread_all(conn, sock, (char *)socksreq, 2, &actualread); in Curl_SOCKS5()
491 if(socksreq[0] != 5) { in Curl_SOCKS5()
495 if(socksreq[1] == 0) { in Curl_SOCKS5()
500 else if(allow_gssapi && (socksreq[1] == 1)) { in Curl_SOCKS5()
508 else if(socksreq[1] == 2) { in Curl_SOCKS5()
528 socksreq[len++] = 1; /* username/pw subnegotiation version */ in Curl_SOCKS5()
529 socksreq[len++] = (unsigned char) proxy_user_len; in Curl_SOCKS5()
531 memcpy(socksreq + len, proxy_user, proxy_user_len); in Curl_SOCKS5()
533 socksreq[len++] = (unsigned char) proxy_password_len; in Curl_SOCKS5()
535 memcpy(socksreq + len, proxy_password, proxy_password_len); in Curl_SOCKS5()
538 code = Curl_write_plain(conn, sock, (char *)socksreq, len, &written); in Curl_SOCKS5()
544 result = Curl_blockread_all(conn, sock, (char *)socksreq, 2, &actualread); in Curl_SOCKS5()
551 if(socksreq[1] != 0) { /* status */ in Curl_SOCKS5()
553 socksreq[0], socksreq[1]); in Curl_SOCKS5()
561 if(!allow_gssapi && (socksreq[1] == 1)) { in Curl_SOCKS5()
566 if(socksreq[1] == 255) { in Curl_SOCKS5()
587 socksreq[len++] = 5; /* version (SOCKS5) */ in Curl_SOCKS5()
588 socksreq[len++] = 1; /* connect */ in Curl_SOCKS5()
589 socksreq[len++] = 0; /* must be zero */ in Curl_SOCKS5()
592 socksreq[len++] = 3; /* ATYP: domain name = 3 */ in Curl_SOCKS5()
593 socksreq[len++] = (char) hostname_len; /* address length */ in Curl_SOCKS5()
594 memcpy(&socksreq[len], hostname, hostname_len); /* address str w/o NULL */ in Curl_SOCKS5()
625 socksreq[len++] = 1; /* ATYP: IPv4 = 1 */ in Curl_SOCKS5()
629 socksreq[len++] = ((unsigned char *)&saddr_in->sin_addr.s_addr)[i]; in Curl_SOCKS5()
638 socksreq[len++] = 4; /* ATYP: IPv6 = 4 */ in Curl_SOCKS5()
642 socksreq[len++] = in Curl_SOCKS5()
664 socksreq[len++] = (unsigned char)((remote_port >> 8) & 0xff); /* PORT MSB */ in Curl_SOCKS5()
665 socksreq[len++] = (unsigned char)(remote_port & 0xff); /* PORT LSB */ in Curl_SOCKS5()
673 code = Curl_write_plain(conn, sock, (char *)socksreq, len, &written); in Curl_SOCKS5()
688 result = Curl_blockread_all(conn, sock, (char *)socksreq, in Curl_SOCKS5()
696 if(socksreq[0] != 5) { /* version */ in Curl_SOCKS5()
719 if(socksreq[3] == 3) { in Curl_SOCKS5()
721 int addrlen = (int) socksreq[4]; in Curl_SOCKS5()
724 else if(socksreq[3] == 4) { in Curl_SOCKS5()
735 result = Curl_blockread_all(conn, sock, (char *)&socksreq[10], in Curl_SOCKS5()
746 if(socksreq[1] != 0) { /* Anything besides 0 is an error */ in Curl_SOCKS5()
747 if(socksreq[3] == 1) { in Curl_SOCKS5()
750 (unsigned char)socksreq[4], (unsigned char)socksreq[5], in Curl_SOCKS5()
751 (unsigned char)socksreq[6], (unsigned char)socksreq[7], in Curl_SOCKS5()
752 (((unsigned char)socksreq[8] << 8) | in Curl_SOCKS5()
753 (unsigned char)socksreq[9]), in Curl_SOCKS5()
754 (unsigned char)socksreq[1]); in Curl_SOCKS5()
756 else if(socksreq[3] == 3) { in Curl_SOCKS5()
757 unsigned char port_upper = (unsigned char)socksreq[len - 2]; in Curl_SOCKS5()
758 socksreq[len - 2] = 0; in Curl_SOCKS5()
761 (char *)&socksreq[5], in Curl_SOCKS5()
763 (unsigned char)socksreq[len - 1]), in Curl_SOCKS5()
764 (unsigned char)socksreq[1]); in Curl_SOCKS5()
765 socksreq[len - 2] = port_upper; in Curl_SOCKS5()
767 else if(socksreq[3] == 4) { in Curl_SOCKS5()
771 (unsigned char)socksreq[4], (unsigned char)socksreq[5], in Curl_SOCKS5()
772 (unsigned char)socksreq[6], (unsigned char)socksreq[7], in Curl_SOCKS5()
773 (unsigned char)socksreq[8], (unsigned char)socksreq[9], in Curl_SOCKS5()
774 (unsigned char)socksreq[10], (unsigned char)socksreq[11], in Curl_SOCKS5()
775 (unsigned char)socksreq[12], (unsigned char)socksreq[13], in Curl_SOCKS5()
776 (unsigned char)socksreq[14], (unsigned char)socksreq[15], in Curl_SOCKS5()
777 (unsigned char)socksreq[16], (unsigned char)socksreq[17], in Curl_SOCKS5()
778 (unsigned char)socksreq[18], (unsigned char)socksreq[19], in Curl_SOCKS5()
779 (((unsigned char)socksreq[20] << 8) | in Curl_SOCKS5()
780 (unsigned char)socksreq[21]), in Curl_SOCKS5()
781 (unsigned char)socksreq[1]); in Curl_SOCKS5()