2 #include <sys/socket.h>
4 #include <netinet/in.h>
8 #include "maps.h" // page_rand
11 void x25_gen_sockaddr(struct sockaddr
**addr
, socklen_t
*addrlen
)
13 struct sockaddr_x25
*x25
;
16 x25
= malloc(sizeof(struct sockaddr_x25
));
20 x25
->sx25_family
= PF_X25
;
22 memset(&page_rand
[len
], 0, 1);
23 strncpy(x25
->sx25_addr
.x25_addr
, page_rand
, len
);
24 *addr
= (struct sockaddr
*) x25
;
25 *addrlen
= sizeof(struct sockaddr_x25
);
28 void x25_rand_socket(struct socket_triplet
*st
)
30 st
->type
= SOCK_SEQPACKET
;
34 void x25_setsockopt(struct sockopt
*so
)
38 page_rand
[0] = rand_bool();
39 so
->optval
= sizeof(int);