notifly/server.py
def unpack_from_wire(self, data):
        """
        Parse binary payload from wire
        return a request object with meaningful aspects from DNS packet
        """
        payload = dns.message.from_wire(data)
        request = collections.namedtuple(
            'Request', [
                'request',
                'query_id',
                'rdtype',
                'origin',
                'opcode_int',
                'opcode_text'
            ]
        )
        try:
            return request(
                request=payload,
                query_id=payload.id,
                rdtype=payload.question[0].rdtype,
                origin=payload.question[0].name.to_text(),
                opcode_int=dns.opcode.from_flags(payload.flags),
                opcode_text=dns.opcode.to_text(
                    dns.opcode.from_flags(payload.flags)
                )
            )
        except KeyError:
            logging.error("dropping invalid packet")
            return None
        logging.error("dropping packet with unknown issue")
        return None

        Parse binary payload from wire
        return a request object with meaningful aspects from DNS packet
        
Parse binary payload from wire
return a request object with meaningful aspects from DNS packet
Parse binary payload from wire return a request object with meaningful aspects from DNS packet
def unpack_from_wire(self, data):
        payload = dns.message.from_wire(data)
        request = collections.namedtuple(
            'Request', [
                'request',
                'query_id',
                'rdtype',
                'origin',
                'opcode_int',
                'opcode_text'
            ]
        )
        try:
            return request(
                request=payload,
                query_id=payload.id,
                rdtype=payload.question[0].rdtype,
                origin=payload.question[0].name.to_text(),
                opcode_int=dns.opcode.from_flags(payload.flags),
                opcode_text=dns.opcode.to_text(
                    dns.opcode.from_flags(payload.flags)
                )
            )
        except KeyError:
            logging.error("dropping invalid packet")
            return None
        logging.error("dropping packet with unknown issue")
        return None
def unpack_from_wire ( self , data ) : payload = dns . message . from_wire ( data ) request = collections . namedtuple ( 'Request' , [ 'request' , 'query_id' , 'rdtype' , 'origin' , 'opcode_int' , 'opcode_text' ] ) try : return request ( request = payload , query_id = payload . id , rdtype = payload . question [ 0 ] . rdtype , origin = payload . question [ 0 ] . name . to_text ( ) , opcode_int = dns . opcode . from_flags ( payload . flags ) , opcode_text = dns . opcode . to_text ( dns . opcode . from_flags ( payload . flags ) ) ) except KeyError : logging . error ( "dropping invalid packet" ) return None logging . error ( "dropping packet with unknown issue" ) return None
Parse binary payload from wire
return a request object with meaningful aspects from DNS packet
Parse binary payload from wire return a request object with meaningful aspects from DNS packet
"""
        Parse binary payload from wire
        return a request object with meaningful aspects from DNS packet
        """
self
data