Lines Matching refs:subnet_prefix
1338 def __genkey(self, pkey, subnet_prefix): argument
1339 if subnet_prefix == "":
1352 (rc, k) = semanage_ibpkey_key_create(self.sh, subnet_prefix, low, high)
1354 raise ValueError(_("Could not create a key for %s/%s") % (subnet_prefix, pkey))
1355 return (k, subnet_prefix, low, high)
1357 def __add(self, pkey, subnet_prefix, serange, type): argument
1372 (k, subnet_prefix, low, high) = self.__genkey(pkey, subnet_prefix)
1376 … raise ValueError(_("Could not check if ibpkey %s/%s is defined") % (subnet_prefix, pkey))
1378 raise ValueError(_("ibpkey %s/%s already defined") % (subnet_prefix, pkey))
1382 raise ValueError(_("Could not create ibpkey for %s/%s") % (subnet_prefix, pkey))
1384 semanage_ibpkey_set_subnet_prefix(self.sh, p, subnet_prefix)
1388 raise ValueError(_("Could not create context for %s/%s") % (subnet_prefix, pkey))
1392 … raise ValueError(_("Could not set user in ibpkey context for %s/%s") % (subnet_prefix, pkey))
1396 … raise ValueError(_("Could not set role in ibpkey context for %s/%s") % (subnet_prefix, pkey))
1400 … raise ValueError(_("Could not set type in ibpkey context for %s/%s") % (subnet_prefix, pkey))
1405 …raise ValueError(_("Could not set mls fields in ibpkey context for %s/%s") % (subnet_prefix, pkey))
1409 raise ValueError(_("Could not set ibpkey context for %s/%s") % (subnet_prefix, pkey))
1413 raise ValueError(_("Could not add ibpkey %s/%s") % (subnet_prefix, pkey))
1419 def add(self, pkey, subnet_prefix, serange, type): argument
1421 self.__add(pkey, subnet_prefix, serange, type)
1424 def __modify(self, pkey, subnet_prefix, serange, setype): argument
1436 (k, subnet_prefix, low, high) = self.__genkey(pkey, subnet_prefix)
1440 … raise ValueError(_("Could not check if ibpkey %s/%s is defined") % (subnet_prefix, pkey))
1442 raise ValueError(_("ibpkey %s/%s is not defined") % (subnet_prefix, pkey))
1446 raise ValueError(_("Could not query ibpkey %s/%s") % (subnet_prefix, pkey))
1457 raise ValueError(_("Could not modify ibpkey %s/%s") % (subnet_prefix, pkey))
1462 def modify(self, pkey, subnet_prefix, serange, setype): argument
1464 self.__modify(pkey, subnet_prefix, serange, setype)
1475 (rc, subnet_prefix) = semanage_ibpkey_get_subnet_prefix(self.sh, ibpkey)
1479 (k, subnet_prefix, low, high) = self.__genkey(pkey_str, subnet_prefix)
1490 def __delete(self, pkey, subnet_prefix): argument
1491 (k, subnet_prefix, low, high) = self.__genkey(pkey, subnet_prefix)
1494 … raise ValueError(_("Could not check if ibpkey %s/%s is defined") % (subnet_prefix, pkey))
1496 raise ValueError(_("ibpkey %s/%s is not defined") % (subnet_prefix, pkey))
1500 … raise ValueError(_("Could not check if ibpkey %s/%s is defined") % (subnet_prefix, pkey))
1502 …raise ValueError(_("ibpkey %s/%s is defined in policy, cannot be deleted") % (subnet_prefix, pkey))
1506 raise ValueError(_("Could not delete ibpkey %s/%s") % (subnet_prefix, pkey))
1510 def delete(self, pkey, subnet_prefix): argument
1512 self.__delete(pkey, subnet_prefix)
1530 (rc, subnet_prefix) = semanage_ibpkey_get_subnet_prefix(self.sh, ibpkey)
1533 ddict[(low, high, subnet_prefix)] = (ctype, level)
1548 (rc, subnet_prefix) = semanage_ibpkey_get_subnet_prefix(self.sh, ibpkey)
1551 if (ctype, subnet_prefix) not in ddict.keys():
1552 ddict[(ctype, subnet_prefix)] = []
1554 ddict[(ctype, subnet_prefix)].append("0x%x" % low)
1556 ddict[(ctype, subnet_prefix)].append("0x%x-0x%x" % (low, high))