home *** CD-ROM | disk | FTP | other *** search
/ ARM Club 3 / TheARMClub_PDCD3.iso / hensa / internet / dnsquery_1 / h / dnsquerymx < prev   
Text File  |  1996-02-10  |  2KB  |  53 lines

  1. /*
  2.  *  DNSQueryMX.h
  3.  *
  4.  *  (Part of) A multiply threadable, multitasking DNS resolver
  5.  *
  6.  *  Copyright (C) Stewart Brodie, February 1996.
  7.  *  Portions are copyright Regents of the University California Berkeley
  8.  *
  9.  *  This code may be freely used in applications designed to work with the
  10.  *  Acorn TCP/IP stack or FreeNet or compatible stacks for RISC OS, provided
  11.  *  that a copy of the UCB copyright & disclaimer message is included, and
  12.  *  also my own disclaimer.
  13.  *
  14.  *  This code is based on the res_ function code from BIND-4.9.3-REL
  15.  *  but with extensive modifications to make it state driven.
  16.  */
  17. #ifndef dnsquerymx_h_included
  18. #define dnsquerymx_h_included
  19.  
  20. #ifdef __cplusplus
  21. extern "C" {
  22. #endif
  23.  
  24. typedef struct dnsquery_mx {
  25.         int    preference;
  26.         char    hostname[MAXDNAME];
  27. } dnsquery_mx;
  28.  
  29. /* dnsquery_mx *dnsquery_getanswerraw(dnsquery *query, int *mxhostcount)
  30.  *
  31.  * Similar to dnsquery_getanswer, but used when the lookup was T_MX
  32.  * in order to retrieve a sanitised structure containing the response.
  33.  *
  34.  * You must only ever make this call after dnsquery_check(query) has
  35.  * returned dns_query_complete_success.  You must not make this call
  36.  * after 'query' has been passed to dnsquery_dispose.
  37.  *
  38.  * You can make this call more than once in between those two states,
  39.  * although there is a performance hit with this function call
  40.  *
  41.  * This function returns you a pointer to an array of dnsquery_mx
  42.  * structures.  The number of structures is stored in mxhostcount.
  43.  * The returned pointer remains valid until the 'query' has been passed
  44.  * to dnsquery_dispose.  The mxhostcount may be set to zero, indicating
  45.  * no responses, and in that case, the pointer may not be valid.
  46.  */
  47. extern dnsquery_mx *dnsquery_getanswermx(dnsquery *, int *);
  48.  
  49. #ifdef __cplusplus
  50. }
  51. #endif
  52. #endif
  53.