The manual
ginnOS
The reference: libc, the libraries and the kernel
Toggle main menu visibility
Loading...
Searching...
No Matches
inet.h
Go to the documentation of this file.
1
#pragma once
2
3
#include <
netinet/in.h
>
4
5
/**
6
* @file arpa/inet.h
7
* @brief IPv4 addresses as text ("10.0.2.15") and back.
8
*/
9
10
/**
11
* text to an address.
12
* @param af AF_INET.
13
* @param dst receives a struct in_addr.
14
* @return 1, 0 if src is not an address, -1 (EAFNOSUPPORT) for another af.
15
*/
16
int
inet_pton
(
int
af,
const
char
*src,
void
*dst);
17
18
/**
19
* an address to text.
20
* @param size at least INET_ADDRSTRLEN for AF_INET.
21
* @return dst, or NULL (EAFNOSUPPORT, ENOSPC).
22
*/
23
const
char
*
inet_ntop
(
int
af,
const
void
*src,
char
*dst,
socklen_t
size);
24
25
/**
26
* text to an address, as inet_aton does; the address, or INADDR_NONE.
27
*/
28
in_addr_t
inet_addr
(
const
char
*text);
29
30
/**
31
* text to an address. as well as a.b.c.d this takes the older forms: a.b.c
32
* (c is 16 bits), a.b (b is 24 bits) and a (32 bits), each part in
33
* decimal, octal (0) or hex (0x).
34
* @return 1, or 0 if text is not an address.
35
*/
36
int
inet_aton
(
const
char
*text,
struct
in_addr
*out);
37
38
/**
39
* an address to text, in a buffer of the calling thread.
40
*/
41
char
*
inet_ntoa
(
struct
in_addr
in);
in.h
IPv4 addresses and ports, and the IP protocols.
in_addr_t
uint32_t in_addr_t
Definition
in.h:18
inet_addr
in_addr_t inet_addr(const char *text)
text to an address, as inet_aton does; the address, or INADDR_NONE.
inet_ntoa
char * inet_ntoa(struct in_addr in)
an address to text, in a buffer of the calling thread.
inet_ntop
const char * inet_ntop(int af, const void *src, char *dst, socklen_t size)
an address to text.
inet_pton
int inet_pton(int af, const char *src, void *dst)
text to an address.
inet_aton
int inet_aton(const char *text, struct in_addr *out)
text to an address.
socklen_t
unsigned int socklen_t
Definition
socket.h:21
in_addr
Definition
in.h:22
src
libc
include
arpa
inet.h
Generated by
1.18.0