Module Expr Str ImportFrom alias alias Import alias ImportFrom alias alias ImportFrom alias ImportFrom alias Assign NameStore Str ClassDef bases NameLoad NameLoad body Expr Str Assign NameStore TupleLoad TupleLoad Str Str Str TupleLoad Str Str Str FunctionDef arguments args NameParam NameParam NameParam defaults Num body Expr Str Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr BinOpPow Num NameLoad Assign AttributeStore NameLoad attr BinOpPow Num BinOpSub NameLoad Num Assign AttributeStore NameLoad attr BinOpSub BinOpPow Num BinOpSub NameLoad Num Num Assign AttributeStore NameLoad attr BinOpMod Call NameLoad NameLoad AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str If UnaryOpNot Call NameLoad NameLoad NameLoad body Raise Call NameLoad BinOpMod Str TupleLoad NameLoad NameLoad If CompareNotEq AttributeLoad NameLoad attr AttributeLoad NameLoad attr body Raise Call NameLoad BinOpMod Str TupleLoad NameLoad NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Return Call NameLoad BinOpMod Str TupleLoad AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str Return AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad Return CompareEq AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Return UnaryOpNot Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad Return BoolOpOr BoolOpAnd CompareLt AttributeLoad NameLoad attr AttributeLoad NameLoad attr CompareLt BinOpSub AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr BoolOpAnd CompareGt AttributeLoad NameLoad attr AttributeLoad NameLoad attr CompareGt BinOpSub AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad Return BoolOpOr BoolOpAnd CompareLt AttributeLoad NameLoad attr AttributeLoad NameLoad attr CompareGt BinOpSub AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr BoolOpAnd CompareGt AttributeLoad NameLoad attr AttributeLoad NameLoad attr CompareLt BinOpSub AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad Return BoolOpOr CompareEq NameLoad NameLoad CompareLt NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad Return BoolOpOr CompareEq NameLoad NameLoad CompareGt NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad If CompareLtE AttributeLoad NameLoad attr AttributeLoad NameLoad attr body Return Call NameLoad BinOpMod BinOpAdd AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr orelse Raise Call NameLoad BinOpMod Str TupleLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str Return Call NameLoad AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Return Call NameLoad NameLoad keyword Num decorator_list NameLoad FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore BinOpAdd Call NameLoad Num Num Num Call NameLoad keyword AttributeLoad NameLoad attr Return Call NameLoad Call AttributeLoad NameLoad attr NameLoad decorator_list decorator_list Assign NameStore ListLoad Str
N/A N/A 
Utilities for handling RFC1982 Serial Number Arithmetic.

