Open Model Railroad Network (OpenMRN)
Loading...
Searching...
No Matches
in.h File Reference
#include <inttypes.h>
#include <sys/socket.h>
#include <endian.h>

Go to the source code of this file.

Classes

struct  in_addr
 Structure describing an Internet address. More...
 
struct  sockaddr_in
 Structure describing an Internet socket address. More...
 

Macros

#define INADDR_ANY   (0)
 Listen on all network interfaces for incoming connections.
 
#define IPPROTO_TCP   (6)
 TCP Raw Socket.
 
#define IPPROTO_UDP   (17)
 UDP Raw Socket.
 
#define IPPROTO_RAW   (255)
 Raw Socket.
 
#define ntohl(x)   __bswap_32 (x)
 Converts a network endian long value to host endian.
 
#define ntohs(x)   __bswap_16 (x)
 Converts a network endian short value to host endian.
 
#define htonl(x)   __bswap_32 (x)
 Converts a host endian long value to network endian.
 
#define htons(x)   __bswap_16 (x)
 Converts a host endian short value to network endian.
 

Typedefs

typedef uint32_t in_addr_t
 Primitive typeholding an ipv4 address.
 

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 netinet/in.h prototypes.

Author
Stuart W. Baker
Date
18 March 2016

Definition in file in.h.

Macro Definition Documentation

◆ htonl

#define htonl (   x)    __bswap_32 (x)

Converts a host endian long value to network endian.

Definition at line 91 of file in.h.

◆ htons

#define htons (   x)    __bswap_16 (x)

Converts a host endian short value to network endian.

Definition at line 93 of file in.h.

◆ INADDR_ANY

#define INADDR_ANY   (0)

Listen on all network interfaces for incoming connections.

Definition at line 67 of file in.h.

◆ IPPROTO_RAW

#define IPPROTO_RAW   (255)

Raw Socket.

Definition at line 76 of file in.h.

◆ IPPROTO_TCP

#define IPPROTO_TCP   (6)

TCP Raw Socket.

Definition at line 70 of file in.h.

◆ IPPROTO_UDP

#define IPPROTO_UDP   (17)

UDP Raw Socket.

Definition at line 73 of file in.h.

◆ ntohl

#define ntohl (   x)    __bswap_32 (x)

Converts a network endian long value to host endian.

Definition at line 87 of file in.h.

◆ ntohs

#define ntohs (   x)    __bswap_16 (x)

Converts a network endian short value to host endian.

Definition at line 89 of file in.h.

Typedef Documentation

◆ in_addr_t

typedef uint32_t in_addr_t

Primitive typeholding an ipv4 address.

Definition at line 46 of file in.h.