Skip to contentSkip to conversation

netlabel: Add support for enumerating the CALIPSO DOI list.

RFC PATCH In review Huw Davies 1 participant 1 message Feb 17, 2016

Subsystems (4)
lore
Share & tools
lore

Huw Davies

author
#0 lore raw

RFC PATCH v3 5/19 netlabel: Add support for enumerating the CALIPSO DOI list.

Enumerate the DOI list through the NLBL_CALIPSO_C_LISTALL command. It takes no attributes.

---
 include/net/netlabel.h          |   4 ++
 net/ipv6/calipso.c              |  41 ++++++++++++++++
 net/netlabel/netlabel_calipso.c | 106 ++++++++++++++++++++++++++++++++++++++++
 net/netlabel/netlabel_calipso.h |  14 ++++++
 4 files changed, 165 insertions(+)
include/net/netlabel.h +4 -0
index 0f05b83..2653d3a 100644
@@ -225,6 +225,7 @@ struct netlbl_lsm_secattr {
  * @doi_free: free a CALIPSO DOI
  * @doi_getdef: returns a reference to a DOI
  * @doi_putdef: releases a reference of a DOI
+ * @doi_walk: enumerate the DOI list
  *
  * Description:
  * This structure is filled out by the CALIPSO engine and passed
@@ -238,6 +239,9 @@ struct netlbl_calipso_ops {
 	void (*doi_free)(struct calipso_doi *doi_def);
 	struct calipso_doi *(*doi_getdef)(u32 doi);
 	void (*doi_putdef)(struct calipso_doi *doi_def);
+	int (*doi_walk)(u32 *skip_cnt,
+			int (*callback)(struct calipso_doi *doi_def, void *arg),
+			void *cb_arg);
 };
 
 /*
net/ipv6/calipso.c +41 -0

52 lines not on this page · raw message

net/netlabel/netlabel_calipso.c +106 -0

127 lines not on this page · raw message

net/netlabel/netlabel_calipso.h +14 -0
index 6da737a..1f24174 100644
@@ -63,6 +63,17 @@
  *
  *   If using CALIPSO_MAP_PASS no additional attributes are required.
  *
+ * o LISTALL:
+ *   This message is sent by an application to list the valid DOIs on the
+ *   system.  When sent by an application there is no payload and the
+ *   NLM_F_DUMP flag should be set.  The kernel should respond with a series of
+ *   the following messages.
+ *
+ *   Required attributes:
+ *
+ *    NLBL_CALIPSO_A_DOI
+ *    NLBL_CALIPSO_A_MTYPE
+ *
  */
 
 /* NetLabel CALIPSO commands */
@@ -105,5 +116,8 @@ int calipso_doi_add(struct calipso_doi *doi_def,
 void calipso_doi_free(struct calipso_doi *doi_def);
 struct calipso_doi *calipso_doi_getdef(u32 doi);
 void calipso_doi_putdef(struct calipso_doi *doi_def);
+int calipso_doi_walk(u32 *skip_cnt,
+		     int (*callback)(struct calipso_doi *doi_def, void *arg),
+		     void *cb_arg);
 
 #endif
Signature · 1 line
2.7.0