0001
0002 #ifndef _UAPI__LINUX_MROUTE6_H
0003 #define _UAPI__LINUX_MROUTE6_H
0004
0005 #include <linux/const.h>
0006 #include <linux/types.h>
0007 #include <linux/sockios.h>
0008 #include <linux/in6.h> /* For struct sockaddr_in6. */
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021 #define MRT6_BASE 200
0022 #define MRT6_INIT (MRT6_BASE)
0023 #define MRT6_DONE (MRT6_BASE+1)
0024 #define MRT6_ADD_MIF (MRT6_BASE+2)
0025 #define MRT6_DEL_MIF (MRT6_BASE+3)
0026 #define MRT6_ADD_MFC (MRT6_BASE+4)
0027 #define MRT6_DEL_MFC (MRT6_BASE+5)
0028 #define MRT6_VERSION (MRT6_BASE+6)
0029 #define MRT6_ASSERT (MRT6_BASE+7)
0030 #define MRT6_PIM (MRT6_BASE+8)
0031 #define MRT6_TABLE (MRT6_BASE+9)
0032 #define MRT6_ADD_MFC_PROXY (MRT6_BASE+10)
0033 #define MRT6_DEL_MFC_PROXY (MRT6_BASE+11)
0034 #define MRT6_FLUSH (MRT6_BASE+12)
0035 #define MRT6_MAX (MRT6_BASE+12)
0036
0037 #define SIOCGETMIFCNT_IN6 SIOCPROTOPRIVATE
0038 #define SIOCGETSGCNT_IN6 (SIOCPROTOPRIVATE+1)
0039 #define SIOCGETRPF (SIOCPROTOPRIVATE+2)
0040
0041
0042 #define MRT6_FLUSH_MFC 1
0043 #define MRT6_FLUSH_MFC_STATIC 2
0044 #define MRT6_FLUSH_MIFS 4
0045 #define MRT6_FLUSH_MIFS_STATIC 8
0046
0047 #define MAXMIFS 32
0048 typedef unsigned long mifbitmap_t;
0049 typedef unsigned short mifi_t;
0050 #define ALL_MIFS ((mifi_t)(-1))
0051
0052 #ifndef IF_SETSIZE
0053 #define IF_SETSIZE 256
0054 #endif
0055
0056 typedef __u32 if_mask;
0057 #define NIFBITS (sizeof(if_mask) * 8)
0058
0059 typedef struct if_set {
0060 if_mask ifs_bits[__KERNEL_DIV_ROUND_UP(IF_SETSIZE, NIFBITS)];
0061 } if_set;
0062
0063 #define IF_SET(n, p) ((p)->ifs_bits[(n)/NIFBITS] |= (1 << ((n) % NIFBITS)))
0064 #define IF_CLR(n, p) ((p)->ifs_bits[(n)/NIFBITS] &= ~(1 << ((n) % NIFBITS)))
0065 #define IF_ISSET(n, p) ((p)->ifs_bits[(n)/NIFBITS] & (1 << ((n) % NIFBITS)))
0066 #define IF_COPY(f, t) bcopy(f, t, sizeof(*(f)))
0067 #define IF_ZERO(p) bzero(p, sizeof(*(p)))
0068
0069
0070
0071
0072
0073
0074 struct mif6ctl {
0075 mifi_t mif6c_mifi;
0076 unsigned char mif6c_flags;
0077 unsigned char vifc_threshold;
0078 __u16 mif6c_pifi;
0079 unsigned int vifc_rate_limit;
0080 };
0081
0082 #define MIFF_REGISTER 0x1
0083
0084
0085
0086
0087
0088 struct mf6cctl {
0089 struct sockaddr_in6 mf6cc_origin;
0090 struct sockaddr_in6 mf6cc_mcastgrp;
0091 mifi_t mf6cc_parent;
0092 struct if_set mf6cc_ifset;
0093 };
0094
0095
0096
0097
0098
0099 struct sioc_sg_req6 {
0100 struct sockaddr_in6 src;
0101 struct sockaddr_in6 grp;
0102 unsigned long pktcnt;
0103 unsigned long bytecnt;
0104 unsigned long wrong_if;
0105 };
0106
0107
0108
0109
0110
0111 struct sioc_mif_req6 {
0112 mifi_t mifi;
0113 unsigned long icount;
0114 unsigned long ocount;
0115 unsigned long ibytes;
0116 unsigned long obytes;
0117 };
0118
0119
0120
0121
0122
0123
0124
0125
0126
0127
0128
0129
0130
0131
0132
0133 struct mrt6msg {
0134 #define MRT6MSG_NOCACHE 1
0135 #define MRT6MSG_WRONGMIF 2
0136 #define MRT6MSG_WHOLEPKT 3
0137 #define MRT6MSG_WRMIFWHOLE 4
0138 __u8 im6_mbz;
0139 __u8 im6_msgtype;
0140 __u16 im6_mif;
0141 __u32 im6_pad;
0142 struct in6_addr im6_src, im6_dst;
0143 };
0144
0145
0146 enum {
0147 IP6MRA_CREPORT_UNSPEC,
0148 IP6MRA_CREPORT_MSGTYPE,
0149 IP6MRA_CREPORT_MIF_ID,
0150 IP6MRA_CREPORT_SRC_ADDR,
0151 IP6MRA_CREPORT_DST_ADDR,
0152 IP6MRA_CREPORT_PKT,
0153 __IP6MRA_CREPORT_MAX
0154 };
0155 #define IP6MRA_CREPORT_MAX (__IP6MRA_CREPORT_MAX - 1)
0156
0157 #endif