netlabel: Add support for querying a CALIPSO DOI.
RFC PATCH v3 4/19 netlabel: Add support for querying a CALIPSO DOI.
Query a specified DOI through the NLBL_CALIPSO_C_LIST command. It requires the attribute:
NLBL_CALIPSO_A_DOI.
The reply will contain:
NLBL_CALIPSO_A_MTYPE
Signed-off-by Huw Davies <[email protected]>
--- include/net/netlabel.h | 4 ++ net/ipv6/calipso.c | 68 +++++++++++++++++++++++++++ net/netlabel/netlabel_calipso.c | 102 ++++++++++++++++++++++++++++++++++++++++ net/netlabel/netlabel_calipso.h | 19 ++++++++ 4 files changed, 193 insertions(+)
include/net/netlabel.h +4 -0
@@ -223,6 +223,8 @@ struct netlbl_lsm_secattr {* struct netlbl_calipso_ops - NetLabel CALIPSO operations * @doi_add: add a CALIPSO DOI * @doi_free: free a CALIPSO DOI +* @doi_getdef: returns a reference to a DOI +* @doi_putdef: releases a reference of a DOI * * Description: * This structure is filled out by the CALIPSO engine and passed
@@ -234,6 +236,8 @@ struct netlbl_calipso_ops {int (*doi_add)(struct calipso_doi *doi_def,struct netlbl_audit *audit_info);void (*doi_free)(struct calipso_doi *doi_def); +struct calipso_doi *(*doi_getdef)(u32 doi); +void (*doi_putdef)(struct calipso_doi *doi_def); };/*
net/ipv6/calipso.c +68 -0
77 lines not on this page · raw message
net/netlabel/netlabel_calipso.c +102 -0
117 lines not on this page · raw message
net/netlabel/netlabel_calipso.h +19 -0
@@ -46,6 +46,23 @@* * If using CALIPSO_MAP_PASS no additional attributes are required. * +* o LIST: +* Sent by an application to list the details of a DOI definition. On +* success the kernel should send a response using the following format. +* +* Required attributes: +* +* NLBL_CALIPSO_A_DOI +* +* The valid response message format depends on the type of the DOI mapping, +* the defined formats are shown below. +* +* Required attributes: +* +* NLBL_CALIPSO_A_MTYPE +* +* If using CALIPSO_MAP_PASS no additional attributes are required. +* */ /* NetLabel CALIPSO commands */
@@ -86,5 +103,7 @@ static inline int netlbl_calipso_genl_init(void)int calipso_doi_add (struct calipso_doi *doi_def,struct netlbl_audit *audit_info);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);#endif
Signature · 1 line
2.7.0