100+ results for 'socket source:Minix3'

Not the results you expected?

hostaddr.c (git://git.minix3.org/minix) C · 0 lines

30 #include <net/gen/ip_io.h>

31 #include <net/gen/netdb.h>

32 #include <net/gen/socket.h>

33 #include <net/gen/nameser.h>

34 #include <net/gen/resolv.h>

proto.h (git://git.minix3.org/minix) C Header · 0 lines

75 _PROTOTYPE( int do_connect, (message *dev_m_in, message *dev_m_out) );

76 _PROTOTYPE( int do_listen, (message *dev_m_in, message *dev_m_out) );

77 _PROTOTYPE( int do_socket, (message *dev_m_in, message *dev_m_out) );

78 _PROTOTYPE( int do_bind, (message *dev_m_in, message *dev_m_out) );

79 _PROTOTYPE( int do_getsockname, (message *dev_m_in, message *dev_m_out) );

80 _PROTOTYPE( int do_getpeername, (message *dev_m_in, message *dev_m_out) );

81 _PROTOTYPE( int do_shutdown, (message *dev_m_in, message *dev_m_out) );

82 _PROTOTYPE( int do_socketpair, (message *dev_m_in, message *dev_m_out) );

83 _PROTOTYPE( int do_socketpair_old, (message *dev_m_in, message *dev_m_out) );

MAKEDEV.sh (git://git.minix3.org/minix) Shell · 294 lines

255 ;;

256 uds)

257 # unix domain sockets device

258 $e mknod uds c 18 0;

259 $e chgrp operator uds

udp.c (git://git.minix3.org/minix) C · 0 lines

41

42 #include <sys/param.h>

43 #include <sys/socket.h>

44

45 #ifdef _STANDALONE

t40f.c (git://git.minix3.org/minix) C · 185 lines

4 *

5 * Select works on regular files, (pseudo) terminal devices, streams-based

6 * files, FIFOs, pipes, and sockets. This test verifies selecting with a time

7 * out set.

8 */

t40c.c (git://git.minix3.org/minix) C · 161 lines

4 *

5 * Select works on regular files, (pseudo) terminal devices, streams-based

6 * files, FIFOs, pipes, and sockets. This test verifies selecting for (pseudo)

7 * terminal devices.

8 *

bind.c (git://git.minix3.org/minix) C · 218 lines

14 #include <string.h>

15 #include <sys/ioctl.h>

16 #include <sys/socket.h>

17 #include <sys/types.h>

18 #include <sys/stat.h>

MAKEDEV.sh (git://git.minix3.org/minix) Shell · 0 lines

254 ;;

255 uds)

256 # unix domain sockets device

257 $e mknod uds c 18 0; $e chmod 644 random

258 $e chgrp operator uds

pmap_getmaps.c (git://git.minix3.org/minix) C · 0 lines

52 #include <sys/types.h>

53 #include <sys/ioctl.h>

54 #include <sys/socket.h>

55

56 #include <net/if.h>

nsap_addr.c (git://git.minix3.org/minix) C · 0 lines

32 #include <sys/types.h>

33 #include <sys/param.h>

34 #include <sys/socket.h>

35

36 #include <netinet/in.h>

run_t2 (git://git.minix3.org/minix) Shell · 147 lines

35 if [ $dont_connect -eq 0 ]

36 then

37 if ./socket -t 10 $DAYTIME_HOST daytime < /dev/null

38 then

39 connect_blocks=`expr $connect_blocks + 1`

netdb.h (git://git.minix3.org/minix) C Header · 0 lines

32 #include "lwip/opt.h"

33

34 #if LWIP_DNS && LWIP_SOCKET

35

36 #include <stddef.h> /* for size_t */

37

38 #include "lwip/inet.h"

39 #include "lwip/sockets.h"

40

41 /* some rarely used options */

79 struct addrinfo {

80 int ai_flags; /* Input flags. */

81 int ai_family; /* Address family of socket. */

82 int ai_socktype; /* Socket type. */

84 socklen_t ai_addrlen; /* Length of socket address. */

85 struct sockaddr *ai_addr; /* Socket address of socket. */

86 char *ai_canonname; /* Canonical name of service location. */

87 struct addrinfo *ai_next; /* Pointer to next in list. */

stat.h (git://git.minix3.org/minix) C Header · 0 lines

104 #define _S_IFREG 0100000 /* regular */

105 #define _S_IFLNK 0120000 /* symbolic link */

106 #define _S_IFSOCK 0140000 /* socket */

107 #define _S_ISVTX 0001000 /* save swapped text even after use */

108

132 #if ((_POSIX_C_SOURCE - 0) >= 200112L) || ((_XOPEN_SOURCE - 0) >= 600) || \

133 defined(_NETBSD_SOURCE)

134 #define S_ISSOCK(m) (((m) & _S_IFMT) == _S_IFSOCK) /* socket */

135 #endif

136

if_nameindex.c (git://git.minix3.org/minix) C · 0 lines

34 #include "namespace.h"

35 #include <sys/types.h>

36 #include <sys/socket.h>

37 #include <net/if_dl.h>

38 #include <net/if.h>

linkaddr.c (git://git.minix3.org/minix) C · 0 lines

40

41 #include <sys/types.h>

42 #include <sys/socket.h>

43 #include <net/if_dl.h>

44

inet_config.c (git://git.minix3.org/minix) C · 0 lines

26

27 #include "proto.h"

28 #include "socket.h"

29

30

getpeereid.c (git://git.minix3.org/minix) C · 0 lines

2 #include <string.h>

3 #include <unistd.h>

4 #include <sys/socket.h>

5

6 /*

7 * get the effective user ID and effective group ID of a peer

8 * connected through a Unix domain socket.

9 */

10 int getpeereid(int sd, uid_t *euid, gid_t *egid) {

24

25 /* Get the credentials of the peer at the other end of 'sd' */

26 rc = getsockopt(sd, SOL_SOCKET, SO_PEERCRED, &cred, &ucred_length);

27 if (rc == 0) {

28 /* Success - return the results */

getsockopt.c (git://git.minix3.org/minix) C · 258 lines

7 #include <string.h>

8 #include <sys/ioctl.h>

9 #include <sys/socket.h>

10 #include <sys/types.h>

11 #include <sys/ucred.h>

101 int i, r, err;

102

103 if (level == SOL_SOCKET && option_name == SO_REUSEADDR)

104 {

105 i = 1; /* Binds to TIME_WAIT sockets never cause errors */

107 return 0;

108 }

109 if (level == SOL_SOCKET && option_name == SO_KEEPALIVE)

110 {

111 i = 1; /* Keepalive is always on */

driver.h (git://git.minix3.org/minix) C Header · 0 lines

40 unsigned max_pkt_sz;

41 unsigned min_pkt_sz;

42 struct socket * raw_socket;

43 };

44

52 */

53 int driver_tx(struct nic * nic);

54 int raw_socket_input(struct pbuf * pbuf, struct nic * nic);

55

56 #endif /* __LWIP_DRIVER_H_ */

udp_var.h (git://git.minix3.org/minix) C Header · 0 lines

60 #define UDP_STAT_BADSUM 2 /* checksum error */

61 #define UDP_STAT_BADLEN 3 /* data length larger than packet */

62 #define UDP_STAT_NOPORT 4 /* no socket on port */

63 #define UDP_STAT_NOPORTBCAST 5 /* of above, arrived as broadcast */

64 #define UDP_STAT_FULLSOCK 6 /* not delivered, input socket full */

93

94 void *udp_ctlinput(int, const struct sockaddr *, void *);

95 int udp_ctloutput(int, struct socket *, struct sockopt *);

96 void udp_init(void);

97 void udp_input(struct mbuf *, ...);

98 int udp_output(struct mbuf *, ...);

99 int udp_sysctl(int *, u_int, void *, size_t *, void *, size_t);

100 int udp_usrreq(struct socket *,

101 int, struct mbuf *, struct mbuf *, struct mbuf *, struct lwp *);

102

blacklistd (git://git.minix3.org/minix) Shell · 58 lines

18 extra_commands="reload"

19

20 _sockfile="/var/run/${name}.sockets"

21 _sockname="blsock"

22

23 blacklistd_precmd()

24 {

25 # Create default list of blacklistd sockets to watch

26 #

27 ( umask 022 ; > $_sockfile )

29 # Find /etc/rc.d scripts with "chrootdir" rcorder(8) keyword,

30 # and if $${app}_chrootdir is a directory, add appropriate

31 # blacklistd socket to list of sockets to watch.

32 #

33 for _lr in $(rcorder -k chrootdir /etc/rc.d/*); do

inc.h (git://git.minix3.org/minix) C Header · 41 lines

14 #include <sys/param.h>

15 #include <sys/select.h>

16 #include <sys/socket.h>

17 #include <sys/stat.h>

18 #include <limits.h>

main.c (git://git.minix3.org/minix) C · 160 lines

33 #include <net/gen/tcp.h>

34 #include <net/gen/tcp_io.h>

35 #include <net/gen/socket.h>

36 #include <net/gen/netdb.h>

37 #include <net/gen/inet.h>

t40b.c (git://git.minix3.org/minix) C · 0 lines

4 *

5 * Select works on regular files, (pseudo) terminal devices, streams-based

6 * files, FIFOs, pipes, and sockets. This test verifies selecting for regular

7 * file descriptors. "File descriptors associated with regular files shall

8 * always select true for ready to read, ready to write, and error conditions"

sendto.c (git://git.minix3.org/minix) C · 0 lines

11 #include <unistd.h>

12 #include <sys/ioctl.h>

13 #include <sys/socket.h>

14 #include <netinet/in.h>

15

189 {

190

191 /* for connection oriented unix domain sockets (SOCK_STREAM /

192 * SOCK_SEQPACKET)

193 */

211 int r;

212

213 /* for connectionless unix domain sockets (SOCK_DGRAM) */

214

215 if (flags != 0) {

rand-egd.c (git://git.minix3.org/minix) C · 263 lines

71 strlcpy(addr.sun_path, path, sizeof(addr.sun_path));

72

73 fd = socket(AF_UNIX, SOCK_STREAM, 0);

74 if (fd < 0)

75 return -1;

accept.c (git://git.minix3.org/minix) C · 134 lines

9 #include <string.h>

10 #include <sys/ioctl.h>

11 #include <sys/socket.h>

12 #include <sys/un.h>

13

41 return r;

42

43 /* Unfortunately, we have to return EOPNOTSUPP for a socket that

44 * does not support accept (such as a UDP socket) and ENOTSOCK for

45 * filedescriptors that do not refer to a socket.

46 */

47 r= ioctl(sock, NWIOGUDPOPT, &udpopt);

48 if (r == 0)

49 {

50 /* UDP socket */

51 errno= EOPNOTSUPP;

52 return -1;

utmpx.h (git://git.minix3.org/minix) C Header · 0 lines

34 #include <sys/cdefs.h>

35 #include <sys/featuretest.h>

36 #include <sys/socket.h>

37 #include <sys/time.h>

38

recvfrom.c (git://git.minix3.org/minix) C · 296 lines

11 #include <unistd.h>

12 #include <sys/ioctl.h>

13 #include <sys/socket.h>

14 #include <netinet/in.h>

15

156 #if DEBUG

157 fprintf(stderr,

158 "recvfrom(udp): RWDATONLY on unconnected socket\n");

159 #endif

160 errno= ENOTCONN;

234 size_t len;

235

236 /* for connection oriented unix domain sockets (SOCK_STREAM /

237 * SOCK_SEQPACKET)

238 */

compat_socket.c (git://git.minix3.org/minix) C · 0 lines

1 /* $NetBSD: compat_socket.c,v 1.1 2006/06/26 21:23:56 mrg Exp $ */

2

3 #include <sys/cdefs.h>

4 #if defined(LIBC_SCCS) && !defined(lint)

5 __RCSID("$NetBSD: compat_socket.c,v 1.1 2006/06/26 21:23:56 mrg Exp $");

6 #endif /* LIBC_SCCS and not lint */

7

10 #include <errno.h>

11 #include <sys/types.h>

12 #include <sys/socket.h>

13 #include <compat/sys/socket.h>

15 __warn_references(socket,

16 "warning: reference to compatibility socket(); include <sys/socket.h> for correct reference")

17

18 int

listen.c (git://git.minix3.org/minix) C · 0 lines

6 #include <string.h>

7 #include <sys/ioctl.h>

8 #include <sys/socket.h>

9 #include <netinet/in.h>

10

getifaddrs.c (git://git.minix3.org/minix) C · 0 lines

6 #include <ifaddrs.h>

7 #include <sys/ioctl.h>

8 #include <sys/socket.h>

9 #include <sys/types.h>

10 #include <netinet/in.h>

setsockopt.c (git://git.minix3.org/minix) C · 274 lines

6 #include <stdio.h>

7 #include <sys/ioctl.h>

8 #include <sys/socket.h>

9 #include <sys/types.h>

10 #include <netinet/tcp.h>

84 int i;

85

86 if (level == SOL_SOCKET && option_name == SO_REUSEADDR)

87 {

88 if (option_len != sizeof(i))

102 return 0;

103 }

104 if (level == SOL_SOCKET && option_name == SO_KEEPALIVE)

105 {

106 if (option_len != sizeof(i))

send.c (git://git.minix3.org/minix) C · 0 lines

41 #include "namespace.h"

42 #include <sys/types.h>

43 #include <sys/socket.h>

44

45 #include <stddef.h>

if_nametoindex.c (git://git.minix3.org/minix) C · 0 lines

34 #include "namespace.h"

35 #include <sys/types.h>

36 #include <sys/socket.h>

37 #include <net/if.h>

38 #include <net/if_dl.h>

inet_ntoa.c (git://git.minix3.org/minix) C · 0 lines

41 #include "namespace.h"

42 #include <sys/types.h>

43 #include <sys/socket.h>

44 #include <netinet/in.h>

45 #include <arpa/inet.h>

recvmsg.c (git://git.minix3.org/minix) C · 0 lines

7 #include <sys/ioctl.h>

8 #include <sys/ioc_net.h>

9 #include <sys/socket.h>

10 #include <sys/types.h>

11 #include <sys/un.h>

socketpair.c (git://git.minix3.org/minix) C · 0 lines

13

14 #ifdef __weak_alias

15 __weak_alias(socketpair, _socketpair)

16 #endif

17

50 }

51

52 static int _uds_socketpair(int type, int protocol, int sv[2])

53 {

54 dev_t dev;

65 }

66

67 /* in this 'for' loop two unconnected sockets are created */

68 for (i = 0; i < 2; i++) {

69 sv[i]= open(UDS_DEVICE, O_RDWR);

ioc_net.h (git://git.minix3.org/minix) C++ Header · 102 lines

73 #define NWIOGUDSADDR _IOR ('n', 70, struct sockaddr_un) /* getsockname() */

74 #define NWIOGUDSPADDR _IOR ('n', 71, struct sockaddr_un) /* getpeername() */

75 #define NWIOSUDSTYPE _IOW ('n', 72, int) /* socket() */

76 #define NWIOSUDSBLOG _IOW ('n', 73, int) /* listen() */

77 #define NWIOSUDSCONN _IOW ('n', 74, struct sockaddr_un) /* connect() */

78 #define NWIOSUDSSHUT _IOW ('n', 75, int) /* shutdown() */

79 #define NWIOSUDSPAIR _IOW ('n', 76, dev_t) /* socketpair() */

80 #define NWIOSUDSPAIROLD _IOW ('n', 76, short) /* socketpair() */

86 #define NWIOGPSIPOPT _IOR('n', 81, struct nwio_psipopt)

87

88 /* setsockopt/setsockopt for unix domain sockets */

89 #define NWIOGUDSSOTYPE _IOR('n', 90, int) /* SO_TYPE */

90 #define NWIOGUDSPEERCRED _IOR('n', 91, struct ucred) /* SO_PEERCRED */

Makefile (git://git.minix3.org/minix) Makefile · 23 lines

8 rmdir.2 select.2 send.2 sendmsg.2 sendto.2 setsid.2 \

9 setsockopt.2 setuid.2 shutdown.2 sigaction.2 sigpending.2 \

10 sigprocmask.2 sigsuspend.2 socket.2 socketpair.2 \

11 statvfs.2 svrctl.2 symlink.2 sync.2 time.2 times.2 truncate.2 \

12 umask.2 uname.2 unlink.2 utime.2 wait.2 write.2

DESCRIBE.sh (git://git.minix3.org/minix) Shell · 223 lines

195 ;;

196 18,0)

197 des="UNIX domain socket" dev=uds

198 ;;

199 BAD,BAD)

__cmsg_alignbytes.c (git://git.minix3.org/minix) C · 0 lines

40 #include <sys/param.h>

41 #include <sys/sysctl.h>

42 #include <sys/socket.h>

43 #else

44 #include <sys/types.h>

45 #include <sys/param.h>

46 #include <sys/socket.h>

47 #endif

48

getrpcport.c (git://git.minix3.org/minix) C · 0 lines

47

48 #include <sys/types.h>

49 #include <sys/socket.h>

50

51 #include <assert.h>

proto.h (git://git.minix3.org/minix) C Header · 99 lines

75 int do_connect(message *dev_m_in, message *dev_m_out);

76 int do_listen(message *dev_m_in, message *dev_m_out);

77 int do_socket(message *dev_m_in, message *dev_m_out);

78 int do_bind(message *dev_m_in, message *dev_m_out);

79 int do_getsockname(message *dev_m_in, message *dev_m_out);

80 int do_getpeername(message *dev_m_in, message *dev_m_out);

81 int do_shutdown(message *dev_m_in, message *dev_m_out);

82 int do_socketpair(message *dev_m_in, message *dev_m_out);

83 int do_socketpair_old(message *dev_m_in, message *dev_m_out);

if_indextoname.c (git://git.minix3.org/minix) C · 0 lines

36 #endif

37 #include <sys/types.h>

38 #include <sys/socket.h>

39 #include <net/if_dl.h>

40 #include <net/if.h>

socket.c (git://git.minix3.org/minix) C · 0 lines

3

4 #ifdef __weak_alias

5 __weak_alias(socket, _socket)

6 #endif

7

11 #include <stdio.h>

12 #include <unistd.h>

13 #include <sys/socket.h>

14 #include <sys/ioc_net.h>

15

19 #define DEBUG 0

20

21 static int _tcp_socket(int protocol);

22 static int _udp_socket(int protocol);

23 static int _uds_socket(int type, int protocol);

24

25 int socket(int domain, int type, int protocol)

Makefile (git://git.minix3.org/minix) Makefile · 0 lines

28 select.h sha1.h \

29 sha2.h siginfo.h signal.h sigtypes.h \

30 reboot.h sem.h shm.h socket.h \

31 stat.h statvfs.h \

32 sysctl.h stdint.h \

const.h (git://git.minix3.org/minix) C++ Header · 43 lines

4 #define NR_INODES 256 /* # slots in "in core" inode table */

5

6 /* Size of descriptor table for unix domain sockets. This should be

7 * equal to the maximum number of minor devices (currently 256).

8 */

setup.c (git://git.minix3.org/minix) C · 0 lines

16 #include <net/gen/tcp_io.h>

17 #include <net/gen/netdb.h>

18 #include <net/gen/socket.h>

19 #include "rlogind.h"

20

ether.c (git://git.minix3.org/minix) C · 0 lines

41

42 #include <sys/param.h>

43 #include <sys/socket.h>

44 #ifdef _STANDALONE

45 #include <lib/libkern/libkern.h>

test58.c (git://git.minix3.org/minix) C · 182 lines

17 #include <fcntl.h>

18 #include <unistd.h>

19 #include <sys/socket.h>

20 #include <sys/types.h>

21 #include <sys/wait.h>

41

42 subtest = 1;

43 if (socketpair(PF_UNIX, SOCK_STREAM, 0, s) == -1) e(1);

44 if (system("mkdir -p " TEST_PATH) == -1) e(2);

45 if (realpath(".", testroot) == NULL) e(3);

strmode.c (git://git.minix3.org/minix) C · 0 lines

85 break;

86 #ifdef S_IFSOCK

87 case S_IFSOCK: /* socket */

88 *p++ = 's';

89 break;

socket.h (git://git.minix3.org/minix) C Header · 0 lines

40 #define SOCK_FLG_OP_READING 0x400 /* reading operation in progress */

41 #define SOCK_FLG_OP_WRITING 0x800 /* writing operation in progress */

42 #define SOCK_FLG_CLOSED 0x1000 /* tcp socket has been closed do not

43 expect any more data */

44 /* select() flags - they say what action do we monitor */

87 #define get_sock(x) &socket[x]

88

89 #define MAX_SOCKETS 255 /* FIXME as log as the sockets are identified by the

90 minor device number 255 is ok */

91 #define MAX_DEVS 5

92 #define RESERVED (SOCK_TYPES + MAX_DEVS) /* rounded to 8 */

93

94 extern struct socket socket[MAX_SOCKETS];

95

96 void socket_request(message * m);

ansi.h (git://git.minix3.org/minix) C++ Header · 70 lines

42 typedef long __off_t; /* file offset */

43 typedef int __pid_t; /* process id */

44 typedef __uint8_t __sa_family_t; /* socket address family */

45 typedef __int32_t __socklen_t; /* socket-related datum length */

getpeereid.c (git://git.minix3.org/minix) C · 0 lines

38 #include <unistd.h>

39 #include <sys/un.h>

40 #include <sys/socket.h>

41

42

ip_cksum.c (git://git.minix3.org/minix) C · 0 lines

41

42 #include <sys/types.h>

43 #include <sys/socket.h>

44

45 #include <net/if.h>

compat_lastlogx.c (git://git.minix3.org/minix) C · 0 lines

38 #include <sys/types.h>

39 #include <sys/param.h>

40 #include <sys/socket.h>

41 #include <sys/stat.h>

42 #include <sys/time.h>

pmap_prot.h (git://git.minix3.org/minix) C Header · 0 lines

67 * This file has no interface to xdr routines for PMAPPROC_CALLIT.

68 *

69 * The service supports remote procedure calls on udp/ip or tcp/ip socket 111.

70 */

71

configure.ac (git://git.minix3.org/minix) m4 · 92 lines

23 AC_HEADER_SYS_WAIT

24 AC_CHECK_HEADERS(stdint.h fcntl.h stdint.h inttypes.h unistd.h)

25 AC_CHECK_HEADERS(sys/un.h sys/socket.h limits.h)

26 AC_CHECK_HEADERS(arpa/inet.h getopt.h err.h)

27 AC_CHECK_HEADERS(sys/types.h util.h sys/time.h time.h)

43 AC_TYPE_SIZE_T

44 AC_SYS_LARGEFILE

45 AC_CHECK_MEMBERS([struct sockaddr.sa_len], [], [], [#include <sys/socket.h>])

46

47 AC_TYPE_PID_T

select.h (git://git.minix3.org/minix) C Header · 0 lines

47 struct timespec;

48 struct cpu_info;

49 struct socket;

50

51 int selcommon(register_t *, int, fd_set *, fd_set *, fd_set *,

56 void selinit(struct selinfo *);

57 void seldestroy(struct selinfo *);

58 int pollsock(struct socket *, const struct timespec *, int);

59

60 #else /* _KERNEL */

netif_small.c (git://git.minix3.org/minix) C · 0 lines

33

34 #include <sys/types.h>

35 #include <sys/socket.h>

36 #ifdef _STANDALONE

37 #include <lib/libkern/libkern.h>

56 #endif

57

58 /* we allow for one socket only */

59 static struct iodesc iosocket;

65 return NULL;

66 }

67 return &iosocket;

68 }

69

73 struct iodesc *io;

74

75 io = &iosocket;

76 if (io->io_netif) {

77 #ifdef NETIF_DEBUG

sockatmark.c (git://git.minix3.org/minix) C · 0 lines

38

39 #include <sys/ioctl.h>

40 #include <sys/socket.h>

41

42 #include <assert.h>

memp_std.h (git://git.minix3.org/minix) C Header · 0 lines

82 LWIP_MEMPOOL(SNMP_VALUE, MEMP_NUM_SNMP_VALUE, SNMP_MAX_VALUE_SIZE, "SNMP_VALUE")

83 #endif /* LWIP_SNMP */

84 #if LWIP_DNS && LWIP_SOCKET

85 LWIP_MEMPOOL(NETDB, MEMP_NUM_NETDB, NETDB_ELEM_SIZE, "NETDB")

86 #endif /* LWIP_DNS && LWIP_SOCKET */

ethers.c (git://git.minix3.org/minix) C · 0 lines

15 #include "namespace.h"

16 #include <sys/param.h>

17 #include <sys/socket.h>

18

19 #include <net/if.h>

ti1225.h (git://git.minix3.org/minix) C Header · 0 lines

17 #define TI_DEV_CTRL 0x92

18

19 /* CardBus Socket Registers */

20 struct csr

21 {

37

38 /* csr_present */

39 #define CP_YVSOCKET 0x80000000

40 #define CP_XVSOCKET 0x40000000

41 #define CP_3VSOCKET 0x20000000

42 #define CP_5VSOCKET 0x10000000

bindresvport.c (git://git.minix3.org/minix) C · 0 lines

47

48 #include <sys/types.h>

49 #include <sys/socket.h>

50

51 #include <netinet/in.h>

63

64 /*

65 * Bind a socket to a privileged IP port

66 */

67 int

74

75 /*

76 * Bind a socket to a privileged IP port

77 */

78 int

recv.c (git://git.minix3.org/minix) C · 0 lines

40

41 #include <sys/types.h>

42 #include <sys/socket.h>

43

44 #include <stddef.h>

sendmsg.c (git://git.minix3.org/minix) C · 151 lines

41

42 ROKEN_LIB_FUNCTION ssize_t ROKEN_LIB_CALL

43 sendmsg(rk_socket_t s, const struct msghdr *msg, int flags)

44 {

45 ssize_t ret;

118 * ::MSG_PARTIAL.

119 *

120 * @param[in] s The socket to use.

121 * @param[in] msg The message

122 * @param[in] flags Flags. A combination of ::MSG_DONTROUTE,

126 */

127 ROKEN_LIB_FUNCTION ssize_t ROKEN_LIB_CALL

128 sendmsg_w32(rk_socket_t s, const struct msghdr * msg, int flags)

129 {

130 int srv;

tcp_io.h (git://git.minix3.org/minix) C Header · 0 lines

39 #define TCF_DEFAULT 0 /* Default parameters */

40 #define TCF_ASYNCH 1 /* Asynchronous connect for non-blocking

41 * socket emulation.

42 */

43

proto.h (git://git.minix3.org/minix) C Header · 0 lines

28 void driver_request(message * m);

29 void driver_up(const char * label, endpoint_t ep);

30 /* opens a raw NIC socket */

31 void nic_open(message *m);

32 void nic_default_ioctl(message *m);

t40a.c (git://git.minix3.org/minix) C · 0 lines

4 *

5 * Select works on regular files, (pseudo) terminal devices, streams-based

6 * files, FIFOs, pipes, and sockets. This test verifies the FD_* macros.

7 *

8 * This test is part of a bigger select test. It expects as argument which sub-

udp.h (git://git.minix3.org/minix) C Header · 0 lines

47 } __packed;

48

49 /* socket options for UDP */

50 #define UDP_ENCAP 100

51 #define UDP_RFC6056ALGO 200

init_s.c (git://git.minix3.org/minix) C · 251 lines

58 assert(ctx->config.acl_file != NULL);

59 assert(ctx->log_context.log_file != NULL);

60 #ifndef NO_UNIX_SOCKETS

61 assert(ctx->log_context.socket_name.sun_path[0] != '\0');

62 #else

63 assert(ctx->log_context.socket_info != NULL);

64 #endif

65

74 ctx->log_context.log_fd = -1;

75

76 #ifndef NO_UNIX_SOCKETS

77 ctx->log_context.socket_fd = socket (AF_UNIX, SOCK_DGRAM, 0);

78 #else

79 ctx->log_context.socket_fd = socket (ctx->log_context.socket_info->ai_family,

80 ctx->log_context.socket_info->ai_socktype,

private.h (git://git.minix3.org/minix) C++ Header · 151 lines

77 int log_fd;

78 uint32_t version;

79 #ifndef NO_UNIX_SOCKETS

80 struct sockaddr_un socket_name;

82 struct addrinfo *socket_info;

83 #endif

84 krb5_socket_t socket_fd;

85 } kadm5_log_context;

86

net_read.c (git://git.minix3.org/minix) C · 121 lines

45

46 ROKEN_LIB_FUNCTION ssize_t ROKEN_LIB_CALL

47 net_read (rk_socket_t fd, void *buf, size_t nbytes)

48 {

49 char *cbuf = (char *)buf;

70

71 ROKEN_LIB_FUNCTION ssize_t ROKEN_LIB_CALL

72 net_read(rk_socket_t sock, void *buf, size_t nbytes)

73 {

74 char *cbuf = (char *)buf;

76 size_t rem = nbytes;

77

78 #ifdef SOCKET_IS_NOT_AN_FD

79 int use_read = 0;

80 #endif

getsockname.c (git://git.minix3.org/minix) C · 127 lines

3 getsockname()

4

5 from socket emulation library for Minix 2.0.x

6

7 */

13 #include <string.h>

14 #include <sys/ioctl.h>

15 #include <sys/socket.h>

16 #include <netinet/in.h>

17

68

69 #if DEBUG

70 fprintf(stderr, "getsockname: not implemented for fd %d\n", socket);

71 #endif

72

shutdown.c (git://git.minix3.org/minix) C · 0 lines

5 #include <stdio.h>

6 #include <sys/ioctl.h>

7 #include <sys/socket.h>

8 #include <sys/un.h>

9

69 }

70

71 /* We can't shutdown the read side of the socket. */

72 errno= ENOSYS;

73 return -1;

hi_locl.h (git://git.minix3.org/minix) C++ Header · 86 lines

39

40 #include <sys/types.h>

41 #include <sys/socket.h>

42 #ifdef HAVE_SYS_UN_H

43 #include <sys/un.h>

ipc_method.c (git://git.minix3.org/minix) C · 247 lines

86 ipviwin->ofd = ipvi->ofd;

87 } else {

88 int sockets[2];

89 struct msghdr mh;

90 IPCMSGHDR ch;

92 struct iovec iov;

93

94 socketpair(AF_LOCAL, SOCK_STREAM, 0, sockets);

95

96 mh.msg_namelen = 0;

103 iov.iov_base = &dummy;

104

105 ch.header.cmsg_level = SOL_SOCKET;

106 ch.header.cmsg_type = SCM_RIGHTS;

107 ch.header.cmsg_len = sizeof(ch);

store_fd.c (git://git.minix3.org/minix) C · 136 lines

89

90 KRB5_LIB_FUNCTION krb5_storage * KRB5_LIB_CALL

91 krb5_storage_from_fd(krb5_socket_t fd_in)

92 {

93 krb5_storage *sp;

94 int fd;

95

96 #ifdef SOCKET_IS_NOT_AN_FD

97 #ifdef _MSC_VER

98 if (_get_osfhandle(fd_in) != -1) {

102 }

103 #else

104 #error Dont know how to deal with fd that may or may not be a socket.

105 #endif

106 #else /* SOCKET_IS_NOT_AN_FD */

crypto-rand.c (git://git.minix3.org/minix) C · 112 lines

72 if (!krb5_init_context(&context)) {

73 p = krb5_config_get_string(context, NULL, "libdefaults",

74 "egd_socket", NULL);

75 if (p != NULL)

76 RAND_egd_bytes(p, ENTROPY_NEEDED);

socket.h (git://git.minix3.org/minix) C Header · 0 lines

1 /*

2 server/ip/gen/socket.h

3 */

4

5 #ifndef __SERVER__IP__GEN__SOCKET_H__

6 #define __SERVER__IP__GEN__SOCKET_H__

7

8 /* From SunOS: /usr/include/sys/socketh */

9

10 /*

40 #define AF_MAX 23

41

42 #endif /* __SERVER__IP__GEN__SOCKET_H__ */

43

crypto-stubs.c (git://git.minix3.org/minix) C · 105 lines

70 HEIMDAL_MUTEX_destroy(context->mutex);

71 free(context->mutex);

72 if (context->flags & KRB5_CTX_F_SOCKETS_INITIALIZED) {

73 rk_SOCK_EXIT();

74 }

94

95 /* This function is currently just used to get the location of the EGD

96 * socket. If we're not using an EGD, then we can just return NULL */

97

98 KRB5_LIB_FUNCTION const char* KRB5_LIB_CALL

netsock.h (git://git.minix3.org/minix) C Header · 151 lines

92 #define get_sock_num(x) ((long int) ((x) - socket))

93 #define is_valid_sock_num(x) (x < MAX_SOCKETS)

94 #define get_sock(x) &socket[x]

95

96 #define MAX_SOCKETS 255 /* FIXME as log as the sockets are identified by the

97 minor device number 255 is ok */

98 #define MAX_DEVS 5

99 #define RESERVED (SOCK_TYPES + MAX_DEVS) /* rounded to 8 */

100

101 extern struct socket socket[MAX_SOCKETS];

102

103 void socket_request(message * m);

111 void send_reply_open(message * m, int status);

112 void send_reply_close(message * m, int status);

113 void sock_reply(struct socket * sock, int status);

114 void sock_reply_close(struct socket * sock, int status);

kadm5_locl.h (git://git.minix3.org/minix) C++ Header · 86 lines

66 #include <sys/file.h>

67 #endif

68 #ifdef HAVE_SYS_SOCKET_H

69 #include <sys/socket.h>

mkpc (git://git.minix3.org/minix) Shell · 49 lines

19 NAME="OpenSSL"

20 LIBS="-lssl -lcrypto"

21 DESCRIPTION="Secure Sockets Layer and cryptography libraries"

22 ;;

23 openssl.pc)

24 NAME="OpenSSL"

25 LIBS="-lssl -lcrypto"

26 DESCRIPTION="Sockets Layer and cryptography libraries and tools"

27 ;;

28 *)

destroy_s.c (git://git.minix3.org/minix) C · 90 lines

59 {

60 free (c->log_file);

61 rk_closesocket (c->socket_fd);

62 #ifdef NO_UNIX_SOCKETS

63 if (c->socket_info) {

64 freeaddrinfo(c->socket_info);

65 c->socket_info = NULL;

66 }

67 #endif

net_write.c (git://git.minix3.org/minix) C · 110 lines

45

46 ROKEN_LIB_FUNCTION ssize_t ROKEN_LIB_CALL

47 net_write (rk_socket_t fd, const void *buf, size_t nbytes)

48 {

49 const char *cbuf = (const char *)buf;

68

69 ROKEN_LIB_FUNCTION ssize_t ROKEN_LIB_CALL

70 net_write(rk_socket_t sock, const void *buf, size_t nbytes)

71 {

72 const char *cbuf = (const char *)buf;

73 ssize_t count;

74 size_t rem = nbytes;

75 #ifdef SOCKET_IS_NOT_AN_FD

76 int use_write = 0;

77 #endif

net_write.c (git://git.minix3.org/minix) C · 121 lines

42 size_t len)

43 {

44 krb5_socket_t fd = *((krb5_socket_t *)p_fd);

45 return net_write(fd, buf, len);

46 }

53 time_t timeout)

54 {

55 krb5_socket_t fd = *((krb5_socket_t *)p_fd);

56 int ret;

57 struct timeval tv, *tvp;

73

74 ret = select(fd + 1, NULL, &wfds, NULL, tvp);

75 if (rk_IS_SOCKET_ERROR(ret)) {

76 if (rk_SOCK_ERRNO == EINTR)

77 continue;

Makefile.am (git://git.minix3.org/minix) Makefile · 240 lines

107 simple_exec.c \

108 snprintf.c \

109 socket.c \

110 strcollect.c \

111 strerror_r.c \

189 if have_socket_wrapper

190 libroken_la_SOURCES += socket_wrapper.c socket_wrapper.h

191 dist_include_HEADERS += socket_wrapper.h

getaddrinfo-test.c (git://git.minix3.org/minix) C · 150 lines

92

93 if (inet_ntop (r->ai_family,

94 socket_get_address (r->ai_addr),

95 addrstr, sizeof(addrstr)) == NULL) {

96 if (verbose_counter)

103 r->ai_family, r->ai_socktype, r->ai_protocol,

104 addrstr,

105 ntohs(socket_get_port (r->ai_addr)));

106 if (r->ai_canonname)

107 printf (", canonname = \"%s\"", r->ai_canonname);

kafs_locl.h (git://git.minix3.org/minix) C++ Header · 161 lines

69 #include <sys/syscall.h>

70 #endif

71 #ifdef HAVE_SYS_SOCKET_H

72 #include <sys/socket.h>

kuser_locl.h (git://git.minix3.org/minix) C++ Header · 111 lines

54 #include <sys/time.h>

55 #endif

56 #ifdef HAVE_SYS_SOCKET_H

57 #include <sys/socket.h>

kpasswd_locl.h (git://git.minix3.org/minix) C++ Header · 107 lines

67 #include <sys/select.h>

68 #endif

69 #ifdef HAVE_SYS_SOCKET_H

70 #include <sys/socket.h>

wait-kdc.sh (git://git.minix3.org/minix) Shell · 64 lines

48 break

49 fi

50 if tail -30 ${log} | grep "No sockets" ; then

51 echo "The ${name} failed to bind to any sockets, another ${name} running ?"

53 fi

54 if tail -30 ${log} | grep "bind" | grep "Operation not permitted" ; then

55 echo "The ${name} failed to bind to any sockets, another ${name} running ?"

56 exit 1

57 fi

getnameinfo_verified.c (git://git.minix3.org/minix) C · 97 lines

78 goto fail;

79

80 saaddr = socket_get_address(sa);

81 sasize = socket_addr_size(sa);

82 for (a = ai; a != NULL; a = a->ai_next) {

83 if (sasize == socket_addr_size(a->ai_addr) &&

84 memcmp(saaddr, socket_get_address(a->ai_addr), sasize) == 0) {

kadmin_locl.h (git://git.minix3.org/minix) C++ Header · 160 lines

58 #include <fcntl.h>

59 #endif

60 #ifdef HAVE_SYS_SOCKET_H

61 #include <sys/socket.h>

net_read.c (git://git.minix3.org/minix) C · 47 lines

42 size_t len)

43 {

44 krb5_socket_t fd = *((krb5_socket_t *)p_fd);

45 return net_read(fd, buf, len);

46 }

krb5-types.h (git://git.minix3.org/minix) C Header · 0 lines

7 #include <inttypes.h>

8 #include <sys/types.h>

9 #include <sys/socket.h>

10

11

Makefile (git://git.minix3.org/minix) Makefile · 0 lines

2 PROG= lwip

3 SRCS= lwip.c \

4 socket.c \

5 driver.c \

6 udp.c \

Makefile (git://git.minix3.org/minix) Makefile · 10 lines

5 CFLAGS += -Wall -Wextra -std=c99

6

7 SRCS += socket.c

8

9 .include <bsd.lib.mk>

Makefile (git://git.minix3.org/minix) Makefile · 0 lines

5 CPPFLAGS+= -DHAVE_SYS_PARAM_H \

6 -DHAVE_SYS_IOCTL_H \

7 -DHAVE_SYS_SOCKET_H \

8 -DHAVE_SYS_STAT_H \

9 -DHAVE_SYS_TIME_H \