Open Model Railroad Network (OpenMRN)
Loading...
Searching...
No Matches
inet.h File Reference
#include <netinet/in.h>

Go to the source code of this file.

Functions

int inet_aton (const char *name, struct in_addr *addr)
 Converts a number-and-dot notation internet address to binary form.
 
uint32_t inet_addr (const char *name)
 Converts a number-and-dot notation internet address to network byte order form.
 
char * inet_ntoa (struct in_addr addr)
 Converts an address to textual representation.
 
const char * inet_ntop (int af, const void *src, char *dst, socklen_t size)
 Convert the network address in src to a character string in src.
 

Detailed Description

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  • Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  • Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

This file implements POSIX arpa/inet.h prototypes.

Author
Stuart W. Baker
Date
19 March 2016

Definition in file inet.h.

Function Documentation

◆ inet_addr()

uint32_t inet_addr ( const char *  name)

Converts a number-and-dot notation internet address to network byte order form.

Parameters
nameis the text representation.
Returns
the 32-bit address in ntwork byte order, or -1 if there is an error.

Converts a number-and-dot notation internet address to network byte order form.

Parameters
namestring containing dotted decimal representation
Returns
binary address representation

Definition at line 999 of file FreeRTOSTCPSocket.cxx.

◆ inet_aton()

int inet_aton ( const char *  name,
struct in_addr addr 
)

Converts a number-and-dot notation internet address to binary form.

Parameters
namestandard argument
addrstandard argument
Returns
error code

◆ inet_ntoa()

char * inet_ntoa ( struct in_addr  addr)

Converts an address to textual representation.

Not reentrant.

Parameters
addris the address.
Returns
the textual form of the address (statically allocated buffer).

Converts an address to textual representation.

Parameters
addran in_addr structure containing the IP address
Returns
returns a string in dotted decimal representation

Definition at line 987 of file FreeRTOSTCPSocket.cxx.

◆ inet_ntop()

const char * inet_ntop ( int  af,
const void *  src,
char *  dst,
socklen_t  size 
)

Convert the network address in src to a character string in src.

Parameters
afaddress family, AF_INET or AF_INET6
srcsource address in network byte order
dstresulting address string
sizemax number characters allowed for the result
Returns
on success non-null pointer to dst, else NULL with errno set on error

Definition at line 1244 of file net_cc3220/CC32xxSocket.cxx.