From: Jelte Jansen Date: Tue, 14 Dec 2004 13:15:20 +0000 (+0000) Subject: field names X-Git-Tag: release-0.50~698 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9278385840949c488edffccc92134a4a608bcaf7;p=thirdparty%2Fldns.git field names --- diff --git a/packet.c b/packet.c index 1611900d..b7f72935 100644 --- a/packet.c +++ b/packet.c @@ -26,85 +26,85 @@ uint16_t packet_id(t_packet *packet) { - return packet->header->id; + return packet->_header->_id; } uint8_t packet_qr(t_packet *packet) { - return packet->header->qr; + return packet->_header->_qr; } uint8_t packet_aa(t_packet *packet) { - return packet->header->aa; + return packet->_header->_aa; } uint8_t packet_tc(t_packet *packet) { - return packet->header->tc; + return packet->_header->_tc; } uint8_t packet_rd(t_packet *packet) { - return packet->header->rd; + return packet->_header->_rd; } uint8_t packet_cd(t_packet *packet) { - return packet->header->cd; + return packet->_header->_cd; } uint8_t packet_ra(t_packet *packet) { - return packet->header->ra; + return packet->_header->_ra; } uint8_t packet_ad(t_packet *packet) { - return packet->header->ad; + return packet->_header->_ad; } uint8_t packet_opcode(t_packet *packet) { - return packet->header->opcode; + return packet->_header->_opcode; } uint8_t packet_rcode(t_packet *packet) { - return packet->header->rcode; + return packet->_header->_rcode; } uint16_t packet_qdcount(t_packet *packet) { - return packet->header->qdcount; + return packet->_header->_qdcount; } uint16_t packet_ancount(t_packet *packet) { - return packet->header->ancount; + return packet->_header->_ancount; } uint16_t packet_nscount(t_packet *packet) { - return packet->header->nscount; + return packet->_header->_nscount; } uint16_t packet_arcount(t_packet *packet) { - return packet->header->arcount; + return packet->_header->_arcount; } @@ -112,85 +112,85 @@ packet_arcount(t_packet *packet) void packet_set_id(t_packet *packet, uint16_t id) { - packet->header->id = id; + packet->_header->_id = id; } void packet_set_qr(t_packet *packet, uint8_t qr) { - packet->header->qr = qr; + packet->_header->_qr = qr; } void packet_set_aa(t_packet *packet, uint8_t aa) { - packet->header->aa = aa; + packet->_header->_aa = aa; } void packet_set_tc(t_packet *packet, uint8_t tc) { - packet->header->tc = tc; + packet->_header->_tc = tc; } void packet_set_rd(t_packet *packet, uint8_t rd) { - packet->header->rd = rd; + packet->_header->_rd = rd; } void packet_set_cd(t_packet *packet, uint8_t cd) { - packet->header->cd = cd; + packet->_header->_cd = cd; } void packet_set_ra(t_packet *packet, uint8_t ra) { - packet->header->ra = ra; + packet->_header->_ra = ra; } void packet_set_ad(t_packet *packet, uint8_t ad) { - packet->header->ad = ad; + packet->_header->_ad = ad; } void packet_set_opcode(t_packet *packet, uint8_t opcode) { - packet->header->opcode = opcode; + packet->_header->_opcode = opcode; } void packet_set_rcode(t_packet *packet, uint8_t rcode) { - packet->header->rcode = rcode; + packet->_header->_rcode = rcode; } void packet_set_qdcount(t_packet *packet, uint16_t qdcount) { - packet->header->qdcount = qdcount; + packet->_header->_qdcount = qdcount; } void packet_set_ancount(t_packet *packet, uint16_t ancount) { - packet->header->ancount = ancount; + packet->_header->_ancount = ancount; } void packet_set_nscount(t_packet *packet, uint16_t nscount) { - packet->header->nscount = nscount; + packet->_header->_nscount = nscount; } void packet_set_arcount(t_packet *packet, uint16_t arcount) { - packet->header->arcount = arcount; + packet->_header->_arcount = arcount; } @@ -206,15 +206,15 @@ dns_packet_new() return NULL; } - MALLOC(packet->header, t_header); - if (!packet->header) { + MALLOC(packet->_header, t_header); + if (!packet->_header) { return NULL; } - packet->question = NULL; - packet->answer = NULL; - packet->authority = NULL; - packet->additional = NULL; + packet->_question = NULL; + packet->_answer = NULL; + packet->_authority = NULL; + packet->_additional = NULL; return packet; } diff --git a/packet.h b/packet.h index 871236b4..bf5c5a9c 100644 --- a/packet.h +++ b/packet.h @@ -22,33 +22,33 @@ struct type_struct_header { /** \brief Id of a packet */ - uint16_t id; + uint16_t _id; /** \brief Query bit (0=query, 1=answer) */ - uint8_t qr:1; + uint8_t _qr:1; /** \brief Authoritative answer */ - uint8_t aa:1; + uint8_t _aa:1; /** \brief Packet truncated */ - uint8_t tc:1; + uint8_t _tc:1; /** \brief Recursion desired */ - uint8_t rd:1; + uint8_t _rd:1; /** \brief Checking disabled */ - uint8_t cd:1; + uint8_t _cd:1; /** \brief Recursion available */ - uint8_t ra:1; + uint8_t _ra:1; /** \brief Authentic data */ - uint8_t ad:1; + uint8_t _ad:1; /** \brief Query type */ - uint8_t opcode; /* XXX 8 bits? */ + uint8_t _opcode; /* XXX 8 bits? */ /** \brief Response code */ - uint8_t rcode; + uint8_t _rcode; /** \brief question sec */ - uint16_t qdcount; + uint16_t _qdcount; /** \brief answer sec */ - uint16_t ancount; + uint16_t _ancount; /** \brief auth sec */ - uint16_t nscount; + uint16_t _nscount; /** \brief add sec */ - uint16_t arcount; + uint16_t _arcount; }; typedef struct type_struct_header t_header; @@ -60,15 +60,15 @@ typedef struct type_struct_header t_header; struct type_struct_packet { /** \brief header section */ - t_header *header; + t_header *_header; /** \brief question section */ - t_rrset *question; + t_rrset *_question; /** \brief answer section */ - t_rrset *answer; + t_rrset *_answer; /** \brief auth section */ - t_rrset *authority; + t_rrset *_authority; /** \brief add section */ - t_rrset *additional; + t_rrset *_additional; }; typedef struct type_struct_packet t_packet;