linux/include/uapi/linux/in.h

/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
/*
 * INET		An implementation of the TCP/IP protocol suite for the LINUX
 *		operating system.  INET is implemented using the  BSD Socket
 *		interface as the means of communication with the user level.
 *
 *		Definitions of the Internet Protocol.
 *
 * Version:	@(#)in.h	1.0.1	04/21/93
 *
 * Authors:	Original taken from the GNU Project <netinet/in.h> file.
 *		Fred N. van Kempen, <[email protected]>
 *
 *		This program is free software; you can redistribute it and/or
 *		modify it under the terms of the GNU General Public License
 *		as published by the Free Software Foundation; either version
 *		2 of the License, or (at your option) any later version.
 */
#ifndef _UAPI_LINUX_IN_H
#define _UAPI_LINUX_IN_H

#include <linux/types.h>
#include <linux/stddef.h>
#include <linux/libc-compat.h>
#include <linux/socket.h>

#if __UAPI_DEF_IN_IPPROTO
/* Standard well-defined IP protocols.  */
enum {};
#endif

#if __UAPI_DEF_IN_ADDR
/* Internet address. */
struct in_addr {};
#endif

#define IP_TOS
#define IP_TTL
#define IP_HDRINCL
#define IP_OPTIONS
#define IP_ROUTER_ALERT
#define IP_RECVOPTS
#define IP_RETOPTS
#define IP_PKTINFO
#define IP_PKTOPTIONS
#define IP_MTU_DISCOVER
#define IP_RECVERR
#define IP_RECVTTL
#define IP_RECVTOS
#define IP_MTU
#define IP_FREEBIND
#define IP_IPSEC_POLICY
#define IP_XFRM_POLICY
#define IP_PASSSEC
#define IP_TRANSPARENT

/* BSD compatibility */
#define IP_RECVRETOPTS

/* TProxy original addresses */
#define IP_ORIGDSTADDR
#define IP_RECVORIGDSTADDR

#define IP_MINTTL
#define IP_NODEFRAG
#define IP_CHECKSUM
#define IP_BIND_ADDRESS_NO_PORT
#define IP_RECVFRAGSIZE
#define IP_RECVERR_RFC4884

/* IP_MTU_DISCOVER values */
#define IP_PMTUDISC_DONT
#define IP_PMTUDISC_WANT
#define IP_PMTUDISC_DO
#define IP_PMTUDISC_PROBE
/* Always use interface mtu (ignores dst pmtu) but don't set DF flag.
 * Also incoming ICMP frag_needed notifications will be ignored on
 * this socket to prevent accepting spoofed ones.
 */
#define IP_PMTUDISC_INTERFACE
/* weaker version of IP_PMTUDISC_INTERFACE, which allows packets to get
 * fragmented if they exceed the interface mtu
 */
#define IP_PMTUDISC_OMIT

#define IP_MULTICAST_IF
#define IP_MULTICAST_TTL
#define IP_MULTICAST_LOOP
#define IP_ADD_MEMBERSHIP
#define IP_DROP_MEMBERSHIP
#define IP_UNBLOCK_SOURCE
#define IP_BLOCK_SOURCE
#define IP_ADD_SOURCE_MEMBERSHIP
#define IP_DROP_SOURCE_MEMBERSHIP
#define IP_MSFILTER
#define MCAST_JOIN_GROUP
#define MCAST_BLOCK_SOURCE
#define MCAST_UNBLOCK_SOURCE
#define MCAST_LEAVE_GROUP
#define MCAST_JOIN_SOURCE_GROUP
#define MCAST_LEAVE_SOURCE_GROUP
#define MCAST_MSFILTER
#define IP_MULTICAST_ALL
#define IP_UNICAST_IF
#define IP_LOCAL_PORT_RANGE
#define IP_PROTOCOL

#define MCAST_EXCLUDE
#define MCAST_INCLUDE

/* These need to appear somewhere around here */
#define IP_DEFAULT_MULTICAST_TTL
#define IP_DEFAULT_MULTICAST_LOOP

/* Request struct for multicast socket ops */

#if __UAPI_DEF_IP_MREQ
struct ip_mreq  {};

struct ip_mreqn {};

struct ip_mreq_source {};

struct ip_msfilter {};

#define IP_MSFILTER_SIZE(numsrc)

struct group_req {};

struct group_source_req {};

struct group_filter {};

#define GROUP_FILTER_SIZE(numsrc)
#endif

#if __UAPI_DEF_IN_PKTINFO
struct in_pktinfo {};
#endif

/* Structure describing an Internet (IP) socket address. */
#if  __UAPI_DEF_SOCKADDR_IN
#define __SOCK_SIZE__
struct sockaddr_in {};
#define sin_zero
#endif

#if __UAPI_DEF_IN_CLASS
/*
 * Definitions of the bits in an Internet address integer.
 * On subnets, host and network parts are found according
 * to the subnet mask, not these masks.
 */
#define IN_CLASSA(a)
#define IN_CLASSA_NET
#define IN_CLASSA_NSHIFT
#define IN_CLASSA_HOST
#define IN_CLASSA_MAX

#define IN_CLASSB(a)
#define IN_CLASSB_NET
#define IN_CLASSB_NSHIFT
#define IN_CLASSB_HOST
#define IN_CLASSB_MAX

#define IN_CLASSC(a)
#define IN_CLASSC_NET
#define IN_CLASSC_NSHIFT
#define IN_CLASSC_HOST

#define IN_CLASSD(a)
#define IN_MULTICAST(a)
#define IN_MULTICAST_NET

#define IN_BADCLASS(a)
#define IN_EXPERIMENTAL(a)

#define IN_CLASSE(a)
#define IN_CLASSE_NET
#define IN_CLASSE_NSHIFT

/* Address to accept any incoming messages. */
#define INADDR_ANY

/* Address to send to all hosts. */
#define INADDR_BROADCAST

/* Address indicating an error return. */
#define INADDR_NONE

/* Dummy address for src of ICMP replies if no real address is set (RFC7600). */
#define INADDR_DUMMY

/* Network number for local host loopback. */
#define IN_LOOPBACKNET

/* Address to loopback in software to local host.  */
#define INADDR_LOOPBACK
#define IN_LOOPBACK(a)

/* Defines for Multicast INADDR */
#define INADDR_UNSPEC_GROUP
#define INADDR_ALLHOSTS_GROUP
#define INADDR_ALLRTRS_GROUP
#define INADDR_ALLSNOOPERS_GROUP
#define INADDR_MAX_LOCAL_GROUP
#endif

/* <asm/byteorder.h> contains the htonl type stuff.. */
#include <asm/byteorder.h> 


#endif /* _UAPI_LINUX_IN_H */