O nás     Inzerce     KontaktSpolehlivé informace o IT již od roku 2011
Hledat
Nepřehlédněte: Usnadní vám práci: Pozoruhodné IT produkty pro rok 2024
Správa dokumentů
Digitální transformace
Informační systémy
Hlavní rubriky: Informační systémy, Mobilní technologie, Datová centra, Sítě, IT bezpečnost, Software, Hardware, Zkušenosti a názory, Speciály

Pozoruhodné IT produkty 2024
E-knihy o IT zdarma
Manuál Linux
[Linux manuál]

inet_ntop: Analyzovat struktury síťových adres

Originální popis anglicky: inet_ntop - Parse network address structures

Návod, kniha: Linux Programmer's Manual

STRUČNĚ

#include <sys/types.h>
#include <sys/socket.h>
#include <arpa/inet.h>
 
const char *inet_ntop(int af, const void *src, char *dst, socklen_t cnt);

POPIS / INSTRUKCE

This function converts the network address structure src in the af address family into a character string, which is copied to a character buffer dst, which is cnt bytes long.
inet_ntop(3) extends the inet_ntoa(3) function to support multiple address families, inet_ntoa(3) is now considered to be deprecated in favor of inet_ntop(3). The following address families are currently supported:
AF_INET
src points to a struct in_addr (network byte order format) which is converted to an IPv4 network address in the dotted-quad format, " ddd.ddd.ddd.ddd". The buffer dst must be at least INET_ADDRSTRLEN bytes long.
AF_INET6
src points to a struct in6_addr (network byte order format) which is converted to a representation of this address in the most appropriate IPv6 network address format for this address. The buffer dst must be at least INET6_ADDRSTRLEN bytes long.

NÁVRATOVÁ HODNOTA

inet_ntop returns a non-null pointer to dst. NULL is returned if there was an error, with errno set to EAFNOSUPPORT if af was not set to a valid address family, or to ENOSPC if the converted address string would exceed the size of dst given by the cnt argument.

ODPOVÍDAJÍCÍ

POSIX 1003.1-2001. Note that RFC 2553 defines a prototype where the last parameter cnt is of type size_t. Many systems follow RFC 2553. Glibc 2.0 and 2.1 have size_t, but 2.2 has socklen_t.

SOUVISEJÍCÍ

inet_pton(3)

BUGS

AF_INET6 converts IPv6-mapped IPv4 addresses into an IPv6 format.
2000-12-18 Linux Man Page
©2011-2024 BusinessIT.cz, ISSN 1805-0522 | Názvy použité v textech mohou být ochrannými známkami příslušných vlastníků.
Provozovatel: Bispiral, s.r.o., kontakt: BusinessIT(at)Bispiral.com | Inzerce: Best Online Media, s.r.o., zuzana@online-media.cz
O vydavateli | Pravidla webu BusinessIT.cz a ochrana soukromí | Používáme účetní program Money S3 | pg(9153)