OpenSS7
SS7 for the
Common Man

© Copyright 1997-2004,OpenSS7 Corporation, All Rights Reserved.
Last modified:

Home Overview Status News Documentation Resources About
   
 Overview
 Status
 News
 Documentation
 Resources
 About

   
Home Index Prev Next More Download Info FAQ Mail   Home -> Resources -> Browse Source -> strss7/lib/libsocket/accept.c


File /code/strss7/lib/libsocket/accept.c



#ident "@(#) $RCSfile: accept.c,v $ $Name:  $($Revision: 0.8.2.4 $) $Date: 2003/05/28 08:01:59 $"

#include <unistd.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/stat.h>
#include <sys/ioctl.h>
#include <fcntl.h>
#include <socksys.h>
#include <stropts.h>

/*
 *  ACCEPT
 *  -------------------------------------------------------------------------
 */
int accept(int socket, struct sockaddr *address, socklen_t * address_len)
{
	int fd;
	struct socksysreq req = { {
				   (long) SO_ACCEPT,
				   (long) socket,
				   (long) address,
				   (long) address_len,
				   }
	};
	struct strioctl ioc;
	if ((fd = open("/dev/socksys", O_RDWR)) < 0)
		return (-1);
	ioc.ic_cmd = SIOCSOCKSYS;
	ioc.ic_timout = SOCKSYS_TIMEOUT;
	ioc.ic_len = sizeof(req);
	ioc.ic_dp = (char *)&req;
	if (ioctl(fd, I_STR, &ioc) < 0) {
		close(fd);
		return (-1);
	}
	if (ioctl(fd, I_SRDOPT, (RMSGN | RPROTDIS)) < 0) {
		close(fd);
		return (-1);
	}
	return (fd);
}


Home Index Prev Next More Download Info FAQ Mail   Home -> Resources -> Browse Source -> strss7/lib/libsocket/accept.c

OpenSS7
SS7 for the
Common Man
Home Overview Status News Documentation Resources About

© Copyright 1997-2004,OpenSS7 Corporation, All Rights Reserved.
Last modified: