# This file was automatically generated by SWIG (https://www.swig.org).
# Version 4.4.1
#
# Do not make changes to this file unless you know what you are doing - modify
# the SWIG interface file instead.

from sys import version_info as _swig_python_version_info
# Import the low-level C/C++ module
if getattr(globals().get("__spec__"), "parent", None) or __package__ or "." in __name__:
    from . import _LibAppArmor
else:
    import _LibAppArmor

try:
    import builtins as __builtin__
except ImportError:
    import __builtin__

def _swig_repr(self):
    try:
        strthis = "proxy of " + self.this.__repr__()
    except __builtin__.Exception:
        strthis = ""
    return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)


def _swig_setattr_nondynamic_instance_variable(set):
    def set_instance_attr(self, name, value):
        if name == "this":
            set(self, name, value)
        elif name == "thisown":
            self.this.own(value)
        elif hasattr(self, name) and isinstance(getattr(type(self), name), property):
            set(self, name, value)
        else:
            raise AttributeError("You cannot add instance attributes to %s" % self)
    return set_instance_attr


def _swig_setattr_nondynamic_class_variable(set):
    def set_class_attr(cls, name, value):
        if hasattr(cls, name) and not isinstance(getattr(cls, name), property):
            set(cls, name, value)
        else:
            raise AttributeError("You cannot add class attributes to %s" % cls)
    return set_class_attr


def _swig_add_metaclass(metaclass):
    """Class decorator for adding a metaclass to a SWIG wrapped class - a slimmed down version of six.add_metaclass"""
    def wrapper(cls):
        return metaclass(cls.__name__, cls.__bases__, cls.__dict__.copy())
    return wrapper


class _SwigNonDynamicMeta(type):
    """Meta class to enforce nondynamic attributes (no new attributes) for a class"""
    __setattr__ = _swig_setattr_nondynamic_class_variable(type.__setattr__)



def free_record(record):
    r"""This function used to free aa_log_record objects. Freeing is now handled automatically, so this no-op function remains for backwards compatibility."""

    import warnings
    warnings.warn("free_record is now a no-op as the record's memory is handled automatically", DeprecationWarning)


    return _LibAppArmor.free_record(record)
