4 #include <netinet/in.h>
6 extern unsigned int nr_sockets
;
8 /* protocol decoding */
9 extern unsigned int specific_proto
;
12 /* glibc headers might be older than the kernel, so chances are we know
13 * about more protocols than glibc does. So we define our own PF_MAX */
14 #define TRINITY_PF_MAX 41
19 #define PF_NOHINT (-1)
21 struct socket_triplet
{
24 unsigned int protocol
;
29 unsigned long optname
;
34 /* We create one of these per socket fd we open, and store them in shm->sockets */
36 struct socket_triplet triplet
;
40 void open_sockets(void);
41 void close_sockets(void);
43 void generate_sockaddr(unsigned long *addr
, unsigned long *addrlen
, int pf
);
45 void do_setsockopt(struct sockopt
*so
);
47 void rand_proto_type(struct socket_triplet
*st
);
48 int sanitise_socket_triplet(struct socket_triplet
*st
);
49 void gen_socket_args(struct socket_triplet
*st
);
52 int get_random_ether_type(void);
55 in_addr_t
random_ipv4_address(void);
56 void ipv4_gen_sockaddr(unsigned long *addr
, unsigned long *addrlen
);
57 void inet_rand_socket(struct socket_triplet
*st
);
58 void ip_setsockopt(struct sockopt
*so
);
61 void ipv6_gen_sockaddr(unsigned long *addr
, unsigned long *addrlen
);
62 void inet6_rand_socket(struct socket_triplet
*st
);
63 void inet6_setsockopt(struct sockopt
*so
);
66 void pppox_gen_sockaddr(unsigned long *addr
, unsigned long *addrlen
);
67 void pppol2tp_setsockopt(struct sockopt
*so
);
70 void unix_gen_sockaddr(unsigned long *addr
, unsigned long *addrlen
);
71 void unix_rand_socket(struct socket_triplet
*st
);
74 void gen_bpf(unsigned long *addr
, unsigned long *addrlen
);
75 void gen_seccomp_bpf(unsigned long *addr
, unsigned long *addrlen
);
78 void caif_gen_sockaddr(unsigned long *addr
, unsigned long *addrlen
);
79 void caif_rand_socket(struct socket_triplet
*st
);
80 void caif_setsockopt(struct sockopt
*so
);
83 void alg_gen_sockaddr(unsigned long *addr
, unsigned long *addrlen
);
84 void alg_setsockopt(struct sockopt
*so
);
87 void nfc_gen_sockaddr(unsigned long *addr
, unsigned long *addrlen
);
88 void nfc_rand_socket(struct socket_triplet
*st
);
89 void nfc_setsockopt(struct sockopt
*so
);
92 void ax25_gen_sockaddr(unsigned long *addr
, unsigned long *addrlen
);
93 void ax25_rand_socket(struct socket_triplet
*st
);
94 void ax25_setsockopt(struct sockopt
*so
);
97 void ipx_gen_sockaddr(unsigned long *addr
, unsigned long *addrlen
);
98 void ipx_rand_socket(struct socket_triplet
*st
);
99 void ipx_setsockopt(struct sockopt
*so
);
102 void atalk_gen_sockaddr(unsigned long *addr
, unsigned long *addrlen
);
103 void atalk_rand_socket(struct socket_triplet
*st
);
104 void atalk_setsockopt(struct sockopt
*so
);
107 void atmpvc_gen_sockaddr(unsigned long *addr
, unsigned long *addrlen
);
108 void atmsvc_gen_sockaddr(unsigned long *addr
, unsigned long *addrlen
);
109 void atm_setsockopt(struct sockopt
*so
);
112 void x25_gen_sockaddr(unsigned long *addr
, unsigned long *addrlen
);
113 void x25_rand_socket(struct socket_triplet
*st
);
114 void x25_setsockopt(struct sockopt
*so
);
117 void rose_gen_sockaddr(unsigned long *addr
, unsigned long *addrlen
);
118 void rose_setsockopt(struct sockopt
*so
);
121 void decnet_gen_sockaddr(unsigned long *addr
, unsigned long *addrlen
);
122 void decnet_rand_socket(struct socket_triplet
*st
);
123 void decnet_setsockopt(struct sockopt
*so
);
126 void llc_gen_sockaddr(unsigned long *addr
, unsigned long *addrlen
);
127 void llc_rand_socket(struct socket_triplet
*st
);
128 void llc_setsockopt(struct sockopt
*so
);
131 void netlink_gen_sockaddr(unsigned long *addr
, unsigned long *addrlen
);
132 void netlink_rand_socket(struct socket_triplet
*st
);
133 void netlink_setsockopt(struct sockopt
*so
);
136 void packet_gen_sockaddr(unsigned long *addr
, unsigned long *addrlen
);
137 void packet_rand_socket(struct socket_triplet
*st
);
138 void packet_setsockopt(struct sockopt
*so
);
141 void econet_gen_sockaddr(unsigned long *addr
, unsigned long *addrlen
);
144 void irda_gen_sockaddr(unsigned long *addr
, unsigned long *addrlen
);
145 void irda_rand_socket(struct socket_triplet
*st
);
146 void irda_setsockopt(struct sockopt
*so
);
149 void can_gen_sockaddr(unsigned long *addr
, unsigned long *addrlen
);
150 void can_rand_socket(struct socket_triplet
*st
);
153 void tipc_gen_sockaddr(unsigned long *addr
, unsigned long *addrlen
);
154 void tipc_rand_socket(struct socket_triplet
*st
);
155 void tipc_setsockopt(struct sockopt
*so
);
158 void phonet_gen_sockaddr(unsigned long *addr
, unsigned long *addrlen
);
159 void phonet_rand_socket(struct socket_triplet
*st
);
162 void rds_rand_socket(struct socket_triplet
*st
);
163 void rds_setsockopt(struct sockopt
*so
);
165 /* setsockopt functions */
166 void socket_setsockopt(struct sockopt
*so
);
167 void tcp_setsockopt(struct sockopt
*so
);
168 void udp_setsockopt(struct sockopt
*so
);
169 void udplite_setsockopt(struct sockopt
*so
);
170 void icmpv6_setsockopt(struct sockopt
*so
);
171 void sctp_setsockopt(struct sockopt
*so
);
172 void raw_setsockopt(struct sockopt
*so
);
173 void netrom_setsockopt(struct sockopt
*so
);
174 void aal_setsockopt(struct sockopt
*so
);
175 void netbeui_setsockopt(struct sockopt
*so
);
176 void dccp_setsockopt(struct sockopt
*so
);
177 void rxrpc_setsockopt(struct sockopt
*so
);
178 void bluetooth_setsockopt(struct sockopt
*so
);
179 void pnpipe_setsockopt(struct sockopt
*so
);
180 void iucv_setsockopt(struct sockopt
*so
);