Skip to contentSkip to conversation

netlabel: Add support for enumerating the CALIPSO DOI list.

RFC PATCH Superseded Huw Davies 1 participant 1 message Jan 8, 2016

Subsystems (4)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Huw Davies

author
#0 lore raw

RFC PATCH v2 5/18 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 |   3 ++
 4 files changed, 154 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 +3 -0
index 6cf1cad..5d86752 100644
@@ -126,5 +126,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
1.8.0