2 #include <sys/socket.h>
4 #include <netinet/in.h>
5 #include <linux/tipc.h>
10 void tipc_gen_sockaddr(unsigned long **addr
, unsigned long *addrlen
)
12 struct sockaddr_tipc
*tipc
;
14 tipc
= malloc(sizeof(struct sockaddr_tipc
));
17 tipc
->family
= AF_TIPC
;
18 tipc
->addrtype
= rand();
20 tipc
->addr
.id
.ref
= rand();
21 tipc
->addr
.id
.node
= rand();
22 tipc
->addr
.nameseq
.type
= rand();
23 tipc
->addr
.nameseq
.lower
= rand();
24 tipc
->addr
.nameseq
.upper
= rand();
25 tipc
->addr
.name
.name
.type
= rand();
26 tipc
->addr
.name
.name
.instance
= rand();
27 tipc
->addr
.name
.domain
= rand();
28 *addr
= (unsigned long *) tipc
;
29 *addrlen
= sizeof(struct sockaddr_tipc
);
32 void tipc_rand_socket(struct socket_triplet
*st
)
37 case 0: st
->type
= SOCK_STREAM
;
39 case 1: st
->type
= SOCK_SEQPACKET
;
41 case 2: st
->type
= SOCK_DGRAM
;