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" |
| 12 | #include "../include/selinux/selinux.h" |
Joshua Brindle | 13cd4c8 | 2008-08-19 15:30:36 -0400 | [diff] [blame] | 13 | %} |
| 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 Smalley | 9eb9c93 | 2014-02-19 09:16:17 -0500 | [diff] [blame] | 35 | %typemap(in, numinputs=0) (char ***) (char **temp) { |
Joshua Brindle | 13cd4c8 | 2008-08-19 15:30:36 -0400 | [diff] [blame] | 36 | $1 = &temp; |
| 37 | } |
| 38 | |
Stephen Smalley | 9eb9c93 | 2014-02-19 09:16:17 -0500 | [diff] [blame] | 39 | %typemap(freearg) (char ***) { |
Joshua Brindle | 13cd4c8 | 2008-08-19 15:30:36 -0400 | [diff] [blame] | 40 | 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 Walsh | 7ab6b29 | 2009-03-10 20:31:38 -0400 | [diff] [blame] | 54 | /* 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 Brindle | 13cd4c8 | 2008-08-19 15:30:36 -0400 | [diff] [blame] | 59 | %include "../include/selinux/avc.h" |
Daniel J Walsh | 66d0760 | 2009-09-16 16:58:12 -0400 | [diff] [blame] | 60 | %include "../include/selinux/av_permissions.h" |
| 61 | %include "../include/selinux/context.h" |
| 62 | %include "../include/selinux/flask.h" |
Joshua Brindle | 13cd4c8 | 2008-08-19 15:30:36 -0400 | [diff] [blame] | 63 | %include "../include/selinux/get_context_list.h" |
Daniel J Walsh | 66d0760 | 2009-09-16 16:58:12 -0400 | [diff] [blame] | 64 | %include "../include/selinux/get_default_type.h" |
| 65 | %include "../include/selinux/label.h" |
| 66 | %include "../include/selinux/selinux.h" |