Changeset 531:4f44756a7201 in roaraudio


Ignore:
Timestamp:
08/16/08 03:28:52 (16 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

prepered a bit IPX code, gave up for today because of the THAT BAD designed addresses

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libroar/socket.c

    r530 r531  
    262262// int type = ROAR_SOCKET_TYPE_INET; 
    263263 int fh; 
     264#ifdef ROAR_HAVE_IPX 
     265#define _NEED_OBJ 
     266 int i; 
     267 int ret; 
     268#endif 
    264269 union { 
    265270  struct sockaddr_in  in; 
    266271  struct sockaddr_un  un; 
    267272  struct sockaddr_in6 in6; 
     273#ifdef ROAR_HAVE_IPX 
     274  struct sockaddr_ipx ipx; 
     275#endif 
    268276 } socket_addr; 
    269277 struct hostent     * he; 
     
    271279 int (*mode_func)(int sockfd, const struct sockaddr *serv_addr, socklen_t addrlen) = connect; // default is to connect 
    272280#ifdef ROAR_HAVE_LIBDNET 
     281#define _NEED_OBJ 
     282#endif 
     283#ifdef _NEED_OBJ 
    273284 char obj[80]; 
    274285 char * del; 
     
    286297  } else if ( strstr(host, "::") != NULL ) { 
    287298   type = ROAR_SOCKET_TYPE_DECNET; 
     299  } else if ( host[strlen(host)-1] == ')' ) { 
     300   type = ROAR_SOCKET_TYPE_IPX; 
    288301  } 
    289302 } 
     
    394407   return -1; 
    395408  } 
     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; 
    396431 } else if ( type == ROAR_SOCKET_TYPE_FORK ) { 
    397432  return roar_socket_open_fork(mode, host, port); 
Note: See TracChangeset for help on using the changeset viewer.