Lines Matching full:ibpkey
12 /* Create a low level ibpkey structure from
17 ocontext_t **ibpkey, const sepol_ibpkey_t *data)
29 tmp_ibpkey->u.ibpkey.subnet_prefix = sepol_ibpkey_get_subnet_prefix_bytes(data);
32 tmp_ibpkey->u.ibpkey.low_pkey = low;
33 tmp_ibpkey->u.ibpkey.high_pkey = high;
34 if (tmp_ibpkey->u.ibpkey.low_pkey > tmp_ibpkey->u.ibpkey.high_pkey) {
35 ERR(handle, "low ibpkey %d exceeds high ibpkey %d",
36 tmp_ibpkey->u.ibpkey.low_pkey, tmp_ibpkey->u.ibpkey.high_pkey);
49 *ibpkey = tmp_ibpkey;
63 ERR(handle, "could not create ibpkey structure");
69 ocontext_t *ibpkey, sepol_ibpkey_t **record)
71 context_struct_t *con = &ibpkey->context[0];
79 ibpkey->u.ibpkey.subnet_prefix);
81 sepol_ibpkey_set_range(tmp_record, ibpkey->u.ibpkey.low_pkey,
82 ibpkey->u.ibpkey.high_pkey);
95 ERR(handle, "could not convert ibpkey to record");
118 /* Check if a ibpkey exists */
132 uint64_t subnet_prefix2 = c->u.ibpkey.subnet_prefix;
133 uint16_t low2 = c->u.ibpkey.low_pkey;
134 uint16_t high2 = c->u.ibpkey.high_pkey;
148 /* Query a ibpkey */
162 uint64_t subnet_prefix2 = c->u.ibpkey.subnet_prefix;
163 int low2 = c->u.ibpkey.low_pkey;
164 int high2 = c->u.ibpkey.high_pkey;
179 ERR(handle, "could not query ibpkey subnet prefix: %#lx range %u - %u exists",
184 /* Load a ibpkey into policy */
190 ocontext_t *ibpkey = NULL;
196 if (ibpkey_from_record(handle, policydb, &ibpkey, data) < 0)
200 ibpkey->next = policydb->ocontexts[OCON_IBPKEY];
201 policydb->ocontexts[OCON_IBPKEY] = ibpkey;
206 ERR(handle, "could not load ibpkey subnet prefix: %#lx range %u - %u exists",
208 if (ibpkey) {
209 context_destroy(&ibpkey->context[0]);
210 free(ibpkey);
217 int (*fn)(const sepol_ibpkey_t *ibpkey,
222 sepol_ibpkey_t *ibpkey = NULL;
228 if (ibpkey_to_record(handle, policydb, c, &ibpkey) < 0)
232 status = fn(ibpkey, arg);
236 sepol_ibpkey_free(ibpkey);
237 ibpkey = NULL;
248 sepol_ibpkey_free(ibpkey);