📄 dns.h
字号:
/************************************************************************//* *//* MODULE: dns.h *//* PRODUCT: Netutils *//* DATE: 03/01/1997 *//* *//*----------------------------------------------------------------------*//* *//* Copyright 1997, Integrated Systems Inc. *//* ALL RIGHTS RESERVED *//* *//* This computer program is the property of Integrated Systems Inc. *//* Sunnyvale, California, U.S.A. and may not be copied *//* in any form or by any means, whether in part or in whole, *//* except under license expressly granted by Integrated Systems Inc. *//* *//* All copies of this program, whether in part or in whole, and *//* whether modified or not, must display this and all other *//* embedded copyright and ownership notices in full. *//* *//************************************************************************//* * nudns.h * * Contains the configuration structures for resolver */#ifndef _NURESCFG_H#define _NURESCFG_H#define MAX_ADDR_LIST 10#define MAX_HOSTNAME_LEN 255#define MAX_NETNAME_LEN 16struct hostent { char *h_name; /* official name of host */ char **h_aliases; /* alias list */ int h_addrtype; /* host address type */ int h_length; /* length of address */ char **h_addr_list; /* list of addresses *//* remaining members are for internal use only */ char h_names [MAX_HOSTNAME_LEN + 1]; char *h_pointers [MAX_ADDR_LIST]; unsigned long h_addresses [MAX_ADDR_LIST];};#define h_addr h_addr_list [0] /* address, for backward compatibility */struct netent { char *n_name; /* official name of net */ char **n_aliases; /* alias list */ int n_addrtype; /* net address type */ unsigned long n_net; /* network # *//* remaining member is for internal use only */ char n_names [MAX_NETNAME_LEN + 1];};typedef struct { char *ht_hostname; /* host name */ long ht_address; /* host address */ long ht_valid; /* if this entry is valid */} hosttab_t;typedef struct { char *nt_netname; /* net name */ long nt_netaddr; /* net address */ long nt_valid; /* if this entry is valid */} nettab_t;struct rescfg_t { long res_priority; /* priorities for resolution (encoded) */#define RES_STATIC 0x01#define RES_DNS 0x02 long res_dns_task_prio; /* priority for resolver timer task */ int res_dns_query_mode; /* Query mode */#define DNS_MODE_NOCHG 0x0000#define DNS_MODE_NOCACHE 0x0001#define DNS_MODE_CACHE_NET 0x0002#define DNS_MODE_CACHE_NONET 0x0003 long res_dns_max_ttl; /* maximim TTL for DNS RRs */ long res_dns_timeout; /* wait period for resolver timeouts */ long res_dns_retxmits; /* number of times resolver retransmits */ long res_dns_max_cache; /* maximim Cache entries */#define MAX_DNS_CACHE_DATA 512 long res_dns_no_servers; /* No of DNS servers */ long *res_dns_servers; /* List of DNS servers to probe */ char **res_dns_search_path; /* DNS search path */ long res_max_hosttab; /* Maximum entries in static host table */ long res_max_nettab; /* Maximum entries in static net table */ long res_dns_marktime; /* Mark time in secs for DNS cache mark time */ long res_dns_sweeptime; /* Sweep time in secs for DNS cache mark time */};typedef struct rescfg_t rescfg_t;extern int res_start(rescfg_t *);extern int res_modify(rescfg_t *);extern int gethostbyname(char *, struct hostent *);extern int gethostbyaddr(char *, int, int, struct hostent *);extern int getnetbyname(char *, struct netent *);extern int getnetbyaddr(long, int, struct netent *); /*"getnetby" functions not implemented---always return -1.*/extern int res_set_hostentry(unsigned long, char *);extern int res_del_hostentry(unsigned long);extern int res_get_hentbyname(char *, unsigned long *);extern int res_get_hentbyaddr(unsigned long, char *);#endif /* _NURESCFG_H */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -