blob: c72b8182a25e80dc2d15e4864824e80afec53c51 [file] [log] [blame]
Joshua Brindle13cd4c82008-08-19 15:30:36 -04001/* Authors: Dan Walsh
2 * James Athey
3 */
4
5%module selinux
6%{
Joshua Brindle13cd4c82008-08-19 15:30:36 -04007 #include "../include/selinux/avc.h"
Daniel J Walsh66d07602009-09-16 16:58:12 -04008 #include "../include/selinux/context.h"
Joshua Brindle13cd4c82008-08-19 15:30:36 -04009 #include "../include/selinux/get_context_list.h"
Daniel J Walsh66d07602009-09-16 16:58:12 -040010 #include "../include/selinux/get_default_type.h"
11 #include "../include/selinux/label.h"
12 #include "../include/selinux/selinux.h"
Joshua Brindle13cd4c82008-08-19 15:30:36 -040013%}
14%apply int *OUTPUT { int *enforce };
15%apply int *OUTPUT { size_t * };
16
17%typedef unsigned mode_t;
18%typedef unsigned pid_t;
19
20%typemap(in, numinputs=0) (char ***names, int *len) (char **temp1, int temp2) {
21 $1 = &temp1;
22 $2 = &temp2;
23}
24
25%typemap(freearg) (char ***names, int *len) {
26 int i;
27 if (*$1) {
28 for (i = 0; i < *$2; i++) {
29 free((*$1)[i]);
30 }
31 free(*$1);
32 }
33}
34
Stephen Smalley9eb9c932014-02-19 09:16:17 -050035%typemap(in, numinputs=0) (char ***) (char **temp) {
Joshua Brindle13cd4c82008-08-19 15:30:36 -040036 $1 = &temp;
37}
38
Stephen Smalley9eb9c932014-02-19 09:16:17 -050039%typemap(freearg) (char ***) {
Joshua Brindle13cd4c82008-08-19 15:30:36 -040040 if (*$1) freeconary(*$1);
41}
42
43/* Ignore functions that don't make sense when wrapped */
44%ignore freecon;
45%ignore freeconary;
46
47/* Ignore functions that take a function pointer as an argument */
48%ignore set_matchpathcon_printf;
49%ignore set_matchpathcon_invalidcon;
50%ignore set_matchpathcon_canoncon;
51
52%ignore avc_add_callback;
53
Eamon Walsh7ab6b292009-03-10 20:31:38 -040054/* Ignore netlink stuff for now */
55%ignore avc_netlink_acquire_fd;
56%ignore avc_netlink_release_fd;
57%ignore avc_netlink_check_nb;
58
Joshua Brindle13cd4c82008-08-19 15:30:36 -040059%include "../include/selinux/avc.h"
Daniel J Walsh66d07602009-09-16 16:58:12 -040060%include "../include/selinux/av_permissions.h"
61%include "../include/selinux/context.h"
62%include "../include/selinux/flask.h"
Joshua Brindle13cd4c82008-08-19 15:30:36 -040063%include "../include/selinux/get_context_list.h"
Daniel J Walsh66d07602009-09-16 16:58:12 -040064%include "../include/selinux/get_default_type.h"
65%include "../include/selinux/label.h"
66%include "../include/selinux/selinux.h"