AA_RECORD_EXEC_MMAP = _LibAppArmor.AA_RECORD_EXEC_MMAP
AA_RECORD_READ = _LibAppArmor.AA_RECORD_READ
AA_RECORD_WRITE = _LibAppArmor.AA_RECORD_WRITE
AA_RECORD_EXEC = _LibAppArmor.AA_RECORD_EXEC
AA_RECORD_LINK = _LibAppArmor.AA_RECORD_LINK
AA_RECORD_SYNTAX_V1 = _LibAppArmor.AA_RECORD_SYNTAX_V1
AA_RECORD_SYNTAX_V2 = _LibAppArmor.AA_RECORD_SYNTAX_V2
AA_RECORD_SYNTAX_UNKNOWN = _LibAppArmor.AA_RECORD_SYNTAX_UNKNOWN
AA_RECORD_INVALID = _LibAppArmor.AA_RECORD_INVALID
AA_RECORD_ERROR = _LibAppArmor.AA_RECORD_ERROR
AA_RECORD_AUDIT = _LibAppArmor.AA_RECORD_AUDIT
AA_RECORD_ALLOWED = _LibAppArmor.AA_RECORD_ALLOWED
AA_RECORD_DENIED = _LibAppArmor.AA_RECORD_DENIED
AA_RECORD_HINT = _LibAppArmor.AA_RECORD_HINT
AA_RECORD_STATUS = _LibAppArmor.AA_RECORD_STATUS
class aa_log_record(object):
    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
    __repr__ = _swig_repr
    version = property(_LibAppArmor.aa_log_record_version_get, _LibAppArmor.aa_log_record_version_set)
    event = property(_LibAppArmor.aa_log_record_event_get, _LibAppArmor.aa_log_record_event_set)
    pid = property(_LibAppArmor.aa_log_record_pid_get, _LibAppArmor.aa_log_record_pid_set)
    peer_pid = property(_LibAppArmor.aa_log_record_peer_pid_get, _LibAppArmor.aa_log_record_peer_pid_set)
    task = property(_LibAppArmor.aa_log_record_task_get, _LibAppArmor.aa_log_record_task_set)
    magic_token = property(_LibAppArmor.aa_log_record_magic_token_get, _LibAppArmor.aa_log_record_magic_token_set)
    epoch = property(_LibAppArmor.aa_log_record_epoch_get, _LibAppArmor.aa_log_record_epoch_set)
    audit_sub_id = property(_LibAppArmor.aa_log_record_audit_sub_id_get, _LibAppArmor.aa_log_record_audit_sub_id_set)
    bitmask = property(_LibAppArmor.aa_log_record_bitmask_get, _LibAppArmor.aa_log_record_bitmask_set)
    audit_id = property(_LibAppArmor.aa_log_record_audit_id_get, _LibAppArmor.aa_log_record_audit_id_set)
    operation = property(_LibAppArmor.aa_log_record_operation_get, _LibAppArmor.aa_log_record_operation_set)
    denied_mask = property(_LibAppArmor.aa_log_record_denied_mask_get, _LibAppArmor.aa_log_record_denied_mask_set)
    requested_mask = property(_LibAppArmor.aa_log_record_requested_mask_get, _LibAppArmor.aa_log_record_requested_mask_set)
    fsuid = property(_LibAppArmor.aa_log_record_fsuid_get, _LibAppArmor.aa_log_record_fsuid_set)
    ouid = property(_LibAppArmor.aa_log_record_ouid_get, _LibAppArmor.aa_log_record_ouid_set)
    profile = property(_LibAppArmor.aa_log_record_profile_get, _LibAppArmor.aa_log_record_profile_set)
    peer_profile = property(_LibAppArmor.aa_log_record_peer_profile_get, _LibAppArmor.aa_log_record_peer_profile_set)
    comm = property(_LibAppArmor.aa_log_record_comm_get, _LibAppArmor.aa_log_record_comm_set)
    name = property(_LibAppArmor.aa_log_record_name_get, _LibAppArmor.aa_log_record_name_set)
    name2 = property(_LibAppArmor.aa_log_record_name2_get, _LibAppArmor.aa_log_record_name2_set)
    namespace = property(_LibAppArmor.aa_log_record_namespace_get, _LibAppArmor.aa_log_record_namespace_set)
    attribute = property(_LibAppArmor.aa_log_record_attribute_get, _LibAppArmor.aa_log_record_attribute_set)
    parent = property(_LibAppArmor.aa_log_record_parent_get, _LibAppArmor.aa_log_record_parent_set)
    info = property(_LibAppArmor.aa_log_record_info_get, _LibAppArmor.aa_log_record_info_set)
    peer_info = property(_LibAppArmor.aa_log_record_peer_info_get, _LibAppArmor.aa_log_record_peer_info_set)
    error_code = property(_LibAppArmor.aa_log_record_error_code_get, _LibAppArmor.aa_log_record_error_code_set)
    active_hat = property(_LibAppArmor.aa_log_record_active_hat_get, _LibAppArmor.aa_log_record_active_hat_set)
    net_family = property(_LibAppArmor.aa_log_record_net_family_get, _LibAppArmor.aa_log_record_net_family_set)
    net_protocol = property(_LibAppArmor.aa_log_record_net_protocol_get, _LibAppArmor.aa_log_record_net_protocol_set)
    net_sock_type = property(_LibAppArmor.aa_log_record_net_sock_type_get, _LibAppArmor.aa_log_record_net_sock_type_set)
    net_local_addr = property(_LibAppArmor.aa_log_record_net_local_addr_get, _LibAppArmor.aa_log_record_net_local_addr_set)
    net_local_port = property(_LibAppArmor.aa_log_record_net_local_port_get, _LibAppArmor.aa_log_record_net_local_port_set)
    net_foreign_addr = property(_LibAppArmor.aa_log_record_net_foreign_addr_get, _LibAppArmor.aa_log_record_net_foreign_addr_set)
    net_foreign_port = property(_LibAppArmor.aa_log_record_net_foreign_port_get, _LibAppArmor.aa_log_record_net_foreign_port_set)
    dbus_bus = property(_LibAppArmor.aa_log_record_dbus_bus_get, _LibAppArmor.aa_log_record_dbus_bus_set)
    dbus_path = property(_LibAppArmor.aa_log_record_dbus_path_get, _LibAppArmor.aa_log_record_dbus_path_set)
    dbus_interface = property(_LibAppArmor.aa_log_record_dbus_interface_get, _LibAppArmor.aa_log_record_dbus_interface_set)
    dbus_member = property(_LibAppArmor.aa_log_record_dbus_member_get, _LibAppArmor.aa_log_record_dbus_member_set)
    signal = property(_LibAppArmor.aa_log_record_signal_get, _LibAppArmor.aa_log_record_signal_set)
    peer = property(_LibAppArmor.aa_log_record_peer_get, _LibAppArmor.aa_log_record_peer_set)
    fs_type = property(_LibAppArmor.aa_log_record_fs_type_get, _LibAppArmor.aa_log_record_fs_type_set)
    flags = property(_LibAppArmor.aa_log_record_flags_get, _LibAppArmor.aa_log_record_flags_set)
    src_name = property(_LibAppArmor.aa_log_record_src_name_get, _LibAppArmor.aa_log_record_src_name_set)
    _class = property(_LibAppArmor.aa_log_record__class_get, _LibAppArmor.aa_log_record__class_set)
    net_addr = property(_LibAppArmor.aa_log_record_net_addr_get, _LibAppArmor.aa_log_record_net_addr_set)
    peer_addr = property(_LibAppArmor.aa_log_record_peer_addr_get, _LibAppArmor.aa_log_record_peer_addr_set)
    execpath = property(_LibAppArmor.aa_log_record_execpath_get, _LibAppArmor.aa_log_record_execpath_set)
    __swig_destroy__ = _LibAppArmor.delete_aa_log_record

    def __init__(self):
        _LibAppArmor.aa_log_record_swiginit(self, _LibAppArmor.new_aa_log_record())

