2 #include <sys/socket.h>
4 #include <netinet/in.h>
10 void unix_gen_sockaddr(struct sockaddr
**addr
, socklen_t
*addrlen
)
12 struct sockaddr_un
*unixsock
;
15 unixsock
= malloc(sizeof(struct sockaddr_un
));
19 unixsock
->sun_family
= PF_UNIX
;
21 memset(&page_rand
[len
], 0, 1);
22 strncpy(unixsock
->sun_path
, page_rand
, len
);
23 *addr
= (struct sockaddr
*) unixsock
;
24 *addrlen
= sizeof(struct sockaddr_un
);
27 void unix_rand_socket(struct socket_triplet
*st
)
29 st
->protocol
= PF_UNIX
;
32 case 0: st
->type
= SOCK_STREAM
;
34 case 1: st
->type
= SOCK_DGRAM
;
36 case 2: st
->type
= SOCK_SEQPACKET
;