Blame include/uapi/linux/if_addr.h

Packit Service 3880ab
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
Packit Service 3880ab
#ifndef __LINUX_IF_ADDR_H
Packit Service 3880ab
#define __LINUX_IF_ADDR_H
Packit Service 3880ab
Packit Service 3880ab
#include <linux/types.h>
Packit Service 3880ab
#include <linux/netlink.h>
Packit Service 3880ab
Packit Service 3880ab
struct ifaddrmsg {
Packit Service 3880ab
	__u8		ifa_family;
Packit Service 3880ab
	__u8		ifa_prefixlen;	/* The prefix length		*/
Packit Service 3880ab
	__u8		ifa_flags;	/* Flags			*/
Packit Service 3880ab
	__u8		ifa_scope;	/* Address scope		*/
Packit Service 3880ab
	__u32		ifa_index;	/* Link index			*/
Packit Service 3880ab
};
Packit Service 3880ab
Packit Service 3880ab
/*
Packit Service 3880ab
 * Important comment:
Packit Service 3880ab
 * IFA_ADDRESS is prefix address, rather than local interface address.
Packit Service 3880ab
 * It makes no difference for normally configured broadcast interfaces,
Packit Service 3880ab
 * but for point-to-point IFA_ADDRESS is DESTINATION address,
Packit Service 3880ab
 * local address is supplied in IFA_LOCAL attribute.
Packit Service 3880ab
 *
Packit Service 3880ab
 * IFA_FLAGS is a u32 attribute that extends the u8 field ifa_flags.
Packit Service 3880ab
 * If present, the value from struct ifaddrmsg will be ignored.
Packit Service 3880ab
 */
Packit Service 3880ab
enum {
Packit Service 3880ab
	IFA_UNSPEC,
Packit Service 3880ab
	IFA_ADDRESS,
Packit Service 3880ab
	IFA_LOCAL,
Packit Service 3880ab
	IFA_LABEL,
Packit Service 3880ab
	IFA_BROADCAST,
Packit Service 3880ab
	IFA_ANYCAST,
Packit Service 3880ab
	IFA_CACHEINFO,
Packit Service 3880ab
	IFA_MULTICAST,
Packit Service 3880ab
	IFA_FLAGS,
Packit Service 3880ab
	IFA_RT_PRIORITY,  /* u32, priority/metric for prefix route */
Packit Service 3880ab
	IFA_TARGET_NETNSID,
Packit Service 3880ab
	__IFA_MAX,
Packit Service 3880ab
};
Packit Service 3880ab
Packit Service 3880ab
#define IFA_MAX (__IFA_MAX - 1)
Packit Service 3880ab
Packit Service 3880ab
/* ifa_flags */
Packit Service 3880ab
#define IFA_F_SECONDARY		0x01
Packit Service 3880ab
#define IFA_F_TEMPORARY		IFA_F_SECONDARY
Packit Service 3880ab
Packit Service 3880ab
#define	IFA_F_NODAD		0x02
Packit Service 3880ab
#define IFA_F_OPTIMISTIC	0x04
Packit Service 3880ab
#define IFA_F_DADFAILED		0x08
Packit Service 3880ab
#define	IFA_F_HOMEADDRESS	0x10
Packit Service 3880ab
#define IFA_F_DEPRECATED	0x20
Packit Service 3880ab
#define IFA_F_TENTATIVE		0x40
Packit Service 3880ab
#define IFA_F_PERMANENT		0x80
Packit Service 3880ab
#define IFA_F_MANAGETEMPADDR	0x100
Packit Service 3880ab
#define IFA_F_NOPREFIXROUTE	0x200
Packit Service 3880ab
#define IFA_F_MCAUTOJOIN	0x400
Packit Service 3880ab
#define IFA_F_STABLE_PRIVACY	0x800
Packit Service 3880ab
Packit Service 3880ab
struct ifa_cacheinfo {
Packit Service 3880ab
	__u32	ifa_prefered;
Packit Service 3880ab
	__u32	ifa_valid;
Packit Service 3880ab
	__u32	cstamp; /* created timestamp, hundredths of seconds */
Packit Service 3880ab
	__u32	tstamp; /* updated timestamp, hundredths of seconds */
Packit Service 3880ab
};
Packit Service 3880ab
Packit Service 3880ab
/* backwards compatibility for userspace */
Packit Service 3880ab
#define IFA_RTA(r)  ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct ifaddrmsg))))
Packit Service 3880ab
#define IFA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct ifaddrmsg))
Packit Service 3880ab
Packit Service 3880ab
#endif