# Register aa_log_record in _LibAppArmor:
_LibAppArmor.aa_log_record_swigregister(aa_log_record)

def parse_record(str):
    return _LibAppArmor.parse_record(str)

def aa_get_lsm_iface_name(op):
    return _LibAppArmor.aa_get_lsm_iface_name(op)

def aa_splitcon(con):
    return _LibAppArmor.aa_splitcon(con)

def aa_is_enabled():
    return _LibAppArmor.aa_is_enabled()

def aa_change_hat(subprofile, magic_token):
    return _LibAppArmor.aa_change_hat(subprofile, magic_token)

def aa_change_profile(profile):
    return _LibAppArmor.aa_change_profile(profile)

def aa_change_onexec(profile):
    return _LibAppArmor.aa_change_onexec(profile)

def aa_change_hatv(subprofiles, token):
    return _LibAppArmor.aa_change_hatv(subprofiles, token)

def aa_stack_profile(profile):
    return _LibAppArmor.aa_stack_profile(profile)

def aa_stack_onexec(profile):
    return _LibAppArmor.aa_stack_onexec(profile)

def aa_find_mountpoint():
    return _LibAppArmor.aa_find_mountpoint()

def aa_getprocattr(tid, attr):
    return _LibAppArmor.aa_getprocattr(tid, attr)

def aa_get_self_attr(op_type):
    return _LibAppArmor.aa_get_self_attr(op_type)

def aa_set_self_attr(op_type, buf, len):
    return _LibAppArmor.aa_set_self_attr(op_type, buf, len)

def aa_gettaskcon(target):
    return _LibAppArmor.aa_gettaskcon(target)

def aa_getcon():
    return _LibAppArmor.aa_getcon()

def aa_getpeercon(fd):
    return _LibAppArmor.aa_getpeercon(fd)
AA_MAY_EXEC = _LibAppArmor.AA_MAY_EXEC
AA_MAY_WRITE = _LibAppArmor.AA_MAY_WRITE
AA_MAY_READ = _LibAppArmor.AA_MAY_READ
AA_MAY_APPEND = _LibAppArmor.AA_MAY_APPEND
AA_MAY_CREATE = _LibAppArmor.AA_MAY_CREATE
AA_MAY_DELETE = _LibAppArmor.AA_MAY_DELETE
AA_MAY_OPEN = _LibAppArmor.AA_MAY_OPEN
AA_MAY_RENAME = _LibAppArmor.AA_MAY_RENAME
AA_MAY_SETATTR = _LibAppArmor.AA_MAY_SETATTR
AA_MAY_GETATTR = _LibAppArmor.AA_MAY_GETATTR
AA_MAY_SETCRED = _LibAppArmor.AA_MAY_SETCRED
AA_MAY_GETCRED = _LibAppArmor.AA_MAY_GETCRED
AA_MAY_CHMOD = _LibAppArmor.AA_MAY_CHMOD
AA_MAY_CHOWN = _LibAppArmor.AA_MAY_CHOWN
AA_MAY_LOCK = _LibAppArmor.AA_MAY_LOCK
AA_EXEC_MMAP = _LibAppArmor.AA_EXEC_MMAP
AA_MAY_LINK = _LibAppArmor.AA_MAY_LINK
AA_MAY_ONEXEC = _LibAppArmor.AA_MAY_ONEXEC
AA_MAY_CHANGE_PROFILE = _LibAppArmor.AA_MAY_CHANGE_PROFILE

def aa_query_file_path(mask, label, path):
    return _LibAppArmor.aa_query_file_path(mask, label, path)

def aa_query_link_path(label, target, link):
    return _LibAppArmor.aa_query_link_path(label, target, link)

