#!/usr/bin/env python
# -*- coding: utf-8 -*-

import struct


MAGIC_NUMBER = 4277009102
NATIVE_HEADER_VERSION = 4
HEADER_FORMAT = '<IiIIIIiiIIIii80s'
HEADER_SIZE = struct.calcsize(HEADER_FORMAT)
CLOSE = 1
ABORT = 2
CMD = 3
CMD_WITH_RETURN = 4
REGISTER = 6
UNREGISTER = 7
EVENT = 8
FUNC = 9
FUNC_WITH_RETURN = 10
CHAN_READ = 11
CHAN_SEND = 12
REPLY = 13
HELLO = 14
HELLO_REPLY = 15
TYPE_DOUBLE = 1
TYPE_STRING = 2
TYPE_ERROR = 3
TYPE_ASSOC = 4
MAX_CHUNK_SIZE = 65536
SPEC_MIN_PORT = 6510
SPEC_MAX_PORT = 6530
