Changeset adae30d in mainline
- Timestamp:
- 2012-08-12T16:27:30Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- f85ed4b
- Parents:
- d23d911
- Location:
- uspace/srv/net/dnsres
- Files:
-
- 6 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/net/dnsres/Makefile
rd23d911 radae30d 31 31 32 32 SOURCES = \ 33 dnsres.c 33 dns_msg.c \ 34 dnsres.c \ 35 query.c \ 36 transport.c 34 37 35 38 include $(USPACE_PREFIX)/Makefile.common -
uspace/srv/net/dnsres/dns_msg.h
rd23d911 radae30d 41 41 #include <stdint.h> 42 42 #include "dns_std.h" 43 #include "dns_type.h" 43 44 44 /** Unencoded DNS message */ 45 typedef struct { 46 /** Identifier */ 47 uint16_t id; 48 /** Query or Response */ 49 dns_query_response_t qr; 50 /** Opcode */ 51 dns_opcode_t opcode; 52 /** Authoritative Answer */ 53 bool aa; 54 /** TrunCation */ 55 bool tc; 56 /** Recursion Desired */ 57 bool rd; 58 /** Recursion Available */ 59 bool ra; 60 /** Response Code */ 61 dns_rcode_t rcode; 62 63 list_t question; /* of dns_question_t */ 64 list_t answer; /* of dns_rr_t */ 65 list_t authority; /* of dns_rr_t */ 66 list_t additional; /* of dns_rr_t */ 67 } dns_message_t; 68 69 /** Unencoded DNS message question section */ 70 typedef struct { 71 /** Domain name in text format (dot notation) */ 72 char *qname; 73 /** Query type */ 74 dns_qtype_t qtype; 75 /** Query class */ 76 dns_qclass_t qclass; 77 } dns_question_t; 78 79 /** Unencoded DNS resource record */ 80 typedef struct { 81 /** Domain name */ 82 char *name; 83 /** RR type */ 84 dns_type_t rtype; 85 /** Class of data */ 86 dns_class_t rclass; 87 /** Time to live */ 88 uint32_t ttl; 89 90 /** Resource data */ 91 void *rdata; 92 /** Number of bytes in @c *rdata */ 93 size_t rdata_size; 94 } dns_rr_t; 45 extern int dns_message_encode(dns_message_t *, void **, size_t *); 95 46 96 47 #endif -
uspace/srv/net/dnsres/dns_std.h
rd23d911 radae30d 85 85 86 86 typedef struct { 87 /** Identifier assigned by the query originator */ 87 88 uint16_t id; 89 /** QR, Opcode, AA, TC,RD, RA, Z, Rcode */ 88 90 uint16_t opbits; 91 /** Number of entries in query section */ 89 92 uint16_t qd_count; 93 /** Number of RRs in the answer section */ 90 94 uint16_t an_count; 95 /** Number of name server RRs in the authority records section */ 91 96 uint16_t ns_count; 97 /** Number of RRs in the additional records section */ 92 98 uint16_t ar_count; 93 99 } dns_header_t; … … 100 106 enum dns_opbits { 101 107 OPB_QR = 15, 102 QPB_OPCODE_h = 14,103 QPB_OPCODE_l = 11,104 QPB_AA = 10,105 QPB_TC = 9,106 QPB_RD = 8,107 QPB_RA = 7,108 QPB_Z_h = 6,109 QPB_Z_l = 4,110 QPB_RCODE_h = 3,111 QPB_RCODE_l = 0108 OPB_OPCODE_h = 14, 109 OPB_OPCODE_l = 11, 110 OPB_AA = 10, 111 OPB_TC = 9, 112 OPB_RD = 8, 113 OPB_RA = 7, 114 OPB_Z_h = 6, 115 OPB_Z_l = 4, 116 OPB_RCODE_h = 3, 117 OPB_RCODE_l = 0 112 118 }; 113 119 -
uspace/srv/net/dnsres/dnsres.c
rd23d911 radae30d 27 27 */ 28 28 29 /** @addtogroup dnsres 30 * @{ 31 */ 32 /** 33 * @file 34 */ 35 29 36 #include <stdio.h> 30 37 #include <errno.h> … … 40 47 return 0; 41 48 } 49 50 /** @} 51 */
Note:
See TracChangeset
for help on using the changeset viewer.