OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [ecos-3.0/] [packages/] [net/] [ns/] [dns/] [current/] [include/] [dns_priv.h] - Blame information for rev 786

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 786 skrzyp
#ifndef CYGONCE_NS_DNS_DNS_PRIV_H
2
#define CYGONCE_NS_DNS_DNS_PRIV_H
3
//=============================================================================
4
//
5
//      dns-priv.h
6
//
7
//      Private DNS client definitions.
8
//
9
//=============================================================================
10
// ####ECOSGPLCOPYRIGHTBEGIN####                                            
11
// -------------------------------------------                              
12
// This file is part of eCos, the Embedded Configurable Operating System.   
13
// Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
14
//
15
// eCos is free software; you can redistribute it and/or modify it under    
16
// the terms of the GNU General Public License as published by the Free     
17
// Software Foundation; either version 2 or (at your option) any later      
18
// version.                                                                 
19
//
20
// eCos is distributed in the hope that it will be useful, but WITHOUT      
21
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or    
22
// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License    
23
// for more details.                                                        
24
//
25
// You should have received a copy of the GNU General Public License        
26
// along with eCos; if not, write to the Free Software Foundation, Inc.,    
27
// 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.            
28
//
29
// As a special exception, if other files instantiate templates or use      
30
// macros or inline functions from this file, or you compile this file      
31
// and link it with other works to produce a work based on this file,       
32
// this file does not by itself cause the resulting work to be covered by   
33
// the GNU General Public License. However the source code for this file    
34
// must still be made available in accordance with section (3) of the GNU   
35
// General Public License v2.                                               
36
//
37
// This exception does not invalidate any other reasons why a work based    
38
// on this file might be covered by the GNU General Public License.         
39
// -------------------------------------------                              
40
// ####ECOSGPLCOPYRIGHTEND####                                              
41
//=============================================================================
42
//#####DESCRIPTIONBEGIN####
43
//
44
// Author(s):   andrew.lunn
45
// Contributors:andrew.lunn, jskov
46
// Date:        2001-09-18
47
//
48
//####DESCRIPTIONEND####
49
//
50
//=============================================================================
51
 
52
struct dns_header {
53
#if (CYG_BYTEORDER == CYG_LSBFIRST)
54
  unsigned        id :16;         /* query identification number */
55
  /* fields in third byte */
56
  unsigned        rd :1;          /* recursion desired */
57
  unsigned        tc :1;          /* truncated message */
58
  unsigned        aa :1;          /* authoritive answer */
59
  unsigned        opcode :4;      /* purpose of message */
60
  unsigned        qr :1;          /* response flag */
61
  /* fields in fourth byte */
62
  unsigned        rcode :4;       /* response code */
63
  unsigned        cd: 1;          /* checking disabled by resolver */
64
  unsigned        ad: 1;          /* authentic data from named */
65
  unsigned        unused :1;      /* unused bits */
66
  unsigned        ra :1;          /* recursion available */
67
  /* remaining bytes */
68
  unsigned        qdcount :16;    /* number of question entries */
69
  unsigned        ancount :16;    /* number of answer entries */
70
  unsigned        nscount :16;    /* number of authority entries */
71
  unsigned        arcount :16;    /* number of resource entries */
72
#else
73
  unsigned        id :16;         /* query identification number */
74
  /* fields in third byte */
75
  unsigned        qr :1;          /* response flag */
76
  unsigned        opcode :4;      /* purpose of message */
77
  unsigned        aa :1;          /* authoritive answer */
78
  unsigned        tc :1;          /* truncated message */
79
  unsigned        rd :1;          /* recursion desired */
80
  /* fields in fourth byte */
81
  unsigned        ra :1;          /* recursion available */
82
  unsigned        unused :1;      /* unused bits */
83
  unsigned        ad: 1;          /* authentic data from named */
84
  unsigned        cd: 1;          /* checking disabled by resolver */
85
  unsigned        rcode :4;       /* response code */
86
  /* remaining bytes */
87
  unsigned        qdcount :16;    /* number of question entries */
88
  unsigned        ancount :16;    /* number of answer entries */
89
  unsigned        nscount :16;    /* number of authority entries */
90
  unsigned        arcount :16;    /* number of resource entries */
91
#endif
92
};
93
 
94
struct resource_record {
95
  unsigned rr_type : 16; /* Type of resourse */
96
  unsigned class   : 16; /* Class of resource */
97
  unsigned ttl     : 32; /* Time to live of this record */
98
  unsigned rdlength: 16; /* Lenght of data to follow */
99
  char     rdata [2];   /* Resource DATA */
100
};
101
 
102
/* Opcodes */
103
#define DNS_QUERY  0   /* Standard query */
104
#define DNS_IQUERY 1   /* Inverse query */
105
#define DNS_STATUS 2   /* Name server status */
106
#define DNS_NOTIFY 4   /* Zone change notification */
107
#define DNS_UPDATE 5   /* Zone update message */
108
 
109
/* DNS TYPEs */
110
#define DNS_TYPE_A     1   /* Host address */
111
#define DNS_TYPE_NS    2   /* Authoritative name server */
112
#define DNS_TYPE_CNAME 5   /* Canonical name for an alias */
113
#define DNS_TYPE_PTR   12  /* Domain name pointer */
114
#define DNS_TYPE_AAAA  28  /* IPv6 host address */
115
 
116
/* DNS CLASSs */
117
#define DNS_CLASS_IN   1   /* Internet */
118
 
119
/* DNS reply codes */
120
#define DNS_REPLY_NOERR      0
121
#define DNS_REPLY_NAME_ERROR 3
122
 
123
#define MAXDNSMSGSIZE 512
124
 
125
//-----------------------------------------------------------------------------
126
#endif // CYGONCE_NS_DNS_DNS_PRIV_H
127
// End of dns-priv.h

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.