Joshua Brindle | 13cd4c8 | 2008-08-19 15:30:36 -0400 | [diff] [blame] | 1 | /* Authors: Dan Walsh |
| 2 | * James Athey |
| 3 | */ |
| 4 | |
| 5 | %module selinux |
| 6 | %{ |
Joshua Brindle | 13cd4c8 | 2008-08-19 15:30:36 -0400 | [diff] [blame] | 7 | #include "../include/selinux/avc.h" |
Daniel J Walsh | 66d0760 | 2009-09-16 16:58:12 -0400 | [diff] [blame] | 8 | #include "../include/selinux/context.h" |
Joshua Brindle | 13cd4c8 | 2008-08-19 15:30:36 -0400 | [diff] [blame] | 9 | #include "../include/selinux/get_context_list.h" |
Daniel J Walsh | 66d0760 | 2009-09-16 16:58:12 -0400 | [diff] [blame] | 10 | #include "../include/selinux/get_default_type.h" |
| 11 | #include "../include/selinux/label.h" |
Petr Lautrbach | 0399ec6 | 2016-12-22 13:43:08 +0100 | [diff] [blame] | 12 | #include "../include/selinux/restorecon.h" |
Daniel J Walsh | 66d0760 | 2009-09-16 16:58:12 -0400 | [diff] [blame] | 13 | #include "../include/selinux/selinux.h" |
Joshua Brindle | 13cd4c8 | 2008-08-19 15:30:36 -0400 | [diff] [blame] | 14 | %} |
| 15 | %apply int *OUTPUT { int *enforce }; |
| 16 | %apply int *OUTPUT { size_t * }; |
| 17 | |
| 18 | %typedef unsigned mode_t; |
| 19 | %typedef unsigned pid_t; |
| 20 | |
Nicolas Iooss | ded385d | 2017-02-27 21:39:35 +0100 | [diff] [blame] | 21 | %typemap(in, numinputs=0) (char ***names, int *len) (char **temp1=NULL, int temp2) { |
Joshua Brindle | 13cd4c8 | 2008-08-19 15:30:36 -0400 | [diff] [blame] | 22 | $1 = &temp1; |
| 23 | $2 = &temp2; |
| 24 | } |
| 25 | |
| 26 | %typemap(freearg) (char ***names, int *len) { |
| 27 | int i; |
| 28 | if (*$1) { |
| 29 | for (i = 0; i < *$2; i++) { |
| 30 | free((*$1)[i]); |
| 31 | } |
| 32 | free(*$1); |
| 33 | } |
| 34 | } |
| 35 | |
Nicolas Iooss | ded385d | 2017-02-27 21:39:35 +0100 | [diff] [blame] | 36 | %typemap(in, numinputs=0) (char ***) (char **temp=NULL) { |
Joshua Brindle | 13cd4c8 | 2008-08-19 15:30:36 -0400 | [diff] [blame] | 37 | $1 = &temp; |
| 38 | } |
| 39 | |
Stephen Smalley | 9eb9c93 | 2014-02-19 09:16:17 -0500 | [diff] [blame] | 40 | %typemap(freearg) (char ***) { |
Joshua Brindle | 13cd4c8 | 2008-08-19 15:30:36 -0400 | [diff] [blame] | 41 | if (*$1) freeconary(*$1); |
| 42 | } |
| 43 | |
| 44 | /* Ignore functions that don't make sense when wrapped */ |
| 45 | %ignore freecon; |
| 46 | %ignore freeconary; |
| 47 | |
| 48 | /* Ignore functions that take a function pointer as an argument */ |
| 49 | %ignore set_matchpathcon_printf; |
| 50 | %ignore set_matchpathcon_invalidcon; |
| 51 | %ignore set_matchpathcon_canoncon; |
| 52 | |
| 53 | %ignore avc_add_callback; |
| 54 | |
Eamon Walsh | 7ab6b29 | 2009-03-10 20:31:38 -0400 | [diff] [blame] | 55 | /* Ignore netlink stuff for now */ |
| 56 | %ignore avc_netlink_acquire_fd; |
| 57 | %ignore avc_netlink_release_fd; |
| 58 | %ignore avc_netlink_check_nb; |
| 59 | |
Joshua Brindle | 13cd4c8 | 2008-08-19 15:30:36 -0400 | [diff] [blame] | 60 | %include "../include/selinux/avc.h" |
Daniel J Walsh | 66d0760 | 2009-09-16 16:58:12 -0400 | [diff] [blame] | 61 | %include "../include/selinux/context.h" |
Joshua Brindle | 13cd4c8 | 2008-08-19 15:30:36 -0400 | [diff] [blame] | 62 | %include "../include/selinux/get_context_list.h" |
Daniel J Walsh | 66d0760 | 2009-09-16 16:58:12 -0400 | [diff] [blame] | 63 | %include "../include/selinux/get_default_type.h" |
| 64 | %include "../include/selinux/label.h" |
Petr Lautrbach | 0399ec6 | 2016-12-22 13:43:08 +0100 | [diff] [blame] | 65 | %include "../include/selinux/restorecon.h" |
Daniel J Walsh | 66d0760 | 2009-09-16 16:58:12 -0400 | [diff] [blame] | 66 | %include "../include/selinux/selinux.h" |