Changeset 834:3c740aeb58c5 in roaraudio
- Timestamp:
- 09/27/08 02:17:23 (16 years ago)
- Branch:
- default
- Phase:
- public
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
include/libroar/socket.h
r830 r834 96 96 int roar_socket_recv_fh (int sock, char * mes, size_t * len); 97 97 98 int roar_socket_open_socks4 (int mode, int fh, char * host, int port );99 int roar_socket_open_socks4a(int mode, int fh, char * host, int port );100 int roar_socket_open_socks4d(int mode, int fh, char * host, int port );101 int roar_socket_open_socks4x(int mode, int fh, char host[4], int port, char * app, size_t app_len );98 int roar_socket_open_socks4 (int mode, int fh, char * host, int port, char * user, char * pw, char * opts); 99 int roar_socket_open_socks4a(int mode, int fh, char * host, int port, char * user, char * pw, char * opts); 100 int roar_socket_open_socks4d(int mode, int fh, char * host, int port, char * user, char * pw, char * opts); 101 int roar_socket_open_socks4x(int mode, int fh, char host[4], int port, char * app, size_t app_len, char * user); 102 102 103 int roar_socket_open_http (int mode, int fh, char * host, int port );103 int roar_socket_open_http (int mode, int fh, char * host, int port, char * user, char * pw, char * opts); 104 104 105 105 #endif -
libroar/socket.c
r833 r834 599 599 int i; 600 600 int fh = -1; 601 int (* code)(int mode, int fh, char * host, int port ) = NULL;601 int (* code)(int mode, int fh, char * host, int port, char * user, char * pw, char * opts) = NULL; 602 602 603 603 // TODO: change this so we support listen() proxys (ssh -R) … … 652 652 653 653 if ( code != NULL ) { 654 if ( code(mode, fh, host, port ) == -1 ) {654 if ( code(mode, fh, host, port, NULL, NULL, NULL) == -1 ) { 655 655 close(fh); 656 656 return -1; … … 666 666 // protocoll dependet proxy code: 667 667 668 int roar_socket_open_socks4 (int mode, int fh, char * host, int port ) {668 int roar_socket_open_socks4 (int mode, int fh, char * host, int port, char * user, char * pw, char * opts) { 669 669 struct hostent * he; 670 670 … … 674 674 } 675 675 676 return roar_socket_open_socks4x(mode, fh, he->h_addr, port, NULL, 0 );677 } 678 679 int roar_socket_open_socks4a(int mode, int fh, char * host, int port ) {680 return roar_socket_open_socks4x(mode, fh, "\0\0\0\1", port, host, strlen(host)+1 );681 } 682 683 int roar_socket_open_socks4d(int mode, int fh, char * host, int port ) {676 return roar_socket_open_socks4x(mode, fh, he->h_addr, port, NULL, 0, user); 677 } 678 679 int roar_socket_open_socks4a(int mode, int fh, char * host, int port, char * user, char * pw, char * opts) { 680 return roar_socket_open_socks4x(mode, fh, "\0\0\0\1", port, host, strlen(host)+1, user); 681 } 682 683 int roar_socket_open_socks4d(int mode, int fh, char * host, int port, char * user, char * pw, char * opts) { 684 684 size_t len = strlen(host)+1; 685 685 char * dp; … … 694 694 } 695 695 696 return roar_socket_open_socks4x(mode, fh, "\0\2\0\0", port, host, len );697 } 698 699 int roar_socket_open_socks4x(int mode, int fh, char host[4], int port, char * app, size_t app_len ) {696 return roar_socket_open_socks4x(mode, fh, "\0\2\0\0", port, host, len, user); 697 } 698 699 int roar_socket_open_socks4x(int mode, int fh, char host[4], int port, char * app, size_t app_len, char * user) { 700 700 char buf[9]; 701 701 … … 722 722 } 723 723 724 int roar_socket_open_http (int mode, int fh, char * host, int port ) {724 int roar_socket_open_http (int mode, int fh, char * host, int port, char * user, char * pw, char * opts) { 725 725 char buf[1024]; 726 726 int len;
Note: See TracChangeset
for help on using the changeset viewer.