@see: U{http://tools.ietf.org/html/rfc1982}

@var RFC4034_TIME_FORMAT: RRSIG Time field presentation format. The Signature
   Expiration Time and Inception Time field values MUST be represented either
   as an unsigned decimal integer indicating seconds since 1 January 1970
   00:00:00 UTC, or in the form YYYYMMDDHHmmSS in UTC. See U{RRSIG Presentation
   Format<https://tools.ietf.org/html/rfc4034#section-3.2>}
 __future__ division absolute_import N/A calendar datetime datetime timedelta twisted.python.compat nativeString twisted.python.util FancyStrMixin N/A RFC4034_TIME_FORMAT %Y%m%d%H%M%S SerialNumber N/A FancyStrMixin object N/A N/A 
    An RFC1982 Serial Number.

    This class implements RFC1982 DNS Serial Number Arithmetic.

    SNA is used in DNS and specifically in DNSSEC as defined in RFC4034 in the
    DNSSEC Signature Expiration and Inception Fields.

    @see: U{https://tools.ietf.org/html/rfc1982}
    @see: U{https://tools.ietf.org/html/rfc4034}

    @ivar _serialBits: See C{serialBits} of L{__init__}.
    @ivar _number: See C{number} of L{__init__}.
    @ivar _modulo: The value at which wrapping will occur.
    @ivar _halfRing: Half C{_modulo}. If another L{SerialNumber} value is larger
        than this, it would lead to a wrapped value which is larger than the
        first and comparisons are therefore ambiguous.
    @ivar _maxAdd: Half C{_modulo} plus 1. If another L{SerialNumber} value is
        larger than this, it would lead to a wrapped value which is larger than
        the first. Comparisons with the original value would therefore be
        ambiguous.
     N/A showAttributes N/A N/A _number number %d N/A _serialBits serialBits %d __init__ N/A N/A self number serialBits N/A 32 N/A N/A 
        Construct an L{SerialNumber} instance.

        @param number: An L{int} which will be stored as the modulo
            C{number % 2 ^ serialBits}
        @type number: L{int}

        @param serialBits: The size of the serial number space. The power of two
            which results in one larger than the largest integer corresponding
            to a serial number value.
        @type serialBits: L{int}
         N/A N/A self _serialBits serialBits N/A N/A self _modulo N/A 2 serialBits N/A N/A self _halfRing N/A 2 N/A serialBits 1 N/A N/A self _maxAdd N/A N/A 2 N/A serialBits 1 1 N/A N/A self _number N/A N/A int number N/A self _modulo N/A _convertOther N/A N/A self other N/A N/A N/A 
        Check that a foreign object is suitable for use in the comparison or
        arithmetic magic methods of this L{SerialNumber} instance. Raise
        L{TypeError} if not.

        @param other: The foreign L{object} to be checked.
        @return: C{other} after compatibility checks and possible coercion.
        @raises: L{TypeError} if C{other} is not compatible.
         N/A N/A N/A isinstance other SerialNumber N/A N/A N/A TypeError N/A cannot compare or combine %r and %r N/A self other N/A N/A N/A self _serialBits N/A other _serialBits N/A N/A N/A TypeError N/A cannot compare or combine SerialNumber instances with different serialBits. %r and %r N/A self other N/A other N/A __str__ N/A N/A self N/A N/A N/A 
        Return a string representation of this L{SerialNumber} instance.

        @rtype: L{nativeString}
         N/A N/A nativeString N/A %d N/A N/A self _number N/A __int__ N/A N/A self N/A N/A N/A 
        @return: The integer value of this L{SerialNumber} instance.
        @rtype: L{int}
         N/A N/A self _number N/A __eq__ N/A N/A self other N/A N/A N/A 
        Allow rich equality comparison with another L{SerialNumber} instance.

        @type other: L{SerialNumber}
         N/A other N/A N/A self _convertOther other N/A N/A N/A other _number N/A self _number N/A __ne__ N/A N/A self other N/A N/A N/A 
        Allow rich equality comparison with another L{SerialNumber} instance.

        @type other: L{SerialNumber}
         N/A N/A N/A N/A self __eq__ other N/A __lt__ N/A N/A self other N/A N/A N/A 
        Allow I{less than} comparison with another L{SerialNumber} instance.

        @type other: L{SerialNumber}
         N/A other N/A N/A self _convertOther other N/A N/A N/A N/A N/A self _number N/A other _number N/A N/A N/A other _number N/A self _number N/A self _halfRing N/A N/A N/A self _number N/A other _number N/A N/A N/A self _number N/A other _number N/A self _halfRing N/A __gt__ N/A N/A self other N/A N/A N/A 
        Allow I{greater than} comparison with another L{SerialNumber} instance.

        @type other: L{SerialNumber}
        @rtype: L{bool}
         N/A other N/A N/A self _convertOther other N/A N/A N/A N/A N/A self _number N/A other _number N/A N/A N/A other _number N/A self _number N/A self _halfRing N/A N/A N/A self _number N/A other _number N/A N/A N/A self _number N/A other _number N/A self _halfRing N/A __le__ N/A N/A self other N/A N/A N/A 
        Allow I{less than or equal} comparison with another L{SerialNumber}
        instance.

        @type other: L{SerialNumber}
        @rtype: L{bool}
         N/A other N/A N/A self _convertOther other N/A N/A N/A self other N/A self other N/A __ge__ N/A N/A self other N/A N/A N/A 
        Allow I{greater than or equal} comparison with another L{SerialNumber}
        instance.

        @type other: L{SerialNumber}
        @rtype: L{bool}
         N/A other N/A N/A self _convertOther other N/A N/A N/A self other N/A self other N/A __add__ N/A N/A self other N/A N/A N/A 
        Allow I{addition} with another L{SerialNumber} instance.

        Serial numbers may be incremented by the addition of a positive
        integer n, where n is taken from the range of integers
        [0 .. (2^(SERIAL_BITS - 1) - 1)].  For a sequence number s, the
        result of such an addition, s', is defined as

        s' = (s + n) modulo (2 ^ SERIAL_BITS)

        where the addition and modulus operations here act upon values that are
        non-negative values of unbounded size in the usual ways of integer
        arithmetic.

        Addition of a value outside the range
        [0 .. (2^(SERIAL_BITS - 1) - 1)] is undefined.

        @see: U{http://tools.ietf.org/html/rfc1982#section-3.1}

        @type other: L{SerialNumber}
        @rtype: L{SerialNumber}
        @raises: L{ArithmeticError} if C{other} is more than C{_maxAdd}
            ie more than half the maximum value of this serial number.
         N/A other N/A N/A self _convertOther other N/A N/A N/A other _number N/A self _maxAdd N/A N/A N/A SerialNumber N/A N/A N/A self _number N/A other _number N/A self _modulo serialBits N/A self _serialBits N/A N/A N/A ArithmeticError N/A value %r outside the range 0 .. %r N/A N/A other _number N/A self _maxAdd N/A __hash__ N/A N/A self N/A N/A N/A 
        Allow L{SerialNumber} instances to be hashed for use as L{dict} keys.

        @rtype: L{int}
         N/A N/A hash N/A self _number N/A fromRFC4034DateString N/A N/A cls utcDateString N/A N/A N/A 
        Create an L{SerialNumber} instance from a date string in format
        'YYYYMMDDHHMMSS' described in U{RFC4034
        3.2<https://tools.ietf.org/html/rfc4034#section-3.2>}.

        The L{SerialNumber} instance stores the date as a 32bit UNIX timestamp.

        @see: U{https://tools.ietf.org/html/rfc4034#section-3.1.5}

        @param utcDateString: A UTC date/time string of format I{YYMMDDhhmmss}
            which will be converted to seconds since the UNIX epoch.
        @type utcDateString: L{unicode}

        @return: An L{SerialNumber} instance containing the supplied date as a
            32bit UNIX timestamp.
         N/A parsedDate N/A N/A datetime strptime utcDateString RFC4034_TIME_FORMAT N/A secondsSinceEpoch N/A N/A calendar timegm N/A N/A parsedDate utctimetuple N/A N/A cls secondsSinceEpoch serialBits 32 N/A classmethod toRFC4034DateString N/A N/A self N/A N/A N/A 
        Calculate a date by treating the current L{SerialNumber} value as a UNIX
        timestamp and return a date string in the format described in
        U{RFC4034 3.2<https://tools.ietf.org/html/rfc4034#section-3.2>}.

        @return: The date string.
         N/A d N/A N/A datetime 1970 1 1 N/A timedelta seconds N/A self _number N/A N/A nativeString N/A N/A d strftime RFC4034_TIME_FORMAT N/A N/A N/A __all__ N/A SerialNumber