Changeset adae30d in mainline for uspace/srv/net/dnsres/dns_msg.h


Ignore:
Timestamp:
2012-08-12T16:27:30Z (12 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
f85ed4b
Parents:
d23d911
Message:

Work-in-progress message encoding/decoding, transport and query composition.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/net/dnsres/dns_msg.h

    rd23d911 radae30d  
    4141#include <stdint.h>
    4242#include "dns_std.h"
     43#include "dns_type.h"
    4344
    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;
     45extern int dns_message_encode(dns_message_t *, void **, size_t *);
    9546
    9647#endif
Note: See TracChangeset for help on using the changeset viewer.