Advertisement
Guest User

Untitled

a guest
Oct 10th, 2018
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 8.82 KB | None | 0 0
  1. /* IBM_PROLOG_BEGIN_TAG                                                   */
  2. /* This is an automatically generated prolog.                             */
  3. /*                                                                        */
  4. /* bos720 src/bos/usr/include/arpa/nameser_compat.h 1.5                   */
  5. /*                                                                        */
  6. /* Licensed Materials - Property of IBM                                   */
  7. /*                                                                        */
  8. /* Restricted Materials of IBM                                            */
  9. /*                                                                        */
  10. /* COPYRIGHT International Business Machines Corp. 1997,2000              */
  11. /* All Rights Reserved                                                    */
  12. /*                                                                        */
  13. /* US Government Users Restricted Rights - Use, duplication or            */
  14. /* disclosure restricted by GSA ADP Schedule Contract with IBM Corp.      */
  15. /*                                                                        */
  16. /* IBM_PROLOG_END_TAG                                                     */
  17. /* @(#)06   1.5  src/bos/usr/include/arpa/nameser_compat.h, sockinc, bos720 1/23/00 22:32:31 */
  18. #ifndef _H_ARPA_NAMESER_COMPAT_
  19. #define _H_ARPA_NAMESER_COMPAT_
  20. #ifdef _POWER_PROLOG_
  21. /*
  22.  *   COMPONENT_NAME: SOCKINC
  23.  *
  24.  *   FUNCTIONS: GETLONG, GETSHORT, PUTLONG, PUTSHORT
  25.  *
  26.  *   ORIGINS: 26,27
  27.  *
  28.  *   (C) COPYRIGHT International Business Machines Corp. 1985,1995
  29.  *   All Rights Reserved
  30.  *   Licensed Materials - Property of IBM
  31.  *   US Government Users Restricted Rights - Use, duplication or
  32.  *   disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  33.  */
  34. #endif /* _POWER_PROLOG_ */
  35.  
  36. /*
  37.  * Copyright (c) 1983 Regents of the University of California.
  38.  * All rights reserved.  The Berkeley software License Agreement
  39.  * specifies the terms and conditions for redistribution.
  40.  *
  41.  */
  42.  
  43. #include <sys/machine.h>
  44.  
  45. /*
  46.  * Define constants based on rfc883
  47.  */
  48.  
  49. #define PACKETSZ        NS_PACKETSZ
  50. #define MAXDNAME        NS_MAXDNAME
  51. #define MAXCDNAME       NS_MAXCDNAME
  52. #define MAXLABEL        NS_MAXLABEL
  53. #define HFIXEDSZ        NS_HFIXEDSZ
  54. #define QFIXEDSZ        NS_QFIXEDSZ
  55. #define RRFIXEDSZ       NS_RRFIXEDSZ
  56. #define INT32SZ         NS_INT32SZ
  57. #define INT16SZ         NS_INT16SZ
  58. #define INADDRSZ        NS_INADDRSZ
  59. #define IN6ADDRSZ       NS_IN6ADDRSZ
  60. #define INDIR_MASK      NS_CMPRSFLGS
  61. #define NAMESERVER_PORT NS_DEFAULTPORT
  62.  
  63. #ifdef OSECURE_UPDATE
  64. /* constants for non-standard update protocol. */
  65. #define UFIXEDSZ    NS_UFIXEDSZ
  66. #endif
  67.  
  68. /*
  69.  * Currently defined opcodes
  70.  */
  71. #define S_ZONE          ns_s_zn
  72. #define S_PREREQ        ns_s_pr
  73. #define S_UPDATE        ns_s_ud
  74. #define S_ADDT          ns_s_ar
  75.  
  76. #define QUERY           ns_o_query
  77. #define IQUERY          ns_o_iquery
  78. #define STATUS          ns_o_status
  79. #define NS_NOTIFY_OP    ns_o_notify
  80. #define NS_UPDATE_OP    ns_o_update
  81.  
  82. #define NOERROR         ns_r_noerror
  83. #define FORMERR         ns_r_formerr
  84. #define SERVFAIL        ns_r_servfail
  85. #define NXDOMAIN        ns_r_nxdomain
  86. #define NOTIMP          ns_r_notimpl
  87. #define REFUSED         ns_r_refused
  88. #define YXDOMAIN        ns_r_yxdomain
  89. #define YXRRSET         ns_r_yxrrset
  90. #define NXRRSET         ns_r_nxrrset
  91. #define NOTAUTH         ns_r_notauth
  92. #define NOTZONE         ns_r_notzone
  93.  
  94. #define DELETE          ns_uop_delete
  95. #define ADD             ns_uop_add
  96.  
  97. #define T_A             ns_t_a
  98. #define T_NS            ns_t_ns
  99. #define T_MD            ns_t_md
  100. #define T_MF            ns_t_mf
  101. #define T_CNAME         ns_t_cname
  102. #define T_SOA           ns_t_soa
  103. #define T_MB            ns_t_mb
  104. #define T_MG            ns_t_mg
  105. #define T_MR            ns_t_mr
  106. #define T_NULL          ns_t_null
  107. #define T_WKS           ns_t_wks
  108. #define T_PTR           ns_t_ptr
  109. #define T_HINFO         ns_t_hinfo
  110. #define T_MINFO         ns_t_minfo
  111. #define T_MX            ns_t_mx
  112. #define T_TXT           ns_t_txt
  113. #define T_RP            ns_t_rp
  114. #define T_AFSDB         ns_t_afsdb
  115. #define T_X25           ns_t_x25
  116. #define T_ISDN          ns_t_isdn
  117. #define T_RT            ns_t_rt
  118. #define T_NSAP          ns_t_nsap
  119. #define T_NSAP_PTR      ns_t_nsap_ptr
  120. #define T_SIG           ns_t_sig
  121. #define T_KEY           ns_t_key
  122. #define T_PX            ns_t_px
  123. #define T_GPOS          ns_t_gpos
  124. #define T_AAAA          ns_t_aaaa
  125. #define T_LOC           ns_t_loc
  126. #define T_NXT           ns_t_nxt
  127. #define T_EID           ns_t_eid
  128. #define T_NIMLOC        ns_t_nimloc
  129. #define T_SRV           ns_t_srv
  130. #define T_ATMA          ns_t_atma
  131. #define T_NAPTR         ns_t_naptr
  132. #define T_TSIG      ns_t_tsig
  133. #define T_IXFR          ns_t_ixfr
  134. #define T_AXFR          ns_t_axfr
  135. #define T_MAILB         ns_t_mailb
  136. #define T_MAILA         ns_t_maila
  137. #define T_ANY           ns_t_any
  138. #ifdef _AIX
  139. #define T_UINFO     ns_t_uinfo
  140. #define T_UID       ns_t_uid
  141. #define T_GID       ns_t_gid
  142. #define T_UNSPEC    ns_t_unspec
  143. #endif
  144.  
  145. #ifdef OSECURE_UPDATE
  146. #define TYPE_DELETE     ns_ouop_delete
  147. #define TYPE_ADDNEW     ns_ouop_addnew
  148. #define TYPE_ADDEXIST       ns_ouop_addexist
  149. #define TYPE_ADD        ns_ouop_add
  150. #define TYPE_ZONENAME       ns_ouop_zone
  151. #define UPD_ALIAS       ns_ourc_alias
  152. #define UPD_NAME_EXISTS     ns_ourc_yxdomain
  153. #define UPD_RECORD_ERROR    ns_ourc_nxrr
  154. #define UPD_ZONE_ERROR      ns_ourc_zoneerror
  155. #define UPD_VERSION_ERROR   ns_ourc_versionerror
  156. #define NOCHANGE        ns_ourc_nochange
  157. #endif /* OSECURE_UPDATE */
  158.  
  159. /*
  160.  * Values for class field
  161.  */
  162.  
  163. #define C_IN            ns_c_in
  164. #define C_CHAOS         ns_c_chaos
  165. #define C_HS            ns_c_hs
  166. /* BIND_UPDATE */
  167. #define C_NONE          ns_c_none
  168. #define C_ANY           ns_c_any
  169.  
  170. #ifndef BYTE_ORDER
  171. #define LITTLE_ENDIAN   1234    /* least-significant byte first (vax) */
  172. #define BIG_ENDIAN      4321    /* most-significant byte first (IBM, net) */
  173. #define PDP_ENDIAN      3412    /* LSB first in word, MSW first in long (pdp) */
  174.  
  175. #if defined(vax) || defined(ns32000) || defined(sun386) || defined(i386) || \
  176.     defined(MIPSEL) || defined(_MIPSEL) || defined(BIT_ZERO_ON_RIGHT) || \
  177.     defined(__alpha__) || defined(__alpha) || \
  178.     (defined(__Lynx__) && defined(__x86__))
  179. #define BYTE_ORDER      LITTLE_ENDIAN
  180. #endif
  181.  
  182. #if defined(sel) || defined(pyr) || defined(mc68000) || defined(sparc) || \
  183.     defined(is68k) || defined(tahoe) || defined(ibm032) || defined(ibm370) || \
  184.     defined(MIPSEB) || defined(_MIPSEB) || defined(_IBMR2) || defined(DGUX) ||\
  185.     defined(apollo) || defined(__convex__) || defined(_CRAY) || \
  186.     defined(RISC6000) || defined(_IBMESA) || defined(aiws) || \
  187.     defined(__hppa) || defined(__hp9000) || \
  188.     defined(__hp9000s300) || defined(__hp9000s700) || \
  189.     defined (BIT_ZERO_ON_LEFT) || defined(m68k) || \
  190.     (defined(__Lynx__) && \
  191.      (defined(__68k__) || defined(__sparc__) || defined(__powerpc__)))
  192. #define BYTE_ORDER      BIG_ENDIAN
  193. #endif
  194.  
  195. #endif /* BYTE_ORDER */
  196.  
  197. #ifndef BYTE_ORDER
  198.         /* you must determine what the correct bit order is for your compiler */
  199. #define   UNDEFINED_BIT_ORDER
  200. #endif
  201.  
  202. /*
  203.  * Structure for query header, the order of the fields is machine and
  204.  * compiler dependent, in our case, the bits within a byte are assignd
  205.  * least significant first, while the order of transmition is most
  206.  * significant first.  This requires a somewhat confusing rearrangement.
  207.  */
  208.  
  209. typedef struct {
  210.     u_short id;     /* query identification number */
  211. #if BYTE_ORDER == BIG_ENDIAN
  212.             /* fields in third byte */
  213.     u_int   qr:1;       /* response flag */
  214.     u_int   opcode:4;   /* purpose of message */
  215.     u_int   aa:1;       /* authoritive answer */
  216.     u_int   tc:1;       /* truncated message */
  217.     u_int   rd:1;       /* recursion desired */
  218.             /* fields in fourth byte */
  219.     u_int   ra:1;       /* recursion available */
  220.     u_int   ad:1;       /* authentic data from named */
  221.     u_int   cd:1;       /* checking disabled by resolver */
  222.     u_int   unused:1;   /* unused bits */
  223.     u_int   rcode:4;    /* response code */
  224. #endif
  225. #if BYTE_ORDER == LITTLE_ENDIAN
  226.             /* fields in third byte */
  227.     u_int   rd:1;       /* recursion desired */
  228.     u_int   tc:1;       /* truncated message */
  229.     u_int   aa:1;       /* authoritive answer */
  230.     u_int   opcode:4;   /* purpose of message */
  231.     u_int   qr:1;       /* response flag */
  232.             /* fields in fourth byte */
  233.     u_int   rcode:4;    /* response code */
  234.     u_int   cd:1;       /* checking disabled by resolver */
  235.     u_int   ad:1;       /* authentic data from named */
  236.     u_int   unused:1;   /* unused bits */
  237.     u_int   ra:1;       /* recursion available */
  238. #endif
  239.             /* remaining bytes */
  240.     u_short qdcount;    /* number of question entries */
  241.     u_short ancount;    /* number of answer entries */
  242.     u_short nscount;    /* number of authority entries */
  243.     u_short arcount;    /* number of resource entries */
  244. } HEADER;
  245.  
  246. #define GETSHORT    NS_GET16
  247. #define GETLONG     NS_GET32
  248. #define PUTSHORT    NS_PUT16
  249. #define PUTLONG     NS_PUT32
  250.  
  251. #endif  /* _H_ARPA_NAMESER_COMPAT_ */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement