Пример #1
0
int dns_packet_check_valid_response(struct dns_packet *p) {
    uint16_t flags;
    assert(p);
    
    if (dns_packet_check_valid(p) < 0)
        return -1;

    flags = dns_packet_get_field(p, DNS_FIELD_FLAGS);

    if (!(flags & DNS_FLAG_QR))
        return -1;

    return 0;
}
Пример #2
0
Файл: dns.c Проект: acml/cvsnt
int dns_packet_check_valid_request(struct dns_packet *p)
{
    uint16_t flags;
    assert(p);
    
    if (dns_packet_check_valid(p) < 0)
	{
        return -1;
	}

    flags = dns_packet_get_field(p, DNS_FIELD_FLAGS);

    if (flags & DNS_FLAG_QR)
	{
        return -1;
	}

    return 0;
}