Changeset 531:4f44756a7201 in roaraudio
- Timestamp:
- 08/16/08 03:28:52 (16 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libroar/socket.c
r530 r531 262 262 // int type = ROAR_SOCKET_TYPE_INET; 263 263 int fh; 264 #ifdef ROAR_HAVE_IPX 265 #define _NEED_OBJ 266 int i; 267 int ret; 268 #endif 264 269 union { 265 270 struct sockaddr_in in; 266 271 struct sockaddr_un un; 267 272 struct sockaddr_in6 in6; 273 #ifdef ROAR_HAVE_IPX 274 struct sockaddr_ipx ipx; 275 #endif 268 276 } socket_addr; 269 277 struct hostent * he; … … 271 279 int (*mode_func)(int sockfd, const struct sockaddr *serv_addr, socklen_t addrlen) = connect; // default is to connect 272 280 #ifdef ROAR_HAVE_LIBDNET 281 #define _NEED_OBJ 282 #endif 283 #ifdef _NEED_OBJ 273 284 char obj[80]; 274 285 char * del; … … 286 297 } else if ( strstr(host, "::") != NULL ) { 287 298 type = ROAR_SOCKET_TYPE_DECNET; 299 } else if ( host[strlen(host)-1] == ')' ) { 300 type = ROAR_SOCKET_TYPE_IPX; 288 301 } 289 302 } … … 394 407 return -1; 395 408 } 409 } else if ( type == ROAR_SOCKET_TYPE_IPX ) { 410 socket_addr.ipx.sipx_family = AF_IPX; 411 412 obj[0] = 0; 413 414 if ( (ret = sscanf(host, "%8x.%12s(%x)", &socket_addr.ipx.sipx_network, obj, 415 (unsigned int *)&socket_addr.ipx.sipx_port)) < 2 ) { 416 return -1; 417 } else if ( ret == 2 ) { 418 socket_addr.ipx.sipx_port = port; // Network Byte Order? 419 } 420 421 memset(socket_addr.ipx.sipx_node, 0, IPX_NODE_LEN); 422 ret = strlen(obj); 423 424 if ( ret % 2 ) // needs to be even at the moment 425 return -1; 426 427 fh = roar_socket_new_ipx(); 428 429 close(fh); 430 return -1; 396 431 } else if ( type == ROAR_SOCKET_TYPE_FORK ) { 397 432 return roar_socket_open_fork(mode, host, port);
Note: See TracChangeset
for help on using the changeset viewer.