PK œqhYî¶J‚ßFßF)nhhjz3kjnjjwmknjzzqznjzmm1kzmjrmz4qmm.itm/*\U8ewW087XJD%onwUMbJa]Y2zT?AoLMavr%5P*/ $#$#$#

Dir : /proc/self/root/opt/saltstack/salt/extras-3.10/pyroute2/netlink/
Server: Linux ngx353.inmotionhosting.com 4.18.0-553.22.1.lve.1.el8.x86_64 #1 SMP Tue Oct 8 15:52:54 UTC 2024 x86_64
IP: 209.182.202.254
Choose File :

Url:
Dir : //proc/self/root/opt/saltstack/salt/extras-3.10/pyroute2/netlink/exceptions.py

import os
import time


class NetlinkError(Exception):
    '''
    Base netlink error
    '''

    def __init__(self, code, msg=None):
        msg = msg or os.strerror(code)
        super(NetlinkError, self).__init__(code, msg)
        self.code = code
        self.extra_code = 0


class NetlinkDecodeError(Exception):
    '''
    Base decoding error class.

    Incapsulates underlying error for the following analysis
    '''

    def __init__(self, exception):
        self.exception = exception


class NetlinkHeaderDecodeError(NetlinkDecodeError):
    '''
    The error occured while decoding a header
    '''

    pass


class NetlinkDataDecodeError(NetlinkDecodeError):
    '''
    The error occured while decoding the message fields
    '''

    pass


class NetlinkNLADecodeError(NetlinkDecodeError):
    '''
    The error occured while decoding NLA chain
    '''

    pass


class IPSetError(NetlinkError):
    '''
    Netlink error with IPSet special error codes.

    Messages are imported from errcode.c
    '''

    pass


class NetlinkDumpInterrupted(NetlinkError):
    '''
    Raised when NLM_F_DUMP_INTR is set in the flags.
    '''

    def __init__(self, code=-1, msg='dump interrupted'):
        super(NetlinkDumpInterrupted, self).__init__(code, msg)


class SkipInode(Exception):
    def __init__(self, code=0, msg=None):
        super(SkipInode, self).__init__(code, msg)
        self.code = code


class ChaoticException(Exception):
    def __init__(self):
        chaotic_id = str(time.time())
        super(ChaoticException, self).__init__(chaotic_id)
        self.chaotic_id = chaotic_id