Changeset 5260:03340eac5983 in roaraudio
- Timestamp:
- 11/14/11 00:29:49 (12 years ago)
- Branch:
- default
- Phase:
- public
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
include/libroar/socket.h
r5248 r5260 50 50 #define ROAR_SOCKET_MAX_HOSTNAMELEN 64 51 51 52 int roar_socket_listen (int type, c har * host, int port);53 int roar_socket_connect (c har * host, int port);52 int roar_socket_listen (int type, const char * host, int port); 53 int roar_socket_connect (const char * host, int port); 54 54 55 55 // TODO: those function should be made /static/. … … 61 61 int roar_socket_new (int type); 62 62 63 int roar_socket_open (int mode, int type, c har * host, int port);64 int roar_socket_open_fork (int mode, c har * host, int port);65 int roar_socket_open_file (int mode, c har * host, int port);66 int roar_socket_open_proxy (int mode, int type, c har * host, int port,char * proxy_type);63 int roar_socket_open (int mode, int type, const char * host, int port); 64 int roar_socket_open_fork (int mode, const char * host, int port); 65 int roar_socket_open_file (int mode, const char * host, int port); 66 int roar_socket_open_proxy (int mode, int type, const char * host, int port, const char * proxy_type); 67 67 68 68 int roar_socket_listen_decnet (char * object, int num); … … 80 80 int roar_socket_recv_fh (int sock, char * mes, size_t * len); 81 81 82 int roar_socket_open_socks4 (int mode, int fh, c har * host, int port, char * user, char * pw,char * opts);83 int roar_socket_open_socks4a(int mode, int fh, c har * host, int port, char * user, char * pw,char * opts);84 int roar_socket_open_socks4d(int mode, int fh, c har * host, int port, char * user, char * pw,char * opts);85 int roar_socket_open_socks4x(int mode, int fh, char host[4], int port, c har * app, size_t app_len,char * user);82 int roar_socket_open_socks4 (int mode, int fh, const char * host, int port, const char * user, const char * pw, const char * opts); 83 int roar_socket_open_socks4a(int mode, int fh, const char * host, int port, const char * user, const char * pw, const char * opts); 84 int roar_socket_open_socks4d(int mode, int fh, const char * host, int port, const char * user, const char * pw, const char * opts); 85 int roar_socket_open_socks4x(int mode, int fh, char host[4], int port, const char * app, size_t app_len, const char * user); 86 86 87 int roar_socket_open_http (int mode, int fh, c har * host, int port, char * user, char * pw,char * opts);87 int roar_socket_open_http (int mode, int fh, const char * host, int port, const char * user, const char * pw, const char * opts); 88 88 89 int roar_socket_open_ssh (int mode, int fh, c har * host, int port, char * user, char * pw,char * opts);89 int roar_socket_open_ssh (int mode, int fh, const char * host, int port, const char * user, const char * pw, const char * opts); 90 90 91 91 #endif -
include/libroar/vio.h
r5242 r5260 87 87 int roar_vio_open_fh_socket(struct roar_vio_calls * calls, int fh) _LIBROAR_ATTR_NONNULL_ALL; 88 88 89 int roar_vio_open_socket (struct roar_vio_calls * calls, c har * host, int port) _LIBROAR_ATTR_USE_RESULT _LIBROAR_ATTR_NONNULL_ALL;90 int roar_vio_open_socket_listen(struct roar_vio_calls * calls, int type, c har * host, int port) _LIBROAR_ATTR_USE_RESULT _LIBROAR_ATTR_NONNULL_ALL;89 int roar_vio_open_socket (struct roar_vio_calls * calls, const char * host, int port) _LIBROAR_ATTR_USE_RESULT _LIBROAR_ATTR_NONNULL_ALL; 90 int roar_vio_open_socket_listen(struct roar_vio_calls * calls, int type, const char * host, int port) _LIBROAR_ATTR_USE_RESULT _LIBROAR_ATTR_NONNULL_ALL; 91 91 92 92 int roar_vio_simple_stream (struct roar_vio_calls * calls, int rate, int channels, int bits, int codec, -
libroar/socket.c
r5248 r5260 383 383 } 384 384 385 int roar_socket_listen (int type, c har * host, int port) {385 int roar_socket_listen (int type, const char * host, int port) { 386 386 return roar_socket_open(MODE_LISTEN, type, host, port); 387 387 } 388 388 389 int roar_socket_connect (c har * host, int port) {389 int roar_socket_connect (const char * host, int port) { 390 390 char * proxy_type = getenv("ROAR_PROXY"); 391 391 … … 476 476 } 477 477 478 int roar_socket_open (int mode, int type, c har * host, int port) {478 int roar_socket_open (int mode, int type, const char * host, int port) { 479 479 // int type = ROAR_SOCKET_TYPE_INET; 480 480 int fh; … … 520 520 #ifdef ROAR_HAVE_LIBDNET 521 521 #define _NEED_OBJ 522 char * dnet_node_buf; 522 523 #endif 523 524 #ifdef _NEED_OBJ … … 601 602 // There is nothing wrong in this case to use dnet_conn() so we do. 602 603 ROAR_DBG("roar_socket_open(*): CALL dnet_conn('%s', '%s', SOCK_STREAM, 0 ,0 ,0 , 0)", host, obj); 603 fh = dnet_conn(host, obj, SOCK_STREAM, 0 ,0 ,0 , 0); 604 dnet_node_buf = roar_mm_strdup(host); 605 if ( dnet_node_buf == NULL ) { 606 *del = ':'; 607 return -1; 608 } 609 fh = dnet_conn(dnet_node_buf, obj, SOCK_STREAM, 0 ,0 ,0 , 0); 610 roar_mm_free(dnet_node_buf); 604 611 ROAR_DBG("roar_socket_open(*): RET %i", fh); 605 612 *del = ':'; … … 812 819 } 813 820 814 int roar_socket_open_fork (int mode, c har * host, int port) {821 int roar_socket_open_fork (int mode, const char * host, int port) { 815 822 #if !defined(ROAR_TARGET_WIN32) && !defined(ROAR_TARGET_MICROCONTROLLER) 816 823 char * daemonimage; … … 865 872 } 866 873 867 int roar_socket_open_file (int mode, c har * host, int port) {874 int roar_socket_open_file (int mode, const char * host, int port) { 868 875 #ifdef ROAR_HAVE_IO_POSIX 869 876 int fh; … … 893 900 894 901 #ifdef ROAR_SUPPORT_PROXY 895 int roar_socket_open_proxy (int mode, int type, c har * host, int port,char * proxy_type) {902 int roar_socket_open_proxy (int mode, int type, const char * host, int port, const char * proxy_type) { 896 903 int proxy_port = -1; 897 904 char proxy_host[ROAR_SOCKET_MAX_HOSTNAMELEN]; … … 904 911 char proxy_addr_buf[1024]; 905 912 static struct passwd * passwd; 906 int (* code)(int mode, int fh, c har * host, int port, char * user, char * pw,char * opts) = NULL;913 int (* code)(int mode, int fh, const char * host, int port, const char * user, const char * pw, const char * opts) = NULL; 907 914 908 915 if ( passwd == NULL ) { … … 1020 1027 // protocoll dependet proxy code: 1021 1028 1022 int roar_socket_open_socks4 (int mode, int fh, c har * host, int port, char * user, char * pw,char * opts) {1029 int roar_socket_open_socks4 (int mode, int fh, const char * host, int port, const char * user, const char * pw, const char * opts) { 1023 1030 #ifndef ROAR_TARGET_MICROCONTROLLER 1024 1031 struct hostent * he; … … 1035 1042 } 1036 1043 1037 int roar_socket_open_socks4a(int mode, int fh, c har * host, int port, char * user, char * pw,char * opts) {1044 int roar_socket_open_socks4a(int mode, int fh, const char * host, int port, const char * user, const char * pw, const char * opts) { 1038 1045 return roar_socket_open_socks4x(mode, fh, "\0\0\0\1", port, host, strlen(host)+1, user); 1039 1046 } 1040 1047 1041 int roar_socket_open_socks4d(int mode, int fh, c har * host, int port, char * user, char * pw,char * opts) {1048 int roar_socket_open_socks4d(int mode, int fh, const char * host, int port, const char * user, const char * pw, const char * opts) { 1042 1049 size_t len = strlen(host)+1; 1043 1050 char * dp; … … 1055 1062 } 1056 1063 1057 int roar_socket_open_socks4x(int mode, int fh, char host[4], int port, c har * app, size_t app_len,char * user) {1064 int roar_socket_open_socks4x(int mode, int fh, char host[4], int port, const char * app, size_t app_len, const char * user) { 1058 1065 char buf[9]; 1059 1066 int len; … … 1093 1100 } 1094 1101 1095 int roar_socket_open_http (int mode, int fh, c har * host, int port, char * user, char * pw,char * opts) {1102 int roar_socket_open_http (int mode, int fh, const char * host, int port, const char * user, const char * pw, const char * opts) { 1096 1103 char buf[1024]; 1097 1104 int len; … … 1126 1133 1127 1134 #ifdef ROAR_HAVE_BIN_SSH 1128 int roar_socket_open_ssh (int mode, int fh, c har * host, int port, char * user, char * pw,char * opts) {1135 int roar_socket_open_ssh (int mode, int fh, const char * host, int port, const char * user, const char * pw, const char * opts) { 1129 1136 char * proxy_addr = getenv("ssh_proxy"); 1130 1137 char * sep; -
libroar/vio.c
r5253 r5260 357 357 } 358 358 359 int roar_vio_open_socket (struct roar_vio_calls * calls, c har * host, int port) {359 int roar_vio_open_socket (struct roar_vio_calls * calls, const char * host, int port) { 360 360 int fh; 361 361 … … 371 371 } 372 372 373 int roar_vio_open_socket_listen(struct roar_vio_calls * calls, int type, c har * host, int port) {373 int roar_vio_open_socket_listen(struct roar_vio_calls * calls, int type, const char * host, int port) { 374 374 int fh; 375 375
Note: See TracChangeset
for help on using the changeset viewer.