2 #include <sys/socket.h>
5 #include <netinet/in.h>
14 #define SERVPATH "/tmp/rump_sysproxy_test"
47 struct sockaddr_un sun
;
49 s
= socket(AF_LOCAL
, SOCK_STREAM
, 0);
53 memset(&sun
, 0, sizeof(sun
));
54 sun
.sun_family
= AF_LOCAL
;
55 strcpy(sun
.sun_path
, SERVPATH
);
56 if (bind(s
, (struct sockaddr
*)&sun
, SUN_LEN(&sun
)) == -1)
59 signal(SIGINT
, sigint
);
60 signal(SIGSEGV
, sigabrt
);
61 if (listen(s
, 1) == -1)
64 s2
= accept(s
, (struct sockaddr
*)&sun
, &slen
);
68 struct sockaddr_in sin
;
70 s
= socket(AF_INET
, SOCK_STREAM
, 0);
74 memset(&sin
, 0, sizeof(sin
));
75 sin
.sin_family
= AF_INET
;
76 sin
.sin_port
= htons(12345);
77 sin
.sin_addr
.s_addr
= INADDR_ANY
;
79 if (bind(s
, (struct sockaddr
*)&sin
, sizeof(sin
)) == -1)
81 if (listen(s
, 1) == -1)
84 s2
= accept(s
, (struct sockaddr
*)&sin
, &slen
);
90 rump_sysproxy_socket_setup_server(s2
);