blob: 18c773286b91744ccf0447b60597db3acc353f9a [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001#ifndef _INET_COMMON_H
2#define _INET_COMMON_H
3
Eric Dumazet90ddc4f2005-12-22 12:49:22 -08004extern const struct proto_ops inet_stream_ops;
5extern const struct proto_ops inet_dgram_ops;
Linus Torvalds1da177e2005-04-16 15:20:36 -07006
7/*
8 * INET4 prototypes used by INET6
9 */
10
Arnaldo Carvalho de Melo77d8bf92005-08-09 20:00:51 -070011struct msghdr;
12struct sock;
13struct sockaddr;
14struct socket;
15
Linus Torvalds1da177e2005-04-16 15:20:36 -070016extern int inet_release(struct socket *sock);
17extern int inet_stream_connect(struct socket *sock,
18 struct sockaddr * uaddr,
19 int addr_len, int flags);
20extern int inet_dgram_connect(struct socket *sock,
21 struct sockaddr * uaddr,
22 int addr_len, int flags);
23extern int inet_accept(struct socket *sock,
24 struct socket *newsock, int flags);
25extern int inet_sendmsg(struct kiocb *iocb,
26 struct socket *sock,
27 struct msghdr *msg,
28 size_t size);
29extern int inet_shutdown(struct socket *sock, int how);
Linus Torvalds1da177e2005-04-16 15:20:36 -070030extern int inet_listen(struct socket *sock, int backlog);
31
32extern void inet_sock_destruct(struct sock *sk);
Linus Torvalds1da177e2005-04-16 15:20:36 -070033
34extern int inet_bind(struct socket *sock,
35 struct sockaddr *uaddr, int addr_len);
36extern int inet_getname(struct socket *sock,
37 struct sockaddr *uaddr,
38 int *uaddr_len, int peer);
39extern int inet_ioctl(struct socket *sock,
40 unsigned int cmd, unsigned long arg);
41
Denis V. Luneveee4fe42008-04-03 14:27:58 -070042extern int inet_ctl_sock_create(struct sock **sk,
Denis V. Lunev3d58b5f2008-04-03 14:22:32 -070043 unsigned short family,
44 unsigned short type,
Denis V. Lunev56772422008-04-03 14:28:30 -070045 unsigned char protocol,
46 struct net *net);
47
48static inline void inet_ctl_sock_destroy(struct sock *sk)
49{
50 sk_release_kernel(sk);
51}
Denis V. Lunev3d58b5f2008-04-03 14:22:32 -070052
Linus Torvalds1da177e2005-04-16 15:20:36 -070053#endif
54
55