Signed-off-by: John Johansen <[email protected]>
---
 parser/network.c |   19 +++++++++++++++++++
 parser/network.h |    5 +++++
 2 files changed, 24 insertions(+)

--- 2.9-test.orig/parser/network.c
+++ 2.9-test/parser/network.c
@@ -305,6 +305,25 @@
 #include "af_names.h"
 };
 
+int net_find_af_val(const char *af)
+{
+       int i;
+       for (i = 0; network_families[i]; i++) {
+               if (strcmp(network_families[i], af) == 0)
+                       return i;
+       }
+
+       return -1;
+}
+
+const char *net_find_af_name(unsigned int af)
+{
+       if (af < 0 || af > get_af_max())
+               return NULL;
+
+       return network_families[af];
+}
+
 void __debug_network(unsigned int *array, const char *name)
 {
        unsigned int count = sizeof(sock_types)/sizeof(sock_types[0]);
--- 2.9-test.orig/parser/network.h
+++ 2.9-test/parser/network.h
@@ -77,5 +77,10 @@
 
 int net_find_type_val(const char *type);
 const char *net_find_type_name(int type);
+int net_find_af_val(const char *af);
+const char *net_find_af_name(unsigned int af);
+const struct network_tuple *net_find_mapping(const char *family,
+                                            const char *type,
+                                            const char *protocol);
 
 #endif /* __AA_NETWORK_H */


-- 
AppArmor mailing list
[email protected]
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/apparmor

Reply via email to