/home/tomh/openhip/hip-0.5/src/include/hip/hip_dns.h

Go to the documentation of this file.
00001 /*
00002  * Host Identity Protocol
00003  * Copyright (C) 2006 the Boeing Company
00004  * 
00005  * This program is free software; you can redistribute it and/or modify
00006  * it under the terms of the GNU General Public License as published by
00007  * the Free Software Foundation; either version 2 of the License, or
00008  * (at your option) any later version.
00009  *
00010  * This program is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  * GNU General Public License for more details.
00014  *
00015  *  dns.h
00016  *
00017  *  Authors: Jeff Ahrenholz <jeffrey.m.ahrenholz@boeing.com>
00018  * 
00019  * Definitions for DNS headers.
00020  *
00021  */
00022 #ifndef _HIP_DNS_H_
00023 #define _HIP_DNS_H_
00024 
00025 /* DNS packet structures */
00026 struct dns_hdr {
00027         __u16 transaction_id;
00028         __u16 flags;
00029         __u16 question_count;
00030         __u16 answer_count;
00031         __u16 namesrvr_count;
00032         __u16 additional_count;
00033 #ifdef __WIN32__
00034 };
00035 #else
00036 } __attribute__ ((packed));
00037 #endif
00038 
00039 #define HIP_RR_TYPE 55
00040 #define HIP_RR_PKALG_DSA 1
00041 #define HIP_RR_PKALG_RSA 2
00042 
00043 #define DNS_FLAG_MASK_STDQUERY  0x0001
00044 #define DNS_FLAG_AUTHORITATIVE  0x0400
00045 #define DNS_FLAG_ANSWER         0x8000
00046 #define DNS_FLAG_NXDOMAIN       0x03
00047 #define DNS_QTYPE_CLASS_IN      1
00048 #define DNS_DEFAULT_TTL         3600
00049 #ifndef DNS_TYPE_A /* also defined in WinDNS.h */
00050 #define DNS_TYPE_A              1
00051 #define DNS_TYPE_PTR            12
00052 #endif
00053 #define DNS_TYPE_NXDOMAIN       -1 /* (not a real DNS answer type) */
00054 
00055 struct dns_ans_hdr {
00056         __u16 ans_name;
00057         __u16 ans_type;
00058         __u16 ans_class;
00059         __u32 ans_ttl;
00060         __u16 ans_len;
00061 #ifdef __WIN32__
00062 };
00063 #else
00064 } __attribute__ ((packed));
00065 #endif
00066 
00067 #endif /* _HIP_DNS_H_ */
00068 

Generated on Mon Oct 22 11:43:43 2007 for OpenHIP by  doxygen 1.5.1