Server for Information Technologies ������ ��������������
������� �������������� ����������
(095) 932-9212, 932-9213, 939-0783
E-mail: [email protected]
������ �������� ����(!) ������������� ���������� CIT Forum CD-ROM

GETHOSTBYADDR(3)

��������
gethostent, gethostbyaddr, gethostbyname, sethostent, endhostent - �������� �������� � ������� ������� ������

���������

	#include <netdb.h>
	 
	struct hostent *gethostent()
	 
	struct hostent *gethostbyname(name)
	char *name;
	 
	struct hostent *gethostbyaddr(addr,len,type)
	char *addr; int len,type;
	 
	sethostent(stayopen)
	int stayopen
	 
	endhostent()

��������
������� gethostent, gethostbyname � gethostbyaddr ���������� ��������� �� ������, ������� ��������� ��������� � ����������� ������ � ������� ������� �� /etc/hosts:

	struct hostent {
	   char   *h_name;     /* ����������� host-��� */
	   char   **h_aliases; /* ������ ����������� */
	   int    h_addrtype;  /* ��� ������ */
	   int    h_length;    /* ����� ������ */
	   char   *h_addr;     /* ����� */
	};

�������� ���������
h_name ����������� ��� ������� ������.
h_aliases ������ �������������� ���� ������� ������, �������������� �����.
h_addrtype ��� ������������� ������; � ��������� ����� ������ AF_INET.
h_length ����� ������ � ������.
h_addr ��������� �� ������� ����� ��� ������� ������.

������� gethostent ��������� ��������� ������ �����, � ������ ������������� �������� ���� ����.

������� sethostent ��������� � ��������� � ������ �����. ���� ���� stayopen ����� ��������� ��������, ������� �� �� ����� ����������� ����� ������� ������ ������� gethostent.

������� endhostent ��������� ����.

������� gethostbyname � gethostbyaddr ��������������� ������������� ���� � ������ ������ � ������� ����� ��� ������ ������� ������.

�����

	/etc/hosts

�����������
�� ���������� ����� ����� ��� � ������ ��������� ������ ������������ ������� ���������.

���������
��� ���������� ����������� � ����������� �������, ������� � ����� ���������� �� ���������� �����������. ����� ����� ����� ������ ������ Internet.
Comments: [email protected]
Designed by Andrey Novikov
Copyright © CIT