xref: /linux/security/apparmor/include/af_inet.h (revision 4f0cafcb2850a08d9081eea3ac8bec17b9a9881c)
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /*
3  * AppArmor security module
4  *
5  * This file contains AppArmor inet/inet6 fine grained mediation
6  *
7  * Copyright 2024 Canonical Ltd.
8  *
9  * This program is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU General Public License as
11  * published by the Free Software Foundation, version 2 of the
12  * License.
13  */
14 #ifndef __AA_AF_INET_H
15 #define __AA_AF_INET_H
16 
17 #include "label.h"
18 
19 int aa_inet_sock_perm(const char *op, u32 request, struct socket *sock);
20 int aa_inet_create_perm(struct aa_label *label, int family, int type,
21 			int protocol);
22 int aa_inet_bind_perm(struct socket *sock, struct sockaddr *address,
23 		      int addrlen);
24 int aa_inet_connect_perm(struct socket *sock, struct sockaddr *address,
25 			 int addrlen);
26 int aa_inet_listen_perm(struct socket *sock, int backlog);
27 int aa_inet_accept_perm(struct socket *sock, struct socket *newsock);
28 int aa_inet_msg_perm(const char *op, u32 request, struct socket *sock,
29 		     struct msghdr *msg, int size);
30 int aa_inet_opt_perm(const char *op, u32 request, struct socket *sock, int level,
31 		     int optname);
32 int aa_inet_file_perm(const struct cred *subj_cred,
33 		      struct aa_label *label, const char *op, u32 request,
34 		      struct socket *sock);
35 
36 #endif /* __AA_AF_INET_H */
37